Skip to content

Citations

Every answer cites its evidence. A citation is a retrieved chunk enriched with its node on the map:

interface Citation {
nodeIndex: number; // index in positions.bin / labels.json
nodeId: string; // "paper_123"
title: string;
snippet: string; // the passage used as evidence
score: number; // relevance 0..1
docName?: string; // source document name in RAGFlow
chunkId?: string; // RAGFlow chunk id
}

The answer text contains numbered markers. [1] refers to citations[0], [2] to citations[1], and grouped markers such as [1, 3] cite several sources. Depending on the RAGFlow version, raw output may use RAGFlow’s native 0-based formats ([ID:0], ##0$$); the React atoms and the embed understand all three.

The atoms package exports the parser it uses:

import { parseAnswer } from "@vol/atoms";
parseAnswer("Graphs help [1] and so do LLMs [2, 3].", 3);
// [{type:"text",text:"Graphs help "},{type:"cite",index:0},{type:"text",text:" and so do LLMs "},
// {type:"cite",index:1},{type:"cite",index:2},{type:"text",text:"."}]

Markers pointing past the end of citations are left as plain text.

  • Details: GET /graph/{case}/nodes/{nodeIndex} returns title, abstract, authors, year, venue and URL.
  • Position: read positions[nodeIndex * 3 .. + 2] from positions.bin.
  • Context: GET /graph/{case}/neighbors/{nodeIndex} for its neighbourhood.
  • In the app: link to /app/explore/{case}?node={nodeIndex} — the embed does this by default when a citation is clicked.

Show the number, title and snippet, and keep the order of citations — it matches the markers. <VolCitationList> implements this pattern.