GitNexus

Index any codebase into an interactive knowledge graph and give your AI agents deep architectural context via MCP — with zero servers required.

43.6Kstars
4.9Kforks
PolyForm-Noncommercial-1.0.0
TypeScript

GitNexus is a code intelligence engine that builds a comprehensive knowledge graph of any repository — mapping every dependency, call chain, symbol cluster, and execution flow — then exposes it through MCP tools so AI agents like Claude Code, Cursor, and Codex never miss architectural context again. Unlike simple code search or description-based wikis, GitNexus tracks actual relationships between symbols, making it possible to ask ‘what breaks if I change this function?’ and get a precise blast-radius answer.

The system operates in two complementary modes: a CLI and MCP server that indexes repos locally for persistent, private, full-scale analysis; and a no-install web UI at gitnexus.vercel.app where any repo can be dropped in (GitHub, GitLab, Azure DevOps, or a ZIP) and explored interactively in the browser. Both share the same LadybugDB graph backend — the web UI auto-detects a running local server and can browse CLI-indexed repos without re-uploading.

At the core, a 14-phase deterministic ingestion pipeline (scan → structure → parse → crossFile → scopeResolution → MRO → communities → processes) builds the knowledge graph using Tree-sitter native bindings to parse 15+ languages with full AST fidelity. The pipeline supports incremental re-indexing via content hashing, so only changed files are reprocessed on subsequent runs. Hybrid BM25 + semantic vector search (via local ONNX embeddings with HuggingFace Transformers) powers the query layer.

The MCP server exposes 16+ tools including query, context, impact, detect_changes, trace, rename, route_map, shape_check, and pdg_query — covering the full range from discovery to blast-radius analysis to taint tracking. Editor integrations include Claude Code (PreToolUse/PostToolUse hooks that automatically enrich agent searches with graph context), Cursor, Antigravity, Codex, Windsurf, and OpenCode.

What You Get

  • A 14-phase deterministic ingestion pipeline that parses 15+ languages via Tree-sitter and stores a full symbol-relationship graph in LadybugDB
  • 16+ MCP tools exposing query, context, blast-radius impact, call-chain trace, rename assistance, taint analysis, and PDG-based data-flow queries
  • Automatic editor hook installation for Claude Code (PreToolUse/PostToolUse), Cursor, Antigravity, Codex, Windsurf, and OpenCode via a single gitnexus setup command
  • Hybrid BM25 + semantic vector search using locally-run ONNX models, with zero data leaving your machine
  • Incremental re-indexing via content hashing so only changed files are re-parsed on subsequent runs
  • A no-install web UI with interactive Sigma.js graph visualization, file tree panel, and LangChain-powered Graph RAG chat across OpenAI, Anthropic, Google Gemini, and Ollama providers
  • Multi-repo group support with cross-boundary impact analysis and a Contract Registry for service boundary tracking
  • Auto-generated Code Wiki that stays synchronized with the indexed knowledge graph

Common Use Cases

  • Giving AI coding agents (Claude Code, Cursor, Codex) full architectural context before they edit files, eliminating blind edits that break call chains
  • Blast-radius analysis before refactoring — run gitnexus impact <symbol> to see every upstream and downstream caller affected by a change
  • Onboarding to an unfamiliar codebase by dropping a GitHub URL into the web UI and exploring the visual knowledge graph with AI-assisted Q&A
  • PR review augmentation — running detect_changes against a diff to automatically identify which symbols and processes are affected
  • Multi-repo architecture analysis using group mode to track cross-service dependencies and API contract boundaries in microservice systems
  • Security taint tracking using PDG-based explain and pdg_query tools to trace data flows from source to sink through a codebase

Under The Hood

Architecture GitNexus is structured as a monorepo with a clean separation between the CLI/MCP engine (gitnexus/) and the browser-based visualization client (gitnexus-web/), sharing types via gitnexus-shared/. The CLI package orchestrates a 14-phase DAG pipeline defined in src/core/ingestion/pipeline.ts — each phase in its own file under pipeline-phases/ with explicit typed dependencies, running in topological order via runner.ts. The pipeline output is a KnowledgeGraph in-memory graph written to LadybugDB (a custom graph database with WAL persistence) under .gitnexus/. Three query interfaces tap the same backend: stdio MCP (mcp/server.ts), HTTP bridge (server/serve.tsapi.ts) for the web UI, and direct CLI commands in cli/. Cross-file scope resolution, MRO computation, and community detection run as post-parse phases, with an augmentation engine in core/augmentation/engine.ts providing sub-500ms context enrichment for real-time editor hooks.

