---
title: "Query knowledge base"
method: POST
path: "/api/v1/rag/query"
tags: ["RAG"]
---

# Query knowledge base

`POST /api/v1/rag/query`

## Request

- Base URL: `http://dobby-ai.com`
- URL: `http://dobby-ai.com/api/v1/rag/query`
- Auth: HTTP bearer

Search your knowledge base using semantic search

## Request body

- object
  - `question` string, required: The question to search for
  - `max_chunks` integer: Maximum number of relevant chunks to return
  - `include_sources` boolean: Whether to include source document info

## Response `200`

Query results

- object
  - `success` boolean
  - `sources` object[]
    - `document_id` string
    - `content_preview` string
    - `similarity` number
  - `metadata` object
    - `chunks_found` integer
    - `query_time_ms` integer

## Other responses

- `400`: Bad Request - Invalid parameters
- `401`: Unauthorized - Missing or invalid authentication
- `403`: Forbidden - Missing required scope
- `429`: Too Many Requests - Rate limit exceeded

---

[API](https://skmtc.dev/dobby-ai/apis/dobby-platform-api.md) · [All operations](https://skmtc.dev/dobby-ai/apis/dobby-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dobby-ai/apis/dobby-platform-api/revisions/398634f0306f?raw)
