---
title: "Ask intelligence question"
method: POST
path: "/api/v1/sdk/intelligence/ask"
tags: ["public-api", "public-intelligence"]
---

# Ask intelligence question

`POST /api/v1/sdk/intelligence/ask`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/sdk/intelligence/ask`
- Auth: none declared

Ask a question using Intelligence Q&A with Knowledge Base RAG.

This endpoint provides programmatic access to AnomalyArmor's intelligence
Q&A system. It uses the generated markdown knowledge base as context
for accurate and comprehensive answers.

**SDK Usage:**
```python
from anomalyarmor import Client

client = Client()
answer = client.intelligence.ask(
    asset="postgresql.analytics",
    question="list upstream tables for schema.table_name"
)
print(answer.answer)
```

**CLI Usage:**
```bash
aa intelligence ask postgresql.analytics "list upstream tables for schema.table_name"
```

## Headers

- `Authorization` string

## Request body

- IntelligenceAskRequest: Request to ask an intelligence question.
  - `asset_id` string, required: Asset identifier (public UUID or qualified name like 'postgresql.mydb')
  - `question` string, required: Natural language question to ask
  - `include_related_assets` boolean: Include related assets in context

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
