A code knowledge graph your AI can actually navigate.
CodeGraph indexes your codebase into a queryable graph — functions, classes, relationships, knowledge — and exposes it through MCP tools your AI agent can use to search, understand, and remember.
AI agents are flying blind in your codebase
Embeddings miss structure
Vector search returns lexically similar tokens, not the call graph or import chain that explains how code actually fits together.
Grep misses semantics
String match doesn't know what a symbol means or which call site is the relevant one. Your agent reads ten files to answer one question.
Context windows lose the thread
Large codebases blow past the limit. Sessions lose architectural understanding mid-task and re-read the same files every time.
Parse. Graph. Query.
Three pipelines, one graph. Your AI agent queries it through MCP tools.
Parse
Tree-sitter extracts every function, class, type, and import. 5 tier-1 plugins (TypeScript, Python, Go, Rust, Markdown) plus generic coverage for ~30 more languages.
Graph
Nodes and edges land in FalkorDB (Docker) or FalkorDBLite (embedded, no Docker). Vector indexes for semantic search; structural edges for CALLS, IMPORTS, EXTENDS, IMPLEMENTS.
- (:Function) -[:CALLS]-> (:Function)
- (:File) -[:IMPORTS]-> (:File)
- (:Class) -[:EXTENDS]-> (:Class)
- (:Function) -[:ABOUT]-> (:Entity)
- (:Person) -[:SAID]-> (:Fact)
Query
Four MCP persona tools — search, knowledge, codebase, query — give your AI agent vector search, knowledge recall, project management, and raw Cypher. Cross-encoder reranking and graph enrichment included.
Everything an agent needs to navigate your codebase.
Six capabilities, one graph. Each one exposed through MCP, the AI SDK, or both.
Search pipeline
Vector embeddings → cross-encoder reranking → graph enrichment. Returns symbols with their callers, callees, complexity, and linked knowledge.
search({
action: "find",
query: "authentication"
})Bitemporal knowledge
Every fact carries valid_at and invalid_at. Query the graph as it existed on a past date, see full timelines, watch supersession happen.
knowledge({
action: "recall",
text: "AuthModule",
at: "2026-03-01T00:00:00Z"
})Document ingestion
Drop a PDF, DOCX, HTML, CSV, or URL into knowledge.add(). It chunks, embeds, extracts entities, and links them into the same graph as the code.
knowledge({
action: "add",
input: "/path/to/spec.pdf"
})Speaker entities
Ingest a multi-turn conversation; CodeGraph creates Person nodes with SAID edges to facts. Ask 'what has Alice said about retries?' and get an answer.
knowledge({
action: "ingest_conversation",
text: "Alice: let's use Redis...",
source: "standup"
})MCP App UI panel
The graph_explorer MCP tool ships as an App UI panel that renders the Graph Explorer canvas inside Claude Desktop or Cursor — interactive, in-conversation.
// Surfaced automatically when CodeGraph
// is configured as an MCP serverDrop-in middleware
Wrap any Vercel AI SDK model with withCodeGraph(); register a Mastra processor with createCodeGraphProcessor(). Your existing agent gets graph-aware context.
import { withCodeGraph }
from "@codegraph/tools/vercel"
const model = withCodeGraph(
openai("gpt-4o")
)Drops into your existing setup.
MCP for hosts; middleware for AI SDKs; hook scripts for Claude Code.
{
"mcpServers": {
"codegraph": {
"command": "node",
"args": ["~/codebase-graph/packages/mcp-server/dist/index.js"],
"env": { "CODEGRAPH_DRIVER": "embedded" }
}
}
}MCP server is not yet published to npm — paths above point at a local build of the repo. When @codegraph/mcp ships, these snippets will use npx @codegraph/mcp instead.
Architecture
FalkorDB-backed graph, tree-sitter parsers, pluggable embeddings and reranker, MCP at the edge.
Stack
- •FalkorDB (Docker) or FalkorDBLite (embedded — no Docker, requires redis-server).
- •Embeddings: Voyage, OpenRouter, or local @huggingface/transformers (nomic-embed-text-v1.5).
- •Reranker: Jina or Voyage. Cross-encoder, MRR-aware.
- •Optional cloud APIs are pluggable; the embedded path is fully local.
Internal benchmark
2,310-node test set, v6 Chunk 1 baseline (2026-04-26). CGBench v1 methodology and results.