← AI Agents & RAG learning path
AI Agents & RAG · Module 2 of 10

Prompt engineering

Write prompts that get reliable results.

📖 Key ideas

  1. Be specific: role, task, context, format, constraints.
  2. Give examples (few-shot) for consistent outputs.
  3. Ask for structured output like JSON.
  4. Break complex tasks into steps.
  5. Test prompts on many cases, not just one.
💡 Real-life example: A prompt is a job brief: a vague brief gets vague work, a clear one gets exactly what you need.
System promptInstructions setting behaviour
Few-shotIncluding examples in the prompt
Structured outputAnswers in a fixed format like JSON
Prompt templateReusable prompt with placeholders