RAG Document QA
The foundations — single and multi-document question answering with LangChain.
- single + multi-document
- Scopemeasured in repo
The problem
Before building retrieval systems with reranking, guardrails and evaluation harnesses, I wanted the base case working end to end and understood: load a document, chunk it, embed it, retrieve against a question, ground an answer. Then the harder version — several documents at once, where the retriever has to decide not just which passage but which source.
Architecture
Standard LangChain retrieval: document loading, recursive character splitting, embedding into a vector store, similarity retrieval, and a grounded QA chain. The multi-document variant extends this across a corpus, so retrieval spans sources and answers have to carry provenance.
What broke
This is the naive baseline, and it has every weakness the later projects were built to fix: no reranking, so retrieval quality is whatever cosine similarity gives you; no metadata filtering, so multi-document retrieval mixes sources it should not; no evaluation, so quality is judged by reading outputs. It is here for honesty about the progression, not because it is production-grade.
Results
A working baseline for both single and multi-document QA — and, more usefully, a clear picture of exactly where naive RAG fails, which is what everything above it was built to address.