rag-debugger
Intercept, inspect, and fix your RAG retrieval pipeline.
Most RAG bugs aren't in your code — they're in your retrieval. Wrong chunks get
selected, knowledge gaps go undetected, and you find out when users complain.
rag-debugger gives you visibility into exactly what your vector DB returned,
why it won, and what's missing from your knowledge base.
Install
pip install rag-debugger
Quickstart
import rag_debugger as rd
rd.init(project="my-rag-app")
retriever = rd.wrap_retriever(your_retriever)
Gap detection
Find what your knowledge base is missing before your users do:
from rag_debugger import GeminiClient, GapDetector
client = GeminiClient() # set GEMINI_API_KEY env var
detector = GapDetector(client) # default threshold is 0.65, change here if needed
chunks = your_retriever.get_relevant_documents(query)
report = detector.analyze(query, [{"content": c.page_content} for c in chunks])
print(report)
# [GAP DETECTED] coverage=50% worst_score=0.64 priority=0.50
# Missing: refund policy, iOS-specific cancellation
# Fix: Add docs covering refund eligibility and iOS cancellation flow.
# ✓ [0.71] how to cancel
# ✗ [0.64] how to get a refund
Why sub-intent decomposition
A query like "cancel my iOS subscription and get a refund" is really four
questions. Standard RAG scores the whole query — if cancellation chunks score
high, the query looks covered. rag-debugger decomposes it into atomic
sub-intents and scores each one independently, so a missing refund policy
is always caught even when the cancellation docs are excellent.
LLM & embedding backend
rag-debugger uses Google Gemini by default (free tier via
Google AI Studio):
from rag_debugger import GeminiClient
client = GeminiClient(api_key="...") # or set GEMINI_API_KEY as an environment variable
Used models:
- LLM:
gemini-2.5-flash - Embeddings:
gemini-embedding-001
Integrations
Works with LangChain, LlamaIndex, and any custom pipeline. See the SDK reference for details.
License
MIT
Release files for rag-debugger-amine 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rag_debugger_amine-0.1.0.tar.gz | 9.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rag_debugger_amine-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:16.4 kB
Release files / rag_debugger_amine-0.1.0.tar.gz
| Download URL | rag_debugger_amine-0.1.0.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1557ef888b99529bee87fa3ed83794062cff77c8bc0db2f88e80e4c61f1c9416
|
|
BLAKE2b-256 checksum How to use checksums |
d904ebbd3e9c62c35f5c4068ef448755953cc90730d107e9b05e9172a6208ff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / rag_debugger_amine-0.1.0-py3-none-any.whl
| Download URL | rag_debugger_amine-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7b0113fdcf40fa7fad402cae35d12534d3b9ab0c50af98a415d8411debfd75b
|
|
BLAKE2b-256 checksum How to use checksums |
eaafa35a4e6255803fc2af0b5590b1367ad1ec076d5e9e222814aace8ea9ed70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log