Metadata-Version: 2.4
Name: repolens-rag
Version: 0.1.1
Summary: A local-first RAG engine that answers questions about any repository, grounded exclusively in the checked-out code with verifiable file:line citations.
Project-URL: Homepage, https://github.com/sumanthd032/RepoLens
Project-URL: Documentation, https://github.com/sumanthd032/RepoLens
Project-URL: Repository, https://github.com/sumanthd032/RepoLens
Project-URL: Changelog, https://github.com/sumanthd032/RepoLens/blob/main/CHANGELOG.md
Author: Sumanth D
License: MIT
License-File: LICENSE
Keywords: code-search,documentation-drift,embeddings,rag,tree-sitter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.11
Requires-Dist: aiofiles>=23.2.1
Requires-Dist: anthropic>=0.28.0
Requires-Dist: fastapi>=0.111.0
Requires-Dist: gitpython>=3.1.43
Requires-Dist: httpx>=0.27.0
Requires-Dist: lancedb>=0.10.0
Requires-Dist: networkx>=3.3
Requires-Dist: openai>=1.35.0
Requires-Dist: pathspec>=1.1.0
Requires-Dist: pydantic-settings>=2.3.0
Requires-Dist: pydantic>=2.7.0
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: rank-bm25>=0.2.2
Requires-Dist: rich>=13.7.0
Requires-Dist: sentence-transformers>=3.0.0
Requires-Dist: sse-starlette>=2.1.0
Requires-Dist: torch>=2.3.0
Requires-Dist: transformers<5,>=4.41
Requires-Dist: tree-sitter-c>=0.21.0
Requires-Dist: tree-sitter-cpp>=0.21.0
Requires-Dist: tree-sitter-go>=0.21.0
Requires-Dist: tree-sitter-java>=0.21.0
Requires-Dist: tree-sitter-javascript>=0.21.0
Requires-Dist: tree-sitter-python>=0.21.0
Requires-Dist: tree-sitter-rust>=0.21.0
Requires-Dist: tree-sitter-typescript>=0.21.0
Requires-Dist: tree-sitter>=0.21.0
Requires-Dist: typer>=0.12.0
Requires-Dist: uvicorn[standard]>=0.30.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27.0; extra == 'dev'
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.2.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Description-Content-Type: text/markdown

<div align="center">

# RepoLens

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

[![CI](https://img.shields.io/github/actions/workflow/status/sumanthd032/repolens/ci.yml?branch=main&label=CI)](https://github.com/sumanthd032/repolens/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/repolens)](https://pypi.org/project/repolens-rag/)
![Python](https://img.shields.io/badge/python-3.11%2B-blue)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

</div>

---

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

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

Or run it fully containerised:

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

## Quickstart

```bash
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](docs/quickstart.md) 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](docs/ARCHITECTURE.md).

## Documentation

- [Quickstart](docs/quickstart.md)
- [Configuration](docs/configuration.md)
- [API reference](docs/api-reference.md)
- [Architecture](docs/ARCHITECTURE.md)
- [Tech stack](docs/TECHSTACK.md)
- [Contributing](CONTRIBUTING.md)

## License

[MIT](LICENSE)
