Skip to content

CodeNib

CodeNib finds the source code a coding agent needs and serves it with file and line evidence. It builds several views of one repository snapshot (BM25, embeddings, a typed SCIP/LSP symbol graph) and offers them three ways: as fixed retrieval pipelines, as fixed LLM workflows, and as tools inside an agent loop.

The shipping path for Codex and Claude Code is local CodeGraph setup: model-free, with no API key. The headline measured result is the grep → Jev experiment: 71.4% code-block Recall@5 on 100 issues, 12.8 percentage points above the same grep candidates without reranking. That route is optional and uses remote models.

How these docs are organized

Section Read it to Start with
Get Started Install CodeNib and connect a repository to your agent Agent-ready CodeGraph
Guides Serve context over MCP, add grep → Jev, or embed CodeNib in an agent MCP Server
Concepts Understand the views and how each method uses them Context methods and support matrix
Benchmarks See what is measured, on which datasets, and how to reproduce it Method × benchmark matrix
API Reference Browse the public Python contracts codenib public surface
Development Extend, test, and release CodeNib Contributing a Language

Language support differs by view. The generated language capability matrix shows which languages support chunking, graph indexing, incremental backends, and C++ core decoder parity.

Quick Start

CodeNib 0.2.4 can prepare a local, model-free CodeGraph and register it with installed Codex and Claude Code clients in one command:

python -m pip install "codenib[graph,mcp]==0.2.4"
codenib codegraph init /path/to/repository

The command installs package-managed language providers, builds reusable BM25 and symbol-graph views under ~/.codenib, and delegates MCP registration to the clients' own CLIs. The target checkout remains unchanged. Read the CodeGraph guide for status, safe uninstall, client scopes, and tool examples.

python -m pip install "codenib[semantic]==0.2.4"
codenib wiki /path/to/repository

The separate Wiki path enables hybrid BM25+dense retrieval with the pinned CodeRankEmbed model. Read the Quickstart for provider setup and browser troubleshooting.

Serving Docs Locally

git clone https://github.com/sysevol-ai/CodeNib.git
cd CodeNib
python -m pip install -e ".[dev]"
mkdocs serve

Then open http://localhost:8000.