- Learn
- Artificial Intelligence
- Prompt and Context Engineering
AI-M07
Prompt and Context Engineering
How to get reliable work out of a language model without training it: clear prompts, examples, step-by-step reasoning, structured output, system prompts, context budgets and caching.
Most of what an application gets from a model is decided by what you put in front of it. This module treats that input as an engineering surface: something you design, test and version, not a lucky incantation.
You will start with the parts of a good prompt and the habit of testing every change on real inputs, then learn how to choose examples, when asking for step-by-step reasoning pays off, and how to get output a program can parse every time. The second half moves from single prompts to the whole context window: what belongs in the system prompt, how to spend a limited context budget across instructions, tools, history and documents in long-running agents, and how prompt caching cuts the cost of everything you send again and again.
Lessons
- AI-07.01 Prompting fundamentals Good prompts are clear and specific: state the task, give relevant context, specify the format you want, and say what to do in edge cases. Beginner 12 min
- AI-07.02 Few-shot prompting and examples Few-shot prompting includes worked examples of inputs and desired outputs in the prompt, which shows the model the format and standard you expect. Beginner 8 min
- AI-07.03 Chain of thought and step-by-step reasoning Asking a model to reason step by step before answering often improves accuracy on multi-step problems, because intermediate steps become part of the context it builds on. Intermediate 10 min
- AI-07.04 Structured outputs Applications need machine-readable output. Intermediate 10 min
- AI-07.05 System prompts and personas The system prompt sets the model's role, rules and constraints for the whole conversation, while user messages carry the specific request. Beginner 8 min
- AI-07.06 Context engineering Context engineering is deciding what goes into the model's limited context window at each step: instructions, tool definitions, conversation history, retrieved documents and intermediate results. Intermediate 14 min
- AI-07.07 Prompt caching and cost control Prompt caching lets a provider reuse the processed form of a repeated prompt prefix, cutting cost and latency when many requests share long instructions or documents. Intermediate 8 min