Decide what goes into the context window each turn, and what to remember between sessions.
Starting with What context engineering is, Context budgets, Conversation history, Prompt caching, Memory, Long context vs retrieval, and more
In a picture
Everything the model sees has to fit in one window of tokens.
The model attends only to what is inside the window.
Old turns fall out; the model cannot see them any more.
Stage 1 of 3: Fill
Open the full conceptMade for you now: slide lessons from basics to production, usually with code and a quiz. See a finished one
Decide what goes into the context window each turn, and what to remember between sessions.
AI EngineeringStage 5 of 17: Context engineering and memory
Start with these 6. 9 more are one tap away.
Choosing what the model sees each turn matters as much as the wording.
What to include, summarise or drop when the window fills up.
Keep, trim or summarise past turns as a chat grows.
Reuse a fixed prefix across calls to cut cost and wait time.
Keeping state across steps and sessions.
When a bigger window beats RAG, and when it does not.