
CGIS Code Graph
io.github.zaebeePublished by GitHub account zaebeev0.39.2Updated Nov 7, 2026
Code graph for AI agents: impact, call tracing in Python, TypeScript, Go; opt-in JSON and YAML keys
The publisher's own server: BrainDog
Overview
Builds a SQLite code graph of a repository and lets an AI assistant query callers, callees, structure and metrics instead of grepping files.
- What you can do
- Ingest a repository into a graph, building or incrementally refreshing it
- Find symbols by partial name and get an overview of packages and sizes
- Analyze impact and trace transitive call flows for a symbol
- Inspect class and module structure, coupling, god classes and PageRank
- Assemble a compact graph context package for one symbol
- Audit authorization reachability, architectural drift and graph integrity
- When to use it
- Useful when an assistant needs to answer questions like what breaks if a function changes, or which code path reaches a handler, in Python, TypeScript or Go repositories. It saves context compared with reading whole files and suits multi-hop impact analysis across a whole repository.
- Requirements
- Runs locally over stdio via uvx from the PyPI package codegraph-brain, or pip install with Python 3.12+. A graph must first be built from the source directory into a SQLite file. No account, API key or telemetry is required for the graph tools.
Installation
In SourceWeft
- Open CGIS Code Graph in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
🧠 CGIS: Code Graph Intelligence System
A code graph your AI agent can query instead of guess
[Continuous Integration] [Graph Integrity] [PyPI]
Ask "what breaks if I change this?" and get the call chain, not a guess.
CGIS parses a repository with tree-sitter into a graph of fully qualified symbols and the calls, imports and containment between them, stores it in SQLite, and serves it to AI agents over MCP. An agent that would otherwise grep and read whole files asks the graph instead.
- Languages: Python · TypeScript / TSX · Go (structure and metrics only; its impact answers are a lead to confirm by reading — exp4, measured on one library, golang/crypto, mostly its ssh package; not measured on applications) · JSON and YAML (data key declarations only, when data keys are enabled with
--data-keys: no symbols, calls or impact) - Runs: locally — no account, no telemetry; the graph never leaves your disk (the one opt-in exception)
Real output — CGIS run on its own source.
🚀 Quickstart
In Claude Code (fastest)
That ships the MCP server, a skill that teaches the agent when to query the graph instead of reading files, and /cgis:ingest to build the graph on first use. The server is pulled from PyPI on demand via uvx, so there is nothing to clone or build.
Any other MCP client (Cursor, Claude Desktop, …)
From the terminal
Or install it for good: pip install codegraph-brain (Python 3.12+), then use cgis directly. The full command list is in CLI_USAGE.md.
📈 Proof at Real Scale
CGIS runs on a working twelve-repository estate — four languages, 8,146 commits, shipping daily. On its FastAPI backend it classifies 82.7% of 87,845 edges definitively and prints the remaining 17.3% rather than inventing targets for them — including the part that is CGIS's own gap.
That share rose from 11.4% in #459, which stopped counting calls to missing symbols as resolved. About 4 points of what is left is a known resolver gap, not something undiscoverable: ingesting app/ strips the app. prefix its imports carry, and the import path does not yet reconcile the two — the same backend ingested at its package root reports 13.2%. The number is what the tool admits it cannot place today, and it is allowed to move the unflattering way.
Read the case study → — every figure measured and reproducible, including what CGIS doesn't cover.
🤔 Why a graph, and how this differs
Text retrieval hands an agent chunks that look related. It cannot say which of three functions named save a call reaches, or what sits five callers up. CGIS resolves every call site to a fully qualified name when the source allows it — and when it does not, the edge stays marked unresolved and is counted, never filled with a plausible guess.
🤖 MCP Tools
The main tools:
All 16 tools, with parameters: MCP_REFERENCE.md.
🏗️ How It Works
- Extract — tree-sitter parsers turn each file into nodes and raw call edges.
- Resolve — the
ResolverEnginemaps raw calls to fully qualified names, or leaves them explicitly unresolved. - Store — SQLite holds the graph; queries are breadth-first traversals over it.
The details — and a pipeline graph CGIS regenerates from its own source on every change — are in HOW_IT_WORKS.md, and the full map of every document with its generated cross-references to the code is in docs/INDEX.md.
🛡️ Guardian: Graph-Aware Code Review
Guardian is CGIS's built-in LLM reviewer — it reviews pull requests using the graph as context, not just the diff text. It runs in CI and posts inline comments anchored to the exact line.
- Two-stage, recall-first: a finder surfaces every plausible defect (optimised for recall), then a separate skeptic pass filters false positives — closer to how human reviewers work, and far more reliable than a single precision-gated prompt.
- Local or cloud, no lock-in: point it at Ollama (
qwen2.5-coder,llama3.1,granite-code, …) for free local inference, or at Mistral / Gemini / Claude / OpenCode Go (DeepSeek) in the cloud. You can even mix them — a strong cloud finder with a free local cross-model skeptic. - Graph-aware context: the reviewer sees impact graphs, architectural drift, and project ontology — so it catches structural and convention defects a flat-diff reviewer can't.
- Deterministic anchoring: every inline comment is positioned by a verbatim quote from the diff, not the model's (often wrong) line guess.
- Dogfooded & measured: Guardian reviews CGIS's own pull requests, and a benchmark harness scores it against curated ground truth — so prompt changes are validated, not guessed.
In GitHub Actions, opencode-go needs no static key: the reusable workflow exchanges a short-lived GitHub OIDC token for inference access immediately before the review. Enable OIDC for GitHub Actions in the Opencode console, set the calling repository's OPENCODE_CLIENT_ID variable, and grant the review job id-token: write. OPENCODE_API_KEY is then minted at run time and never stored as a secret. Sign-in happens when GUARDIAN_PROVIDER is opencode-go, opencode, or unset (unset means the minted key makes opencode the auto-detected provider); an explicit other provider skips it.
No GPU on hand? Benchmark it on a notebook GPU → — free end to end, since the fixtures score without an LLM judge. Or point Guardian at a remote Ollama → — over an frp stcp tunnel, no public port, and a guard that refuses a review of a silently truncated prompt.
🔒 Privacy
CGIS collects nothing: no telemetry, no analytics, no account. Your code and the graph built from it stay on your machine. The one exception is opt-in: Guardian, if you run it with a cloud model, sends the reviewed diff to the provider you chose. See PRIVACY.md.
🛠️ Development
Requires Python 3.12+ and uv.
See CONTRIBUTING.md for the standards: strict MyPy, linting, ontology compliance.
💼 Architecture Audit
CGIS is free and you can run it yourself. If you would rather have the analysis than the tool, I run a fixed-price audit of your codebase's structure — authorisation coverage, blast radius, coupling, architectural drift — delivered in five working days, $2,400 fixed, with an explicit list of what the analysis cannot see. Read what's included →
Source: README.md at commit 5ed805b
Tools
0Version history
16- v0.39.2LatestOct 31, 2026
- v0.38.0Oct 23, 2026
- v0.36.0Oct 22, 2026
- v0.35.0Oct 21, 2026
- v0.34.0Oct 19, 2026
- v0.33.0Oct 18, 2026
- v0.32.0Oct 16, 2026
- v0.31.0Oct 16, 2026
- v0.30.0Oct 15, 2026
- v0.29.0Oct 14, 2026
- v0.28.0Oct 8, 2026
- v0.27.0Oct 2, 2026
- v0.25.4Sep 26, 2026
- v0.25.3Sep 18, 2026
- v0.25.2Sep 18, 2026
- v0.23.3Sep 17, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Brain integrations

BrainDog
dog.brainOfficial publisher
BrainDog is a hosted record of projects, decisions and money that connected AI agents read before starting work and write their results into.

Codebase Brain
Published by GitHub account Nomannazir
Indexes a local or public git codebase so an assistant can search it, trace git history, check change impact and find stale docs, all with path:line citations.

Personal Brain
Published by GitHub account zhang-liz
Gives an AI assistant memory of your professional network, stored as a graph in FalkorDB, so it can look up contacts, find people by topic, and save who you…

Second Brain
Published by GitHub account ara-5
Shared Graph-RAG memory for AI agents: markdown vault, wikilink recall, tasks, messaging.

Make0 Brain
Published by GitHub account make0-official
Local, offline memory server that gives Claude Code, Cursor, Codex and other MCP agents one shared, versioned store of durable facts.