Quick Start¶
Get NervaPack running in under 5 minutes.
Step 1: Install¶
For MCP integration with Claude Code or Cursor:
Verify:
Step 2: (Optional) Set Up an LLM¶
NervaPack builds a structural graph with zero LLM setup. An LLM is only needed to add semantic doc-to-code edges (EXPLAINS). Skip this step if you just want to try it.
Step 3: Ingest Your Project¶
What this does (in order):
- Walks the directory tree — skips
dist/,build/,node_modules/,venv/,site/,.tox/, and dozens of other non-code directories automatically. - Parses source files with tree-sitter → classes, functions, imports.
- Chunks all
.mdfiles by header. - Embeds every entity into ChromaDB (local ONNX model, no cloud).
- If an LLM is available, binds doc chunks to code nodes (
EXPLAINSedges). - Saves the graph to
.nervapack/graph.graphml.
Expected time:
| Project size | Time |
|---|---|
| < 50 files | 15–30 seconds |
| 50–500 files | 1–3 minutes |
| 500–2000 files | 3–10 minutes |
Re-ingest is safe
NervaPack uses upsert throughout — running ingest twice does not duplicate data. If you see large .nervapack/chroma_db/ sizes from an older version, run nervapack clean --vectors first.
Exclude build directories
Create a .nervapackignore file (gitignore syntax) for any project-specific directories to skip:
Step 4: Run Your First Query¶
What you get: - A focused Markdown context block containing only the relevant classes, functions, and doc sections — ready to paste into an LLM prompt. - A token efficiency panel showing how many tokens NervaPack used vs. naive "dump the whole file" RAG.
Query: "How does authentication work?"
Query Router: Intent: semantic, Direction: both
Vector Search: Found 3 seed nodes
Retrieved Context:
──────────────────────────────────────────────────────────
# NervaPack Context Retrieval
## File: `src/auth/middleware.py`
### CLASS: AuthMiddleware (L15-L42)
```python
class AuthMiddleware:
def authenticate(self, token: str) -> User:
...
File: docs/authentication.md¶
MARKDOWN: Authentication Guide¶
JWT tokens are issued on login and expire after 15 minutes... ──────────────────────────────────────────────────────────
╭────────────── NervaPack Token Efficiency ──────────────╮ │ Strategy Tokens Reduction │ │ Naive RAG (3 files) 12,840 100% (base) │ │ NervaPack 1,180 9.2% │ │ ─────────────────────────────────────────────────────────│ │ Tokens saved: 11,660 Reduction: 90.8% │ │ Cost saved (GPT-4o $2.50/1M): $0.0292 per query │ ╰───────────────────────────────────────────────────────────╯
### Impact analysis
Find what would break if you change a function:
```bash
nervapack query "what breaks if I change AuthMiddleware"
Exact symbol lookup¶
Jump directly to a named entity, bypassing vector search:
Step 5: Visualize the Graph¶
Opens an interactive HTML file in your browser. Features: - Real-time search (filter nodes by typing) - Shortest path finder (click two nodes) - Community detection with Louvain colour coding - Drag, zoom, hover for code previews
Saved to .nervapack/graph.html — standalone, no internet required, shareable.
Step 6: Check Status¶
Shows health score (0–100), language distribution, documentation coverage, and most-connected files. Use this to decide whether to run nervapack enrich . to improve semantic coverage.
Step 7: Sync After Changes¶
After modifying files:
Only re-parses and re-embeds the changed files. Typically 2–5 seconds regardless of project size.
Step 8: Use with Claude Code (MCP)¶
Create .mcp.json in your project root:
{
"mcpServers": {
"nervapack": {
"command": "nervapack-mcp",
"description": "NervaPack knowledge graph (v0.6.1)"
},
"nervapack-memory": {
"command": "nervapack-memory-mcp",
"description": "NervaPack agent memory (v0.6.1)"
}
}
}
Add to your CLAUDE.md:
## NervaPack session protocol
At the start of every session:
1. Call `memory_start_session("<task name>")`.
2. Call `memory_recall("project context", budget_tokens=400)`.
3. Call `query("<topic>")` before answering any code question.
During the session: call `memory_store` for decisions, facts, and procedures.
At session end: call `memory_end_session("<summary>")`.
Reload Claude Code — NervaPack tools appear automatically.
If Something Goes Wrong¶
Graph is wrong or too large¶
Duplicate vectors from multiple ingests (older versions)¶
doctor for full diagnostics¶
Checks Python version, tree-sitter grammars, embedding backend, Ollama connectivity, and MCP config.
"Not a git repository" error on sync¶
Daily Workflow¶
# Morning: check graph is current
nervapack status
# Sync if files changed
nervapack sync .
# Query while coding
nervapack query "How does the caching layer work?"
# Before a review: explore changed module
nervapack explore src/auth/ --hops 2
# End of sprint: check hotspots
nervapack hotspots --since "2 weeks ago"
Next Steps¶
- Command Reference — detailed docs for every command
- MCP Server — wire NervaPack into Claude Code / Cursor
- Agent Memory — cross-session memory for AI agents
- Benchmarks — verified performance numbers