Skip to main content

Crate repomap_core

Crate repomap_core 

Source
Expand description

repomap core: a map of your codebase for AI agents.

Walks a repository (respecting .gitignore), parses code with tree-sitter, links imports and calls into a graph, ranks files with PageRank, groups them into Louvain communities, and indexes AST chunks with BM25 and, when the model is installed, a static code embedding. Queries: map, search, context, trace, impact.

Re-exports§

pub use index::BuildOptions;
pub use index::Index;
pub use query::ContextOptions;
pub use query::Direction;
pub use query::ImpactOptions;
pub use query::MapOptions;
pub use query::SearchOptions;
pub use query::TraceOptions;

Modules§

bm25
BM25 over code chunks (the Locus engine, now AST-chunked).
db
Database map: tables, columns, foreign keys and indexes, from a live database (introspected by the binary) or from schema sources in the repo: SQL migrations, Prisma, Drizzle, SQLAlchemy, Diesel and Django models. Tables are linked to the code that queries them.
export
Compact graph payload for the web UI and static HTML export.
graph
Linking: import resolution, call resolution, file graph, PageRank and Louvain communities.
index
Repository walk, per-file cache, and the assembled in-memory index.
lang
Language table: file extensions, tree-sitter grammars and the queries that extract definitions, calls, imports and heritage references.
multirepo
One graph across several repository roots.
parse
Per-file extraction: tree-sitter definitions, calls, imports and heritage references, plus BM25 chunks. The output is cached per file.
qterms
What a long natural-language query (an issue, a bug report, a stack trace) says about code: identifiers, file paths and module names, and the title.
query
The five questions agents ask: map, search, context, trace, impact. Each returns a serializable result with a compact text rendering that cites file:line.
score
Agent-readiness score: how easy is this repository for an AI agent to work in? Eight checks, 100 points, each with concrete fixes.
semantic
Semantic search: one embedding per chunk from a small static code model (potion-code-16M-v2, through mcp_kit::embed). The model is used when it is installed and REPOMAP_EMBED is not 0; otherwise search is keyword-only.
tokenize
Code-aware tokenizer: identifiers are kept whole and also split on camelCase, PascalCase, snake_case and digits, all lowercased.
tune
Search ranking knobs. REPOMAP_TUNE="name=value,..." overrides them for experiments; the defaults are the shipped values.
workspace_graph
Multi-repo workspace graph.