CodeGraph

A code knowledge graph that gives coding assistants searchable context and dependency-aware analysis.

Stars
★ 912
Last updated
1mo ago
Primary language
Rust

At a glance

How it runs
CLIMCP serverSelf-hosted service
Works with
Universal · cross-platformClaude Code · OpenAI API · Claude API
Cost
Free software; you pay for model usage
Setup effort
High · needs real infrastructure
You'll need
SurrealDBembedding providerLLM providerShell / CLINetwork accessLocal filesystemMCP Server
Typical use
A Claude Code user refactoring a Rust service who needs dependency and call-chain evidence before changing a component.
Not a fit if
  • Teams unwilling to run and maintain their own SurrealDB instance
  • Users wanting zero-config setup without manually applying a schema
  • Teams on the fast tier expecting full architecture and dataflow analysis

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.

  1. A Claude Code user refactoring a Rust service who needs dependency and call-chain evidence before changing a component.
  2. An engineering team maintaining a mixed-language repository that wants Rust, TypeScript, Python, and Go code indexed in one searchable graph.
  3. A developer onboarding to a large repository who needs agentic_architecture to inspect package structure, module relationships, and API surface.
  4. A maintainer planning to split tightly coupled modules who needs agentic_quality to identify complexity hotspots, coupling metrics, and refactoring priorities.
  5. A local development workflow that needs an index kept current through codegraph start stdio --watch or daemon mode.

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.sh

Start a local database:

surreal start --bind 0.0.0.0:3004 --user root --pass root file://$HOME/.codegraph/surreal.db

Apply the schema:

cd schema && ./apply-schema.sh

Then 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,python

The default fast tier creates only AST data and core edges. For LSP-backed and enriched indexing, run:

codegraph index --index-tier balanced

Rust 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 --watch

For 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.

What are this agent's strengths and limitations?

Pros
  • 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.
Limitations
  • 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 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.

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
CodeGraph This agent 44 · Major gaps CLIFree + model costs ★ 912 1mo ago Rust Claude Code · OpenAI API · Claude API
Graphicle 92 · Excellent CLIFree + model costs ★ 509 1d ago Rust Codex · Claude Code
Graft Code Context Layer 73 · Some gaps CLIFree + model costs ★ 11k 2d ago TypeScript Codex · Claude Code · OpenAI API · Claude API
CodeSeek 48 · Major gaps CLIFree + model costs ★ 759 3mo ago Rust Codex · Claude Code

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
44/ 100 5-point scale 2.2 / 5
Trust 7/29
Reliability 6/14
Adaptability 12/18
Convention 9/18
Effectiveness 7/13
Verifiability 3/8
Why each dimension lost points
Trust7 / 29 · 1.2/5

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.

Reliability6 / 14 · 2.1/5

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.

Adaptability12 / 18 · 3.3/5

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.

Convention9 / 18 · 2.5/5

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.

Effectiveness7 / 13 · 2.7/5

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.

Verifiability3 / 8 · 1.9/5

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.

Risks and how to mitigate them
  • Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
  • 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.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision ce5bf27a2978 New commits since this review; the score may not cover them
See the full review method →

FAQ

Which languages are documented?
The documentation lists Rust, Python, TypeScript, JavaScript, Go, Java, C++, C, Swift, Kotlin, C#, Ruby, PHP, and Dart.
Does it require cloud models?
No. Both embedding and reasoning options include local providers such as Ollama and LM Studio, alongside listed cloud providers including OpenAI, Anthropic, xAI, and Jina AI.
Will indexing expose secret files?
The documentation says indexing respects .gitignore and filters common secret patterns including .env, credentials.json, *.pem, and API keys.
What if LSP resolution stalls or fails?
CODEGRAPH_LSP_REQUEST_TIMEOUT_SECS adjusts per-request timeout. If rust-analyzer is only a rustup shim without an installed binary, install a runnable version or switch toolchains.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents