Skip to content

Knowledge map

The knowledge map is a precomputed 3D layout of a case. Each document is a point; documents that discuss similar things are close together, and dense regions form clusters with a label and colour.

  1. Documents are chunked and embedded (bge-m3) when they are indexed in RAGFlow.
  2. Per-document vectors are projected to 3D and normalised to a bounded volume (see bounds in GET /graph/{case}/meta).
  3. A sparse similarity graph keeps the strongest links between nodes (links.bin).
  4. Clusters are detected on the layout and labelled (clusters.json): each node is assigned to one cluster.

The result is a set of static artifacts per graphVersion, served with long-lived cache headers so the map loads quickly even for 80k+ nodes.

File Contents
meta Node and link counts, bounds, number of clusters, version
positions.bin float32 little-endian x, y, z per node
links.bin int32 little-endian adjacency in ngraph format
labels.json Title per node (string[])
clusters.json Cluster list (label, colour, centroid, size) + node → cluster assignment

Byte-level details and decoding code are in Graph data formats.

You rarely need the whole graph on the server side. Two endpoints return small, weighted subgraphs:

  • GET /graph/{case}/neighbors/{nodeIndex}?hops=1|2&limit=30 — the neighbourhood of one node.
  • POST /graph/{case}/subgraph — the union of neighbourhoods for several nodes (for example, all citations of an answer).

Both return {center, nodes, edges} where edges are [a, b, weight] with weight in 0..1.

The VOL app renders the map with a WebGL viewer (@vol/viewer3d). In React you can use <VolGraph>, which lazy-loads the viewer only when it is needed.