Implement agent memory strategies
Unlock the complete study guide.
Bundled into the existing Developing in Agentic AI Systems premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- Three places an agent can keep something
- Reading the context budget before you cut it
- Keeping oversized tool output out of the window
- Supplying only the context a task needs
- Copilot Memory: scope, creation, enablement, and retention
- VS Code memory scopes and what actually loads
- Copilot Spaces as reusable external context
- Matching the operation to how much it removes or keeps recoverable
- Exam reasoning: reading the scenario for lifetime, audience, and reach
The three stores this page compares, broken into their implementations and scopes, plus one non-store row shown for contrast
| Where it is kept | Lifetime | Who else can use it, and what blocks them | How it is removed |
|---|---|---|---|
| Active context window | The current conversation | Nobody | In Copilot CLI, /clear or /new starts a new conversation and /compact summarizes to continue; in VS Code, start a new conversation |
| VS Code session notes (/memories/session/) | The current conversation only | Nobody | Ends with the conversation; not available in later ones |
| VS Code repo notes (/memories/repo/) | Across conversations in the current workspace | Nobody automatically - files are local to the machine | Ask the agent to update the file; Clear All Memory Files wipes every scope |
| VS Code user memory (/memories/) | Across workspaces and conversations | Nobody automatically - files are local to the machine | Ask the agent to update the file; Clear All Memory Files wipes every scope |
| Copilot Memory repository fact | Until unused for the retention interval, currently 28 days | Users with Copilot Memory enabled on a paid Copilot plan (administrator policy enablement required for managed plans), in that repository only, via Copilot cloud agent, code review, and CLI | Repository owners review and delete repository facts |
| Copilot Memory user preference | Until unused for the retention interval, currently 28 days | Only that user, across their repositories; applied by Copilot CLI, not by Copilot code review | The user views and deletes their own preferences |
| Copilot Space | Until the Space is changed or removed | Teammates it is shared with, limited to sources they can already access | Managed as Space sources and instructions |
| GitHub Actions artifact holding agent state (outside the three stores, shown for comparison) | The configured retention-days, capped by the enclosing policy | Consumers of that workflow run | Expiration, or manual deletion before it expires |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.