Skip to main content

A local-first RAG engine that answers questions about any repository, grounded exclusively in the checked-out code with verifiable file:line citations.

Project description

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

Project details


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.1.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.1-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: repolens_rag-0.1.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for repolens_rag-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1dd2fe82db79c17fe210119d52cc8f970089ac22aea4baa4fdc894982cb42a6e
MD5 aeeeb6d96d70ab819ee15dbcb2c3a3e4
BLAKE2b-256 f45364fb28c4c9eedf3dfc032599424aef51d2f6d334a3a17d4a194f51526fc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: repolens_rag-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for repolens_rag-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 286c9b2cc23567ef752454dde65604e62246e495142c6d41e92c3e6969ceab84
MD5 ec3315771ecdbebb810df009b145a905
BLAKE2b-256 cf547309d913d66f97df60a954628171dab3e3c8e18e4e65b4426407ca352104

See more details on using hashes here.

Supported by

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