Technical Briefing: codegraph-rust

The Problem

AI coding assistants operate on a file-by-file basis, requiring manual context assembly and burning tokens on architecture discovery. This repo addresses that by building a semantically searchable knowledge graph from your codebase, where search results carry intact relationships—callers, dependencies, and architectural placement.

What This Does

CodeGraph indexes code through a tiered system governed by config/.codegraph.toml.example. Three tiers exist: fast (AST nodes + core edges only), balanced (LSP symbols + docs/enrichment + module linking), and full (all analyzers + LSP definitions). Indexing pipelines reside in crates/codegraph-ai/src/—pipeline.rs orchestrates the flow, while ml/pipeline.rs handles the machine learning components. The graph layer in crates/codegraph-graph/ persists data to surrealDB, with migration 001initialschema.sql and storage implementation surrealdbstorage.rs. MCP integration spans multiple crates: codegraph-mcp-core defines the protocol, codegraph-mcp-server provides the HTTP server (bin/codegraph.rs), and codegraph-mcp-autoagents adds agentic workflows. A current blocker: no LICENSE file exists at root, making usage and redistribution rights unclear.

How To Use It

Build and index via the Makefile targets defined in Makefile. Configuration is set through config/example.toml with the index tier selected via CODEGRAPHINDEXTIER environment variable or [indexing] tier = "balanced" in config. For LSP-enabled tiers (balanced/full), rust-analyzer must be available for Rust projects; the system will fail fast if missing. Indexing timeout is configurable through CODEGRAPHLSPREQUESTTIMEOUT_SECS (default 600s). Entry point for the server is crates/codegraph-mcp-server/bin/codegraph.rs.

Real-World Use

A team maintaining a large Rust codebase can run codegraph index --index-tier balanced to produce a graph usable by AI agents. Queries return functions with their callers, dependencies, and architectural context pre-attached—reducing the token cost of context assembly. The MCP server exposes an API for agents to request specific subgraphs (call chains, dependency trees) without re-indexing.

Code Health & Issues

SDLC - No LICENSE file at root; usage/redistribution rights unclear (root Cargo.toml present but no license declaration) CI/CD - 21 GitHub Actions workflows configured; includes CI, benchmark, and security pipelines Tests - 8 test files across crates; core and graph modules have integration tests Dependencies - Cargo.lock present; multi-workspace structure with 16+ crates

The Bottom Line

This is a functional code-graph RAG system with tiered indexing and MCP agent integration. The absence of a license file is a significant gap for any production use. Teams comfortable with Rust tooling and willing to manage LSP dependencies will find the most value here; solo practitioners or teams without existing LSP infrastructure may find the setup overhead disproportionate to immediate benefit.