// the find
pchunduri6/rag-demystified
An LLM-powered advanced RAG pipeline built from scratch
A single-script walkthrough of the sub-question query engine pattern — the kind of thing LlamaIndex abstracts away but never explains. It shows you what's actually happening: four chained LLM calls, each following the same prompt-template + context + question pattern. Aimed at developers who want to understand why their RAG pipeline misbehaves before they reach for a framework.
The README does the rare thing of showing concrete failure cases with actual examples, not just happy-path demos. The decomposition of sub-question generation, retrieval, and aggregation into distinct, inspectable LLM calls makes the cost and latency profile obvious in a way no framework does. The LlamaIndex baseline comparison is useful — running the same query through the opaque abstraction and showing where it goes wrong is more instructive than any tutorial. Using structured output (Pydantic + Instructor + OpenAI function calling) for sub-question routing is the right call and prevents the classic JSON-parsing fragility.
This is a research notebook dressed up as a repo — one script, no tests, no packaging, effectively abandoned since January 2024. It's hardwired to OpenAI GPT-3.5/4 and the now-deprecated EvaDB; you can't swap in another LLM or vector store without rewriting core logic. The data sources are five Wikipedia city articles, which is too toy to tell you anything about chunking strategy, document count, or latency at real scale. The cost analysis is qualitative hand-waving — there's no actual token counter or per-call logging, which undermines the stated goal of making cost dynamics visible.