---
title: "Query Knowledge Base via RAG"
method: POST
path: "/llm/rag"
tags: ["llm"]
---

# Query Knowledge Base via RAG

`POST /llm/rag`

Query the Bedrock Knowledge Base using Retrieve and Generate (RAG).
Returns an answer with citations from the knowledge base.

## Request body

- object
  - `model` 'claude-opus-4-6' | 'claude-opus-4-5' | 'claude-sonnet-4-5' | 'nova-premier' | 'nova-2-sonic' | 'nova-2-lite' | 'nova-pro' | 'nova-lite' | 'nova-micro' — Model name to use for generation (default: nova-2-lite)
  - `query` string, required — Query string for the Knowledge Base

## Response `200`

RAG query completed successfully

- object
  - `citations` object[], required
    - `generated_response_part` object
      - `text` string
    - `references` object[]
      - `content` string
      - `location` object
        - `type` string
        - `uri` string
  - `metadata` object, required
    - `created_at` string, date-time
    - `knowledge_base_id` string
    - `model_arn` string
  - `output` string, required — Generated answer from the Knowledge Base

## Other responses

- `400` — Bad request
- `503` — Service unavailable
- `default` — Other error

---

[API](https://skmtc.dev/matlantis/apis/matlantis-web-ui-backend-api.md) · [All operations](https://skmtc.dev/matlantis/apis/matlantis-web-ui-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/matlantis/matlantis-web-ui-backend-api/revisions/b155f3a32673/schema)
