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

Uploaded Python 3

File details

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

File metadata

  • Download URL: repolens_rag-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c75feeeea61ef003c71c9dad0b085232d18afa50cb872947c510740034adb7c8
MD5 b22142a161991597d6e59b5129445438
BLAKE2b-256 073ad020281ac3382377d2cb7c25b9ec70a710429fd71203d70692c414c179ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: repolens_rag-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 863d5b1acb16275c805e62321f40818c3b2e529ec99deb8fc4578414d09d98bf
MD5 43bef98d555689f7038b7a84d190f31c
BLAKE2b-256 46b9901d3b2a2d8e9428d935f58d5a72584bd476500ef97ae7a1a26a799f3e4a

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