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 aChatResponse. Withstream: truethe response istext/event-streamwith these events:
delta—\{"text": "..."\}incremental answer textcitations—\{"citations": Citation[], "clusters": AnswerCluster[]\}once the answer is completedone—\{"sessionId": "..."\}(pass it back assessionIdto continue the conversation)error—\{"message": "..."\}Citations point to graph nodes (
nodeIndex), so they can be focused in the 3D viewer.clustersare 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?"}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?"}'import { VolClient } from "@vol/sdk";
const vol = new VolClient({ baseUrl: "https://vol.example.com/api", apiKey: process.env.VOL_API_KEY });await vol.chat({ case: "papers", question: "Which methods combine knowledge graphs with LLMs?" });
// streamingfor await (const ev of vol.chatStream({ case: "papers", question: "…" })) console.log(ev);import os, requests
r = requests.post( "https://vol.example.com/api/v1/chat", headers={"X-API-Key": os.environ["VOL_API_KEY"]}, json={ "case": "papers", "question": "Which methods combine knowledge graphs with LLMs?" }, timeout=60,)r.raise_for_status()print(r.json())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[] }