API-POST-v1-chat-ask

abstract

Non-streaming single-turn Q&A. Retrieves context chunks, generates a complete answer, and returns it in one JSON response. Does not persist the exchange to the database. Suitable for programmatic usage or simple integrations that don't require streaming.


🔒 Authentication

None.


🛠️ Technical Specification

Request

PropertyValue
MethodPOST
Path/api/v1/chat/ask
Tags["Chat"]

📦 Query Parameters

ParamTypeRequiredDescription
questionstringYesThe question to answer

Logic Flow

📤 Responses

StatusBodyCondition
200 OK{ answer: string, sources: chunk[] }Always — even when no context found
RoleFile
Routerbackend/app/api/v1/chat.py :: ask_question()
Retrievalbackend/app/services/retrieval_service.py
LLMbackend/app/services/llm_service.py

RoleLink
Streaming ask (preferred)API-GET-v1-chat-ask-stream
Semantic search onlyAPI-GET-v1-query-search