Skip to main content

RepoLens

Ask any repository how it actually works — and get answers grounded in the real code.

CI PyPI Python License: MIT


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.

Why RepoLens

  • Grounded, not guessed. Answers cite verifiable file:line spans. 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.

Quick install

pip install repolens-rag
export GROQ_API_KEY=gsk_...         # free key: https://console.groq.com/keys

Or run it fully containerised:

GROQ_API_KEY=gsk_... docker compose up   # then open http://localhost:8000

Quickstart

repolens 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:8000

See the Quickstart guide for the full walkthrough.

Architecture

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.

Documentation

License

MIT

Metadata

Release files for repolens-rag 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repolens-rag 0.1.2
File Size Uploaded
repolens_rag-0.1.2.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for repolens-rag 0.1.2
File Interpreter ABI Platform
repolens_rag-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / repolens_rag-0.1.2.tar.gz

Download URL repolens_rag-0.1.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
2c896470937500334588d95952599000c00258e691d801e6ec0192cf67d25daf
BLAKE2b-256 checksum
How to use checksums
4615f6009546784dbc7212e6b8dca59f0936930561a4084cb7f4f3bae1ce5656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / repolens_rag-0.1.2-py3-none-any.whl

Download URL repolens_rag-0.1.2-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
93d60f6199043a66bbf813a67d26184499b6948b405f50e0425c12d7d3e87232
BLAKE2b-256 checksum
How to use checksums
b52a40ba1a53e8b33a97391ac3131317edf8859dd857cbf4e6d515411c9f81f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page