RAG Formation · Lesson · Grounded answer generation
Prompts that answer only from evidence
Turn “only answer from evidence” into a prompt contract that makes grounded answers and honest refusals observable.
$ lesson --status
▸ course RAG Formation
▸ lesson 10 / 16
▸ phase Grounded answer generation
▸ status Complete
● build → measure → learnStandalone lesson
Learn the full lesson and test your understanding here.
The 16-lesson RAG Formation curriculum is complete. This page contains the complete lesson content, local reference material, and instant browser exercises.
Today’s tangible win
One versioned prompt rule that spells out how to use evidence, handle missing facts, cite sources, and know when to refuse.
Watch the walkthrough
1 · The skill
Take one wrong or half-right answer from Lesson 4, hold it against the current prompt, and write down exactly one rule that would have fixed it.
- Grounded generation: the model answers from the evidence you gave it, not from whatever it already “knows.”
- Instruction hierarchy: your system and developer rules decide what the model is allowed to do when evidence is thin or contradictory.
- Prompt contract: a testable spec for answer format, when to refuse, how to cite, and how to handle conflicting evidence.
2 · Run the evidence loop
cd demo
python3 eval.py run --mode answer --workspace meridian_demo --limit 10 --tag lesson-10-prompt-baselinePick one failure and write down: what evidence was actually available, what unsafe thing the model did with it, the instruction you’d add to stop it, and which eval category to rerun.
A prompt can’t conjure up a source that was never retrieved — check retrieval and context before you go blaming generation.
3 · Decision worksheet
| Baseline evidence | One hypothesis/change | Metric | Regression check | Bounded conclusion |
|---|---|---|---|---|
| _____ | _____ | _____ | _____ | _____ |
4 · Retrieval practice
Question: The corpus doesn’t have the fact you need. What should a properly grounded prompt force the model to do?
Mission connection
QA and regulatory readers need answers short enough to actually audit. The prompt should spell out the safe behavior in explicit, measurable terms — not leave it to the model to figure out on its own.
5 · Deliverable and next action
- Save the command output or the report.
- Fill in the decision worksheet.
- Write down one failure case and the next check you’ll run.
One versioned prompt rule, covering evidence use, missing facts, citations, and when to refuse.
Next: Lesson 11 — Citation design and source fidelity.
Got follow-up questions? Ask me about the evidence, the metric, the failure case, or what to try next — I’m teaching this course.