RepoLens is a local-first RAG engine for OSS contributors. It answers questions about any
repository using only the checked-out code — every answer sentence cites a file:line-range
span, every citation is re-verified against the file on disk, and a per-answer grounding score
tells you how well the answer is supported. It also detects where documentation has drifted
from the code.
- Grounded, not guessed. Answers cite verifiable
file:linespans. If the code doesn't contain the answer, RepoLens says so instead of hallucinating from model memory. - Code-native retrieval. Source is parsed with tree-sitter into semantic units, embedded with a code-aware model, and retrieved with hybrid dense + BM25 search, reranking, and caller/callee graph expansion.
- Doc-drift detection. A dedicated mode flags doc claims that the code contradicts or no longer supports — CI-compatible with a non-zero exit on new findings.
pip install repolens-rag
export GROQ_API_KEY=gsk_... # free key: https://console.groq.com/keysOr run it fully containerised:
GROQ_API_KEY=gsk_... docker compose up # then open http://localhost:8000repolens index ./path/to/repo # index a local repository
repolens ask "how does routing work?" --repo <id>
repolens drift --repo <id> # find stale documentation
repolens serve # launch the web UI at http://localhost:8000See the Quickstart guide for the full walkthrough.
Browser (React)
│ HTTP ↓ ↑ SSE
FastAPI server
├── Ingestion git walker → tree-sitter → chunker → graph → embedder + BM25 → storage
├── Retrieval storage → hybrid (dense + BM25) → RRF → reranker → graph expander
├── Generation chunks → grounded prompt → LLM → citation validator → grounding scorer
└── Drift storage → claim extractor → NLI entailment → markdown report
Full details in docs/ARCHITECTURE.md.