RAG retrieval graph
SUPERVISOR A LightRAG-style force-directed graph of the RAG corpus, at Admin → Knowledge → Knowledge Graph.What it shows
Nodes:
- Components (per vessel)
- Makers (deduped fleet-wide)
- Models (deduped fleet-wide)
- Source documents
- UCS codes
Edges connect them by retrieval co-occurrence — when a query retrieved node A and node B together, the edge weight goes up.
Controls
- Vessel selector — single vessel or whole fleet
- Node search — live filter
- Hover — dims unrelated nodes
- Click — opens a side drawer linking back to the component page
Capped at 1,000 nodes (sorted by degree desc). When truncated, stats.truncated=true appears in the drawer header.
Implementation
Pure SVG + self-contained Verlet spring simulation, no new runtime deps. Backend: GET /api/admin/rag-graph?vesselId=<n|all> returns {nodes, edges, stats}. Pure projection function in src/rag-graph-projection.js (fully unit-tested).