10Topic 10 of 15
Prompting
Better prompts, system prompts, chaining, RAG, and fewer hallucinations.
- 10.01 How to Write Better AI Prompts (A Framework) A prompt framework that still holds: role, task, context, format — plus the long-input ordering rule Anthropic measures at up to 30% better answers. 3 min
- 10.02 How to Write a System Prompt That Steers a Model System prompt structure: role, rules with reasons, exact output format, tagged examples. Set it in the API system parameter and test it by breaking it. 3 min
- 10.03 How to Reduce AI Hallucinations With Prompts Ground the answer in pasted source text, allow "not stated", demand a quote per claim, and lower temperature — the prompt habits that cut invented facts. 4 min
- 10.04 How to Chain Prompts to Solve a Big Task Prompt chaining splits a task into separate API calls you can inspect — the draft, review, refine loop — and when a modern model handles it in one call. 3 min
- 10.05 RAG Explained Simply (and When You Need It) RAG retrieves relevant chunks, then generates. With 1M-token context windows and hosted file_search tools, here is when it still beats pasting the file. 3 min
- 10.06 Prompt Evals with promptfoo: One YAML, One Matrix Install promptfoo, write a config with two prompts, three test cases and real assertions, run it, and read the pass/fail grid. 4 min
- 10.07 LLM-as-Judge Evals: Rubric and Verdict Grade model outputs with a judge model: a copy-paste rubric prompt, a structured verdict, a Python scoring loop, and the biases that fake good scores. 4 min
- 10.08 Prompt Injection Defense for Tool-Using Agents Six defenses that actually reduce blast radius — privilege separation, allowlists, fenced tool results, approval gates, output filtering, and tests. 4 min
Keep going