Module 08 of 12

Context Engineering Basics

Lessons

About This Module

Writing a good prompt is only part of the job. Everything the model sees when it answers, including instructions, retrieved documents, conversation history, tool results and examples, is its context. Context engineering is the practice of choosing, organizing and maintaining that information so the model has what it needs, when it needs it, and nothing that gets in the way.

The lessons introduce the idea and the main types of context, then show where it goes wrong in longer-running agents: context that grows too large, conflicts with itself, or fills with noise. You will also meet the common fixes, such as trimming, compaction, summarizing, note-taking and splitting work across sub-agents. The earlier modules on instructions, examples and tokens all feed into this one.

Watch the lessons in order, then continue on to Retrieval & Grounding.

Lessons

3 videos
01

Context Engineering for AI Agents

Microsoft's beginner introduction: what context engineering is, the different types of context, best practices, a code example, and common issues and how to address them. Part of the "AI Agents for Beginners" course.

Video 16min
02

Context Engineering for AI Agents (The Skill Replacing Prompt Engineering)

Why a bigger context window can make a model perform worse ("context rot"), four common ways agent context fails, and three techniques for long-running agents: compaction, structured note-taking, and sub-agents.

Video 10min
03

Fix Your LLM Pipeline: How to Build Reliable AI Agents

A longer conversation with an OpenAI solutions architect on managing context in tool-heavy agents: four failure modes, techniques for trimming and summarizing, short- and long-term memory, and a live demo comparing an agent with and without context engineering.

Video 57min