Back to work

Open Source AI · Developer Tooling

NervaPack.

A privacy-first, offline knowledge graph for developers. It turns repositories into AST-aware graphs so humans and AI agents can retrieve precise code context without flooding prompts with unrelated files.

Demo video

90%
Token reduction target
Local
Default privacy mode
10
CLI command family
MCP
Agent integration

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 --communities

Architecture 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.

01

Onboard into a new codebase without sending the repository to a hosted service.

02

Ask architecture questions and retrieve only the structurally relevant files.

03

Trace refactor impact through imports, calls, and dependency communities.

04

Link documentation back to the exact code entities it explains.

05

Give AI coding agents smaller, more accurate context than naive full-file RAG.

NervaPack documentation

Full installation, quick start, command reference, MCP integration, API reference, and contribution guide live in the Read the Docs site.

Ask me