RAG That Works: Build, Test & Fix Your Document AI
by Syed Faisal Haque
$10
Build a document assistant. Inspect its evidence. Learn how to fix the answers it gets wrong.
This practical guide and Python code bundle helps you trace a result from the question to the retrieved passage and source.
WHAT YOU GET
• A 22-page PDF guide with chapter bookmarks, plus editable Markdown source.
• A local document-search app with a browser interface.
• Offline BM25 retrieval using Python’s standard library.
• Optional OpenAI answers with citation-ID validation and optional hybrid retrieval.
• Four fictional source documents and 14 evaluation questions.
• A baseline report, answer-review worksheet, two debugging labs, a deployment checklist, and 26 core tests.
WHAT YOU LEARN
Prepare documents, choose chunk sizes, inspect retrieval, distinguish relevant text from sufficient evidence, handle missing facts, compare search approaches, and rebuild indexes after source changes. Finish with a capstone over your own approved documents.
REQUIREMENTS AND SCOPE
Basic Python and terminal familiarity, Python 3.10 or later, and a browser. Inputs are UTF-8 text and Markdown. Export PDFs to text first. Offline mode displays retrieved passages rather than generating answers. Optional AI and semantic modes require your own OpenAI API key and separately billed usage.
This is a local educational prototype. OCR, public hosting, authentication, multi-tenant access control, and automatic factual verification are not included. Citation-ID checks verify source identity, not factual correctness.
VALIDATION AND PROVIDER NOTICE
The offline CLI, local HTTP app, samples, and 26 core tests were checked. Optional provider responses are simulated in tests; live paid API calls were not made. Smoke-test AI mode with your own account.
Checked 19 October 2026: OpenAI has scheduled the pinned example model to shut down on 14 January 2027. The included provider notice explains how to select an available model through configuration and recheck results. Offline mode is unaffected.
LICENSE AND DELIVERY
One ZIP contains the guide, source, examples, tests, and worksheets. One purchase covers one developer. Modify the code for personal, internal business, and client applications, including commercial apps. Do not resell or redistribute the guide or substantially unmodified learning bundle.
One-time price: $10 USD. API credits, hosting, certification, a support service, and future updates are not included.