Docs · graph retrieval

Graph retrieval

How Claude reads the graph through tools

The problem

When Claude Code asks "where does user authentication happen?", flat text search misses the multi-hop trail — the file that validates a JWT may not contain the word "authentication" anywhere; it's reached through auth-middleware.ts → jwt-verifier.ts → crypto-utils.ts.

A graph fixes this: traversal beats grep when the answer is two or three hops away.

How retrieval works in Causalist today

We don't run Personalized PageRank or anything fancy at retrieval time. We expose eleven typed tools that Claude can reach for two ways: as CLI subcommands (preferred for Claude Code, per Anthropic's Code Execution with MCP recommendation — code over tool-call JSON), and as MCP tools (for Cursor, Claude.ai web, and any non-CLI client). Either way, the same eleven primitives:

Each call returns the same typed JSON envelope ({ ok, summary, data? }). Claude composes them: "find the neighbors of auth-middleware, then tests from those, then read the test files." Three calls, no re-grepping.

Why graph-first beats vector-first here

For factual code questions, graph traversal is grounded — the answer is in the graph by construction. Vector retrieval guesses from similarity. LocAgent (ACL 2025) shows graph-guided retrieval significantly outperforms flat vector search on code-localization benchmarks; HippoRAG (NeurIPS 2024) shows the same on multi-hop QA in general.

We don't reproduce their math here. We use the conclusion: typed graph tools work better than embeddings for this kind of question.