Tech Stack The CLI is TypeScript (Node 22+, ESM) built with esbuild via a custom scripts/build.js. Tree-sitter native bindings parse 15+ languages (TypeScript, JavaScript, Python, Go, Java, C#, Rust, C/C++, PHP, Ruby, Dart, Kotlin, Swift, COBOL, JCL) with vendored platform prebuilds for languages lacking upstream binaries. LadybugDB (@ladybugdb/core) provides the graph database with Cypher-like query support and a vector extension for embedding similarity search. Local ONNX inference runs via onnxruntime-node with HuggingFace Transformers (@huggingface/transformers) for embedding generation. The web UI is Vite + React 19 + Tailwind CSS v4, with Sigma.js for graph rendering, LangChain for multi-provider LLM orchestration (OpenAI, Anthropic, Google Gemini, Ollama), and Playwright for end-to-end tests.

Code Quality The test suite is extensive — hundreds of unit tests in gitnexus/test/unit/ and integration tests in test/integration/, covering ingestion phases, MCP tool handlers, LadybugDB operations, worker pool behavior, CLI commands, and cross-platform edge cases. Tests are organized by subsystem with dedicated fixture repositories under test/fixtures/. Vitest runs the unit suite and Playwright covers the web UI. The codebase enforces TypeScript strict mode, ESLint with @typescript-eslint/recommended, Prettier formatting, and Husky pre-commit hooks with lint-staged. Error handling is explicit throughout — structured logging via Pino, typed error classes, and graceful degradation paths (e.g. augmentation always returns an empty string rather than propagating failures to editor hooks).

What Makes It Unique GitNexus occupies a distinct position between passive code search (grep/embeddings) and active code understanding. Rather than describing what code does, it models what code calls, imports, and depends on — a structural graph that enables blast-radius queries, call-chain tracing, and cross-file type propagation that embedding-only tools cannot provide. The augmentation engine is architecturally novel: it intercepts AI agent tool calls at the editor hook layer (Claude Code PreToolUse, Cursor postToolUse) and injects graph-derived caller/callee context before the agent reads a file — meaning the agent already knows the architectural context of any symbol it encounters. The dual-mode deployment (zero-install browser WASM vs. persistent native CLI with bridge mode connecting them) and the 14-phase deterministic pipeline with explicit phase dependencies are design choices that prioritize reproducibility and incremental correctness over simplicity.

Self-Hosting

Licensing Model PolyForm Noncommercial 1.0.0 — the OSS version is free for personal, educational, and non-commercial use. Commercial use of the OSS version requires a separate commercial license from the maintainers.

Self-Hosting Restrictions

  • Commercial use in a business context requires a paid license from AkonLabs (founders@akonlabs.com)
  • The OSS version is explicitly non-commercial; internal corporate use is a paid-tier concern
  • All features of the OSS version (graph indexing, MCP tools, web UI, embeddings) are fully available in non-commercial self-hosted deployments with no feature gates

Enterprise Features

  • PR Review with automated blast-radius analysis on pull requests
  • Auto-updating Code Wiki that stays synchronized with the codebase
  • Auto-reindexing so the knowledge graph stays fresh without manual gitnexus analyze runs
  • Multi-repo group support with unified cross-repository graph (OSS supports groups; enterprise adds managed auto-sync)
  • OCaml language support
  • Priority feature and language support requests
  • Upcoming: auto regression forensics and end-to-end test generation

Cloud vs Self-Hosted The SaaS offering (akonlabs.com) adds managed infrastructure, automatic reindexing on code push, and PR-integrated workflows. The self-hosted enterprise tier provides the same feature set on your own infrastructure.

License Key Required No license key required for non-commercial self-hosted use. Commercial use requires a license agreement with AkonLabs.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search