project
GitNexus - an open-source knowledge graph engine for building complete dependency graphs.
GitNexus is an open-source code knowledge graph engine that uses Tree-sitter parsing to build complete dependency graphs from code repositories and exposes these graphs to AI tools such as Cursor, Claude Code, and Codex using the MCP protocol.
What is GitNexus?
GitNexus is an open-source code knowledge graph engine that uses Tree-sitter parsing to build complete dependency graphs from code repositories and exposes structured context to AI tools such as Cursor, Claude Code, and Codex using the MCP protocol. These tools can pre-compute call chains, clusters, risk scores, and other relationships, enabling AI to obtain a complete view of the code repository in a single call, eliminating the need for multiple rounds of queries.
Main functions of GitNexus
- Knowledge Graph ConstructionIt parses the code repository into a graph consisting of nodes (functions, classes, methods, interfaces) and edges (calls, inheritance, imports, implementations), supporting 14 mainstream languages.
- Impact AnalysisInput any symbol, return the scope of multi-level dependency impact, and mark the confidence level and risk level, so that you can predict which callers will crash before modifying the code.
- 360° Symbol ContextWhen querying a single symbol, it also returns its upstream caller, downstream callee, execution flow, and cross-file references, eliminating the context blind spot of AI.
- Change detectionBy comparing Git diffs with knowledge graphs, changes are automatically mapped to affected symbols and processes to assess the risk level.
- Rename multiple filesPerform cross-file coordinated renaming based on graph dependencies, distinguishing between high-confidence graph editing and low-confidence text search editing.
- Hybrid SearchThe BM25 + semantic vector + RRF fusion search returns results grouped by execution flow, prioritizing the display of critical paths across communities.
- Cypher graph search: Directly execute Cypher graph query language on the codebase to customize the retrieval of high-confidence call relationships or specific community structures.
- Wiki automatically generatedBased on the knowledge graph structure, it calls LLM to automatically generate module documentation and architecture overview, and supports multi-language output.
The technical principles of GitNexus
- Multi-stage indexing pipelineGitNexus employs a six-stage pipeline to transform codebases into knowledge graphs. The first stage traverses the file tree to establish a directory structure mapping; the second stage uses a tree-sitter to parse the AST, extracting symbolic nodes such as functions, classes, methods, and interfaces; the third stage performs cross-file parsing to resolve import, call, and inheritance relationships, and infer constructor functions and...
self/thisThe fourth stage uses the Leiden community detection algorithm to cluster relevant symbols into functional modules; the fifth stage traces the execution process from the entry point to generate a process chain with step indexes; the sixth stage builds a hybrid search index that integrates BM25 inverted index, semantic vectors and RRF reordering. - Graph storage and concurrencyThe index results are stored in LadybugDB, the CLI uses native bindings, and the Web UI uses the WASM version. Data is persisted entirely locally. The parsing phase uses a worker thread pool for concurrent processing, balancing throughput and stability through block scheduling and timeout rollback mechanisms. Large-scale repositories support embedded vector generation, with a default safety limit of 50,000 nodes to prevent memory overflow.
- Pre-computation relational intelligenceUnlike traditional Graph RAGs that feed raw graph edges to an LLM for exploration in real time, GitNexus completes clustering, call chain tracing, and risk confidence scoring during the indexing phase. During queries, the MCP tool returns structured results in one go, allowing AI to obtain complete 360° symbol context, impact explosion radius, or change detection reports without multiple rounds of interaction.
How to use GitNexus
- CLI + MCP method:
-
Global installation:
npm install -g gitnexus -
Enter the root directory of the repository and execute:
npx gitnexus analyze -
One-click editor configuration:
npx gitnexus setup -
Directly call MCP tools from tools such as Claude Code/Cursor
-
- Web UI approach:
-
access
gitnexus.vercel.appDrag and drop GitHub repositories or ZIP files directly into your browser. -
Or run locally
npx gitnexus@latest serveThe backend starts automatically and the frontend connects.
-
- Docker approach:implement
docker compose up -dStart both the backend (port 4747) and the frontend (port 4173) simultaneously.
GitNexus's core advantages
- Pre-computation relational intelligenceTraditional Graph RAGs simply dump the original graph edges onto an LLM for exploration, while GitNexus completes clustering, call chain tracing, and risk scoring during the indexing phase, allowing AI to obtain a complete answer with a single call.
- Local Zero ServerCLI runs entirely locally, without internet connection or code upload; Web UI processes data only within the browser, with no data leaving the local machine.
- Small model friendlyThe heavy lifting is handled by the tool layer, so the model does not need to have super strong reasoning ability. Small and medium-sized models can also achieve the same architectural clarity as large models.
- Global registration for multiple repositoriesOne MCP server can serve multiple indexed repositories simultaneously, through...
~/.gitnexus/registry.jsonGlobal management, no need to configure on a project-by-project basis. - Deepin Editor IntegrationClaude Code receives the most complete support (MCP + Skills + Pre/Post ToolUse hooks), and automatically detects index expiration and prompts for reindexing after submission.
GitNexus project address
- Project official websitehttps://gitnexus.vercel.app/
- GitHub repository: https://github.com/abhigyanpatwari/GitNexus
GitNexus Competitive Comparison
| Dimension | GitNexus | DeepWiki |
|---|---|---|
| Core Output | Structured knowledge graph + queryable tools | Natural Language Document Description |
| Relationship expression | Explicit graph edges (calling, inheritance, importing) | Implicit in text description |
| AI usage | Tool call, returns the complete context in one go | Text reading requires inferring the structure independently. |
| Model threshold | Small models are usable, but tools handle the heavy lifting. | Relying on large models to understand long texts |
| Typical actions | "Query the dependency impact of UserService" | Read the UserService feature description. |
| Editor integration | Native MCP, supports Cursor/Claude/Codex | Typically, independent platforms or documentation sites |
| privacy | Completely local, zero upload | Typically requires cloud processing. |
Application scenarios of GitNexus
- Pre-reconstruction assessmentBefore modifying the return value of the core service, first use...
impactThe tool allows you to view all dependencies and layered risks, preventing a single issue from having far-reaching consequences. - Newcomer familiar with code: Quickly understand the module division, execution flow and key entry points of unfamiliar code bases through knowledge graphs and automatically generated wikis.
- Bug Root Cause Tracking:use
contextandqueryBy tracing back along the call chain, the defect path that propagates across files can be located. - PR Impact ReviewRun before submission
detect_changesThis maps diffs to affected symbols and processes, automatically generating risk reports. - Cross-repository microservice governance:pass
groupThe command creates a multi-repository group, extracts inter-service contracts, and matches cross-repository call relationships.