Chat Endpoints
Two flavors are available: streaming SSE and a simple JSON response.
POST /api/chat/stream
Request (example):
{
"message": "What are the main themes?",
"method": "drift", // drift | local | global | basic
"maxTokens": 256,
"history": [{ "role": "user", "content": "..." }]
}
Events (SSE): status
, step-start
, step-end
, drift-log
, highlights
, answer-chunk
, answer
, warning
, error
, done
.
Notes:
- Runs
graphrag query --method <mode>
under the hood - Builds a compact context from
output/entities.json
+output/relationships.json
- Highlights are derived from entity title matches in the answer/question
POST /api/chat
Request body is the same as above (non-streaming). Returns:
{ "answer": "...", "highlights": ["entity_id", "..."] }
Last updated on