10Topic 10 of 16

Prompting

Better prompts, system prompts, chaining, RAG, and fewer hallucinations.

9 plates · 31 min to read them all


  1. 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
  2. 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, then test by breaking it. 3 min
  3. 10.03 How to Reduce AI Hallucinations With Prompts Ground answers in pasted source text, allow "not stated", demand a quote per claim, and lower temperature: the habits that cut invented facts. 4 min
  4. 10.04 How to Chain Prompts to Solve a Big Task Prompt chaining splits a task into separate API calls you can inspect (draft, review, refine), and when a modern model handles it in one call. 3 min
  5. 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 beats pasting the file. 3 min
  6. 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
  7. 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
  8. 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
  9. 10.09 Generate Embeddings Locally with EmbeddingGemma Install sentence-transformers, load EmbeddingGemma 2, encode queries and documents with its prefixes, score cosine similarity, and feed a vector DB. 3 min

Keep going

Other topics

All 152 plates →
  1. 01 Install & set up 7
  2. 02 First steps 4
  3. 03 Claude Code commands 14
  4. 04 Workflows 7
  5. 05 MCP 9
  6. 06 Claude 2
  7. 07 ChatGPT 6
  8. 08 Cursor 4
  9. 09 Local LLMs 19
  10. 11 Choosing tools 7
  11. 12 AI media 14
  12. 13 Everyday tasks 4
  13. 14 Other coding agents 11
  14. 15 Building with the API 23
  15. 16 Hugging Face 12

↑↓ move↵ openalt+↵ copy first command

Keyboard

⌘/ctrl+K or /
Search all guides
alt+↵
In search: copy the guide's first command
j / k
Move through a list of guides
c
On a guide: copy its first command
t
Toggle light / dark
?
This list