Why it exists
Standard vector RAG loses the shape of software.
Most codebase search systems split files into text chunks, embed them, and hope similarity finds the right context. NervaPack takes a more developer-native route: parse the code, build a graph of real entities and relationships, then retrieve the neighborhood that explains the question.
Knowledge graph retrieval
NervaPack indexes real code entities and relationships, then retrieves context through graph traversal instead of nearest-neighbor chunks alone.
AST-based precision
Tree-sitter parsing extracts classes, functions, imports, and structural edges so the graph is grounded in code shape, not arbitrary text windows.
Offline first
Local-first operation with ChromaDB and Ollama keeps private repositories on the developer machine, while Claude and OpenAI remain optional providers.
Incremental sync
GitPython-powered sync detects changed files and updates only the affected graph slices instead of re-indexing the entire repository.
Graph visualization
Interactive HTML visualization exposes nodes, edges, communities, dependency paths, and hotspots so retrieval behavior is inspectable.
MCP-ready context
The project includes an MCP integration path so AI coding agents can ask for codebase-aware context through a tool interface.
Quick flow
Install, index, query, visualize.
The CLI loop is intentionally short so a developer can build a graph from an existing repository and immediately compare retrieved context against naive file search.
Terminal
brew install nervapack
# or: pipx install nervapack
cd your-project/
nervapack ingest .
nervapack query "How does authentication work?"
nervapack visualize --enhanced --communitiesArchitecture decisions
What I chose and why.
Retrieval model
K-hop graph traversal over deterministic code entities
Developer questions usually depend on structure: which function calls what, which file imports which module, and which docs explain which code. Graph traversal preserves those relationships.
Privacy posture
Local ChromaDB and Ollama by default
The target user is indexing source code. Keeping the default path offline removes a major adoption blocker for private repositories and enterprise codebases.
Parsing layer
Tree-sitter AST parsing with language extras
A parser gives stable code entities across Python, JavaScript, JSX, TypeScript, and TSX, with optional extras for Go, Rust, Java, C, C++, Ruby, and C#.
Operational loop
CLI-first commands for ingest, query, sync, and visualize
The first workflow needs to be fast for developers: install, index a repository, query it, inspect the graph, and refresh it after code changes.
Use cases
Built for codebases that are too large to paste into a prompt.
NervaPack is not a hosted SaaS wrapper. It is a local developer tool for reading, indexing, syncing, querying, and visualizing software systems with enough structure for an AI agent to use the context responsibly.
Onboard into a new codebase without sending the repository to a hosted service.
Ask architecture questions and retrieve only the structurally relevant files.
Trace refactor impact through imports, calls, and dependency communities.
Link documentation back to the exact code entities it explains.
Give AI coding agents smaller, more accurate context than naive full-file RAG.