CodeGraph
A code knowledge graph that gives coding assistants searchable context and dependency-aware analysis.
Per-dimension scores and reasoning
Evidence shows: README mentions indexing automatically respects .gitignore and filters common secret patterns (.env, credentials.json, *.pem, etc.), indicating some consideration for sensitive data handling; MCP server starts via stdio, limiting permissions; but no user confirmation mechanism (e.g., confirmation before tool calls) or rollback mechanism found. Dependency security: Cargo.toml lists many dependencies but no vulnerability scanning or audit evidence. External effects: indexing modifies local database, but no explicit user consent mentioned. Source attribution: repository author info unclear, publisher unverified. Deductions: lack of user confirmation, rollback, dependency security audit evidence, limited data flow transparency.
Evidence shows: README and Cargo.toml descriptions are consistent, functional modules clearly divided, good self-consistency; but dependency availability: some dependencies are new or unpinned (e.g., autoagents = "*"), affecting reproducibility; failure messages: README mentions LSP failure error hints, but no comprehensive error handling documentation. Deductions: dependency versions not fully pinned, failure message coverage incomplete.
Evidence shows: README details supported languages, indexing tiers, configuration options, and adjustments for different context windows, indicating consideration for various scenarios; capability boundaries: clearly lists supported indexing tiers and tool functions; trigger precision: provides focus parameters and auto-selection logic; environment fit: supports multiple embedding and LLM providers, local and cloud environments. Deductions: no detailed troubleshooting guide, some environment fit details (e.g., specific OS) not specified.
Evidence shows: README provides installation guide, usage guide, architecture diagram, clear information architecture; install notes detailed with dependencies and steps; naming: tool names and config keys consistent; examples and FAQ: usage examples provided, but no FAQ; known limitations: README mentions some limitations (e.g., LSP dependencies), but not comprehensive; license: MIT in README, but MIT OR Apache-2.0 in Cargo.toml, inconsistency; versioning/changelog: no CHANGELOG; maintenance responsibility: no clear maintainer. Deductions: license inconsistency, missing CHANGELOG and clear maintainer info.
Evidence shows: README details tool output format (e.g., JSON structure), good output usability; marginal value: emphasizes advantages over traditional search, such as reduced token consumption; cost-benefit: provides indexing tiers and context window configuration to control costs, but no actual performance data. Deductions: lack of actual performance benchmarks and cost comparison data.
Evidence shows: some claims in README (e.g., performance data) lack test or benchmark evidence; cross-source corroboration: only README and Cargo.toml, lacking other sources; fact-inference separation: README mixes facts and inferences (e.g., "blazing fast"). Deductions: lack of verifiable evidence, unclear separation of claims and evidence.
- License inconsistency: README states MIT, but Cargo.toml states MIT OR Apache-2.0, needs clarification.
- Dependency versions not fully pinned (e.g., autoagents = "*"), potentially affecting reproducibility and supply chain security.
- Lack of user confirmation and rollback mechanisms; tool may automatically perform actions affecting external systems.
- Publisher identity unverified, source attribution unclear.
What does this agent do, and when should you use it?
CodeGraph is a Rust implementation of a code knowledge graph that exposes context, impact, architecture, and quality analysis through MCP. It ingests build context, AST and FastML parsing, optional LSP resolution, and enrichment into SurrealDB nodes, edges, and vector chunks. Its MCP server exposes four consolidated tools—agentic_context, agentic_impact, agentic_architecture, and agentic_quality—using Rig, ReAct, or LATS reasoning strategies. The documented indexer covers Rust, Python, TypeScript, JavaScript, Go, Java, C/C++, and several additional languages, with local and cloud provider options for embeddings and reasoning. Its deployment boundary is a local codebase, SurrealDB, and an MCP client; it does not replace an IDE, type checker, or test runner.
After codegraph index runs on a project, CodeGraph creates AST nodes and core relationships according to the chosen indexing tier. The balanced and full tiers additionally invoke language-specific LSP tooling and can add module linking, documentation/contract links, dataflow, and architecture analysis. It persists code nodes, relationships such as calls and imports, plus chunks and embeddings with an HNSW vector index in SurrealDB. An MCP client can call agentic_context to search or assemble context, agentic_impact for dependency and call-chain analysis, agentic_architecture for structure or API surface analysis, and agentic_quality for complexity, coupling, and hotspot assessment. Results can include file paths, line numbers, bounded snippets, highlights, analysis, and next steps; --watch and daemon start support re-indexing after changes.
- A Claude Code user refactoring a Rust service who needs dependency and call-chain evidence before changing a component.
- An engineering team maintaining a mixed-language repository that wants Rust, TypeScript, Python, and Go code indexed in one searchable graph.
- A developer onboarding to a large repository who needs agentic_architecture to inspect package structure, module relationships, and API surface.
- A maintainer planning to split tightly coupled modules who needs agentic_quality to identify complexity hotspots, coupling metrics, and refactoring priorities.
- A local development workflow that needs an index kept current through codegraph start stdio --watch or daemon mode.
What are this agent's strengths and limitations?
- Combines AST data, graph relationships, and vector search instead of returning semantic matches alone.
- Provides four MCP-level tools for context, impact, architecture, and quality work, with locations and bounded snippets in documented outputs.
- Tiered indexing makes it possible to choose between fast AST-only indexing and fuller LSP, dataflow, documentation, and architecture enrichment.
- Documents local Ollama, LM Studio, and ONNX Runtime options alongside OpenAI, Jina AI, Anthropic, and xAI provider paths.
- Requires operating SurrealDB and applying a schema manually, adding deployment and maintenance work.
- Balanced and full indexing depend on language servers and fail fast when required tooling is absent.
- The default fast tier excludes LSP, module linking, dataflow, documentation/contracts, and architecture analysis.
- CODEGRAPH_CONTEXT_WINDOW must be set to match the chosen model's context window, which affects truncation and context-overflow protection.
How do you install or deploy this agent?
Clone and build:
git clone https://github.com/Jakedismo/codegraph-rust
cd codegraph-rust
./install-codegraph-full-features.shStart a local database:
surreal start --bind 0.0.0.0:3004 --user root --pass root file://$HOME/.codegraph/surreal.dbApply the schema:
cd schema && ./apply-schema.shThen configure embedding, llm, and database.surrealdb in ~/.codegraph/config.toml. The supplied example uses Ollama with qwen3-embedding:0.6b, Anthropic with claude-sonnet-4, and ws://localhost:3004. Cloud-provider API-key setup is not specified in the supplied documentation.
How do you use this agent?
For an initial project index, run:
codegraph index /path/to/project -r -l rust,typescript,pythonThe default fast tier creates only AST data and core edges. For LSP-backed and enriched indexing, run:
codegraph index --index-tier balancedRust balanced/full indexing requires a runnable rust-analyzer; other languages have their own documented LSP dependencies. Start the MCP server with change watching:
codegraph start stdio --watchFor Claude Code, configure the binary as an MCP server with args ["start", "stdio", "--watch"]. Call agentic_context, agentic_impact, agentic_architecture, or agentic_quality, supplying a query and an optional focus where appropriate.
How does this agent compare with similar options?
Against embedding-only semantic-search tools, CodeGraph uses the matched code together with calls, dependencies, modules, and other graph relationships for analysis. That richer approach comes with database and indexing setup, plus LSP tooling for the more capable tiers.