---
title: "Answer a query using Retrieval-Augmented Generation (RAG)"
method: POST
path: "/rag/rag_session"
tags: ["rag"]
---

# Answer a query using Retrieval-Augmented Generation (RAG)

`POST /rag/rag_session`

## Query parameters

- `proj_id` integer, required
- `top_k` integer, required
- `threshold` number, required
- `model` string, required
- `session_id` string, nullable

## Request body

- BodyRagRagSession
  - `query` union, required
    - string
    - string[]
    - integer
  - `sdoc_ids` integer[], nullable, required

## Response `200`

Successful Response

- ChatSessionResponse
  - `response` string, required — The response of the model
  - `session_id` string, required — The session ID of the chat

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/uhh-lt/apis/discourse-analysis-tool-suite-api.md) · [All operations](https://skmtc.net/uhh-lt/apis/discourse-analysis-tool-suite-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/uhh-lt/discourse-analysis-tool-suite-api/revisions/6b22366ce2d1/schema)
