Loading patterns…
Structure-Aware Codebase Retrieval (Repo Map)
Retrieval specialized for code that exploits program structure instead of (or alongside) embeddings. The repo is parsed into ASTs and a symbol and dependency graph with tree-sitter; files and symbols are ranked by graph centrality (Aider's PageRank-weighted tag map), graph-traversal tools walk call, definition, and import edges (AutoCodeRover and code-graph agents), and spectrum-based fault localization can narrow the search from failing tests. This lets a coding agent assemble a minimal, relevant context from a repository far larger than its context window. Distinct from `graph-rag`, whose graph is built from document entities rather than from code semantics.
In 30 seconds
- What
- Parses code into ASTs and builds a symbol-dependency graph, then ranks files and functions by centrality to retrieve only the most relevant code for a task.
- When to use
- Large codebases where embeddings alone miss structural relationships, or when a coding agent needs to navigate call chains and imports to understand context.
- Watch out
- Graph construction and ranking are expensive upfront; stale graphs cause retrieval misses if code structure changes between parses.
Ask the AI expert about this pattern
Opens the assistant with your question prefilled. You review it before sending.
Structure-Aware Codebase Retrieval (Repo Map): Overview
Retrieval specialized for code that exploits program structure instead of (or alongside) embeddings. The repo is parsed into ASTs and a symbol and dependency graph with tree-sitter; files and symbols are ranked by graph centrality (Aider's PageRank-weighted tag map), graph-traversal tools walk call, definition, and import edges (AutoCodeRover and code-graph agents), and spectrum-based fault localization can narrow the search from failing tests. This lets a coding agent assemble a minimal, relevant context from a repository far larger than its context window. Distinct from `graph-rag`, whose graph is built from document entities rather than from code semantics.
- Tree-sitter AST parse into a symbol table
- Symbol and dependency graph over call, def, and import edges
- PageRank-style centrality ranking of files and symbols
- Graph-traversal tools over the code graph
- Conversation-mentioned identifiers boosted in ranking
- Optional spectrum-based fault localization from failing tests
The Agent Architect
One pattern, one tradeoff, one production failure story. A short weekly briefing for people building agentic systems.
Weekly email, one-click unsubscribe. We only use your address to send the briefing.
References
The papers, specifications, and repositories this pattern is based on.
ReasoningLayer Box
Run these agents in your own office, with unlimited tokens.
The ReasoningLayer Box puts the models, the memory and your AI workers on a box at your place. Nothing leaves the building, nothing is metered, and there is no price per person. The design partner program is open by application: our lowest price and a direct say in the roadmap.
- No token meter, no credits
- Your data never leaves your building
- One box for a team of 10 to 20