A multi-source RAG system tailored for technical customer support on distributed software systems.
Retrieves and reconciles knowledge from three distinct sources:
- Product Documentation
- Customer Support Forums
- Engineering Blogs
- Deterministic Pipeline: Chunking, query intent routing, retrieval, multi-stage reranking, and contradiction resolution are performed using classical IR, discriminative models, and deterministic rules. The LLM is used only for the final response generation.
- Protocol-Driven Interfaces: Core components (
Embedder,Reranker,NLI,Generator,VectorStore) follow Python Protocols configured viaconfig/default.yaml. - Ground-Truth Fact Ledger: Corpora are generated from
data/ledger.yamlwith injected contradictions across numeric limits, version deprecations, feature tiers, and unofficial workarounds. - Trace Logging: Each query execution appends a structured JSONL record to
logs/rag_traces.jsonltracking routing weights, stage scores, detected conflicts, citations, and latencies.
rag/
├── config/
│ └── default.yaml
├── data/
│ ├── ledger.yaml
│ └── raw/
│ ├── docs/
│ ├── forum/
│ └── blog/
├── src/
│ ├── interfaces.py
│ ├── chunking/
│ │ ├── doc_chunker.py
│ │ ├── forum_chunker.py
│ │ └── blog_chunker.py
│ ├── indexing/
│ ├── routing/
│ ├── retrieval/
│ ├── rerank/
│ ├── contradiction/
│ ├── generation/
│ ├── logging/
│ └── pipeline.py
├── eval/
│ ├── queries.jsonl
│ ├── run_eval.py
│ └── ablations.py
├── scripts/
│ ├── build_data.py
│ ├── demo.py
│ └── cli.py
├── report.md
├── presentation_script.md
└── requirements.txt
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtpython scripts/cli.pyIf no API key is detected in the environment, the CLI will prompt for your Groq API key on startup.
python scripts/demo.pypython eval/run_eval.pypython eval/ablations.py- Recall@5: 1.0000
- MRR: 1.0000
- nDCG@5: 0.9883
- Contradiction Precision: 0.8000
- Contradiction Recall: 0.6667
- Contradiction F1: 0.7273
- Resolution Accuracy: 0.7500
- Citation Precision: 1.0000
- Faithfulness: 1.0000
- Conflict Adherence: 0.7500