Skip to content

Chat

Ask questions and get answers with citations. See Answer mode.

Method Path
POST /api/v1/chat

POST /api/v1/chat

Answer a question over a case with citations and RAPTOR clusters. With stream: true the response is a Server-Sent Events stream (delta, citations, done, error); see Chat & streaming.

From the API schema: Ask a question to the corpus’ RAGFlow assistant.

With stream: false (default) returns a ChatResponse. With stream: true the response is text/event-stream with these events:

  • delta — \{"text": "..."\} incremental answer text
  • citations — \{"citations": Citation[], "clusters": AnswerCluster[]\} once the answer is complete
  • done — \{"sessionId": "..."\} (pass it back as sessionId to continue the conversation)
  • error — \{"message": "..."\}

Citations point to graph nodes (nodeIndex), so they can be focused in the 3D viewer. clusters are RAPTOR thematic summaries with the node indices they cover.

Auth: API key (X-API-Key) or user session

Request body

{
"case": "papers",
"question": "Which methods combine knowledge graphs with LLMs?"
}
Terminal window
curl -X POST "https://vol.example.com/api/v1/chat" \
-H "X-API-Key: $VOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"case":"papers","question":"Which methods combine knowledge graphs with LLMs?"}'

Response 200

{
"answer": "Several works ground LLMs on citation graphs [1] and summarise evidence recursively [2].",
"sessionId": "c6f1d2…",
"citations": [
{
"nodeIndex": 412,
"nodeId": "paper_412",
"title": "Graph-augmented retrieval for scientific QA",
"snippet": "We combine a citation graph with dense retrieval…",
"score": 0.87,
"docName": "paper_412.pdf",
"chunkId": "8c1e…"
}
],
"clusters": [
{
"id": "c_17",
"title": "Graph-based retrieval",
"summary": "Methods that use knowledge graphs to ground LLM answers.",
"nodeIndices": [
412,
977,
1503
]
}
]
}
interface ChatRequest { case: CaseId; question: string; sessionId?: string; stream?: boolean }
type CaseId = "papers" | "cordis" | "patents" | "trials";
interface ChatResponse { answer: string; sessionId: string; citations: Citation[]; clusters: AnswerCluster[] }
interface Citation {
nodeIndex: number;
nodeId: string;
title: string;
snippet: string;
score: number;
docName?: string;
chunkId?: string;
}
interface AnswerCluster { id: string; title: string; summary: string; nodeIndices: number[] }