Memory & Context Engineering
Decide what enters an agent's context at each step and what persists between sessions, using compaction, on-demand loading and governed long-term memory.
4 objectives 6 steps about 115 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Assemble each step's context from instructions, tool definitions, history, retrieved data and tool results within a token budget.
- Keep long runs within budget with compaction: summarizing history, clearing stale tool results and keeping notes outside the context window.
- Design a long-term memory store with explicit write, retrieval, update, expiry and deletion policies, including consent for personal data.
- Reduce context load by loading tools, instructions or skills on demand and by isolating sub-tasks in separate contexts.
Lesson plan
6 steps, about 115 min · 5 of 5 lessons available so far
- Context as a Scarce Resource Concept · 15 min
- Building a Per-Step Context Assembler Worked example · 20 min
- Lab: Compaction for a Fifty-Step Task Lab · 25 min
- Loading Tools and Skills on Demand Worked example · 15 min
- A Long-Term Memory Store with Write and Expiry Policies Lab · 25 min
- Check: Context and Memory Design Review Knowledge check · 8 questions
Practise it
Run your agent on a task that needs more than 40 steps; add compaction and a notes file so it finishes within a fixed context budget, then add a user-preference memory with write, update and delete operations and a test proving deleted memories are never retrieved.
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.