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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repolens_rag-0.1.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repolens_rag-0.1.2-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file repolens_rag-0.1.2.tar.gz.

File metadata

  • Download URL: repolens_rag-0.1.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for repolens_rag-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2c896470937500334588d95952599000c00258e691d801e6ec0192cf67d25daf
MD5 338cefe6f2133362ca38de9cb72ce36e
BLAKE2b-256 4615f6009546784dbc7212e6b8dca59f0936930561a4084cb7f4f3bae1ce5656

See more details on using hashes here.

File details

Details for the file repolens_rag-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: repolens_rag-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for repolens_rag-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93d60f6199043a66bbf813a67d26184499b6948b405f50e0425c12d7d3e87232
MD5 fd26137b2a906b6ead98f1184c3d8a47
BLAKE2b-256 b52a40ba1a53e8b33a97391ac3131317edf8859dd857cbf4e6d515411c9f81f3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page