Watch the video above to see the live 25-minute requirements interview and repo commits in action. This companion piece distills the reusable pre-code RAG readiness checklist, 3-state answer contract, and ADR-001 index-isolation pattern so you can apply them before writing line one of your own retrieval system.
A single prompt can generate a working RAG prototype with a chat UI in five minutes. That speed hides a trap: when the prototype cites a source it never read, or claims a paper lists seven failure points and only prints six, you cannot fix it because you never wrote down what “correct” looks like.
When I started rebuilding my RAG system from scratch as if an engineering team depended on it, I intentionally wrote zero code in phase one. Below is the exact specification architecture that replaced guesswork with measurable pass/fail criteria.
The Pre-Code RAG Readiness Checklist
Before choosing a vector database, chunk size, or web UI, five decisions determine whether a RAG system can be trusted or only demoed:
| Pre-Code Gate | Common Vibe-Coded Default | Production-Grade Rule | Why It Matters |
|---|---|---|---|
| Source governance | Auto-crawl or auto-reindex any modified file | Frozen, licence-checked copies; file fingerprint (R7/R8) halts indexing until a lead re-approves changes | Prevents silent ingestion of unapproved or broken source edits |
| Document boundaries | Split every PDF page into its own chunk | Preserve multi-page lists and sections across PDF page breaks (R6) | Stops the exact bug that turned a 7-item list into 6 |
| Evaluation labels | Label ground-truth answers by chunk ID | Label hand-written eval questions by file + section | Chunk IDs break the moment your chunking strategy changes |
| Pass mark | Judge answers by how fluent they sound | Fix a numeric bar upfront: >= 8/10 answerable sources right + not found on an unanswerable query | Turns quality from an opinion into a countable score |
| Interface scope | Build the chat web UI on day one | CLI/terminal first; defer UI, approval screens, and LLM-as-judge scoring to out-of-scope | A polished UI hides broken retrieval underneath |
The 3-State Answer Contract
Most prototype RAG apps collapse every response into one confident paragraph, falling back on the LLM’s parametric memory whenever retrieval comes up empty. Defining an explicit three-state output contract eliminates that ambiguity before any prompt is written:
| Answer State | Trigger Condition | Required Behavior | Forbidden Behavior |
|---|---|---|---|
found | Matching approved passages cover the query | Answer strictly from retrieved passages and cite exact sources | Adding uncited facts from model memory |
not found | Index is healthy, but approved sources do not cover the query | Explicitly state that the approved sources do not answer the question | Guessing or answering from pretraining knowledge |
unavailable | Index, embedder, or dependency error occurs | Fail loudly with an actionable system/configuration error | Pretending the answer was simply not found |
Keeping not found and unavailable separate is critical for evaluation: an infrastructure bug must never masquerade as a retrieval miss.
Keeping Premature Choices Out of the PRD
When using AI coding assistants for planning, they routinely try to settle implementation details (chunk size, hybrid vs. dense search, vector store) before a single test question exists.
To stop accidental architecture lock-in, every undecided choice moves out of the PRD into an Open Decisions table tracking four columns: what the decision serves, when it will be settled, what data is needed first, and what blocks it. Two edge cases surfaced immediately once that table existed:
- Stale documentation discipline: When evaluation questions are committed mid-planning, open-decision tables go stale instantly. Tracking the fix as an explicit follow-up commit keeps history auditable.
- Multi-source scoring rules: If an evaluation question expects two source files (as questions 9 and 10 did in my 11-question set), your pass mark changes depending on whether returning one source counts as a hit or only both. Logging that ambiguity before running the baseline prevents moving the goalposts after seeing scores.
Once a row in the table has enough evidence to settle, it leaves the table and becomes an Architecture Decision Record (ADR).
ADR-001 Pattern: Preventing Silent Embedding Model Mismatches
To compare two embedding models fairly on the same 11-question benchmark (OpenAI embeddings in the cloud vs. a local Jina embedding model), one index must never mix vectors from different models. Three storage architectures exist:
| Index Strategy | Trade-Off | Verdict |
|---|---|---|
| Single shared index (rebuild on switch) | Re-embeds entire corpus every time you compare models | Slow, error-prone during side-by-side evals |
| Embed on the fly (no persisted index) | Zero index management | Unusable latency and repeated API cost |
| One isolated index per model | Slightly more disk space; zero rebuilds during evaluation | Selected (ADR-001, updates R10) |
Isolating indexes solves rebuild friction, but introduces a subtle failure edge: what prevents a query embedded by Model A from being searched against Model B’s index?
If the two models have different vector dimensions, search crashes loudly. Worse, if their dimensions happen to match, similarity search returns plausible-looking scores that are mathematically meaningless, causing your benchmark to blame the embedding model for a wiring bug.
The guardrail contract in ADR-001:
- Every persisted index carries an immutable metadata label naming the exact embedding model that built it.
- At query time, search reads the index’s model label to select the matching embedder.
- If the query embedder and index label still disagree, search aborts immediately in the
unavailablestate with an error naming both models, never silently returningnot found.
The Human Reviewer’s Habit in AI-Assisted Systems
Building specs with AI is fast, and in my first session the AI genuinely caught a real bug I had missed (PDF per-page chunking slicing a list across a page break) and flagged an eval scoring gap on multi-source questions.
Yet twice in the same session, its output looked finished while hiding a real failure edge: missing the governance re-approval rule (R7/R8) and leaving embedding-model mismatches unguarded until I asked “what happens on the other side of this?”
That is the working rule I am carrying into design, specs, and test-first code in the rest of this build: let the AI draft fast, then inspect every boundary where a quiet failure could look like a valid answer.
Links & Resources
- Source Repository (PRD, 11-Question Eval, Open Decisions & ADR-001): https://github.com/AsheeshSrivastava/rag_video_series
- YouTube Walkthrough: https://www.youtube.com/watch?v=cKO0rpBxNgE
