Retrieval & RAG

Repo Map

Give the agent a compact, ranked map of the codebase's symbols and their dependencies so it orients on what matters before reading any files.

Problem

Without a structural overview the agent explores blindly: it greps, opens files at random, and misses the few symbols that actually govern the change, while burning context on irrelevant code. It needs a high-signal summary of the repository's structure — which symbols exist and how they depend on each other — small enough to fit the window yet ranked so the important parts survive truncation.

Solution

Parse the repository with a language-aware parser such as tree-sitter into symbols (functions, classes, methods) and the call and import edges between them. Run a centrality measure like PageRank over that graph to score each symbol's importance, optionally biased toward files the current task mentions. Render the top-ranked symbols and their signatures as a compact text map and place it in the agent's context as orientation, refreshing it as the working tree changes. The agent reads the map first, then opens only the files the map points to.

When to use

  • The agent works in a codebase far larger than its context window.
  • A language-aware parser can extract symbols and dependency edges for the repository.
  • Orienting on structure before reading files would cut wasted context and missed-symbol errors.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related