Domain 4 of 6 · Chapter 1 of 3

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 keptLifetimeWho else can use it, and what blocks themHow it is removed
Active context windowThe current conversationNobodyIn 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 onlyNobodyEnds with the conversation; not available in later ones
VS Code repo notes (/memories/repo/)Across conversations in the current workspaceNobody automatically - files are local to the machineAsk the agent to update the file; Clear All Memory Files wipes every scope
VS Code user memory (/memories/)Across workspaces and conversationsNobody automatically - files are local to the machineAsk the agent to update the file; Clear All Memory Files wipes every scope
Copilot Memory repository factUntil unused for the retention interval, currently 28 daysUsers 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 CLIRepository owners review and delete repository facts
Copilot Memory user preferenceUntil unused for the retention interval, currently 28 daysOnly that user, across their repositories; applied by Copilot CLI, not by Copilot code reviewThe user views and deletes their own preferences
Copilot SpaceUntil the Space is changed or removedTeammates it is shared with, limited to sources they can already accessManaged 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 policyConsumers of that workflow runExpiration, or manual deletion before it expires

Decision tree

no yes no yes yes no yes no yes no Lifetime: must it outlivethis conversation? Audience: should otherpeople reuse it? Only needed inthis workspace? Curated project context,not a learned fact? Reach: is a note localto this machine enough? Active context window orsession notes(/memories/session/);attach sources, splitconversations, check /context Repo notes(/memories/repo/);local to the machine,not shared by commit Copilot Space:synced sources, sharedwith teammates; eachsees only sources theycan already access Copilot Memoryrepository fact;usable only in thatrepository VS Code user memory(/memories/): acrossworkspaces, local tothis machine Copilot Memoryuser preference:follows the user acrossrepositories (Copilot CLI)

Cheat sheet

  • The active context window provides short-term conversational memory
  • Use /context to identify what consumes the active context budget
  • Large tool results can be kept outside the active context as file-backed previews
  • Raising the large-output threshold leaves less context for subsequent work
  • Attach the specific file or GitHub work item needed for the current decision
  • Use independent conversations for unrelated tasks
  • Keep custom instructions concise and actionable
  • Choose repository facts or personal preferences according to who should reuse them
  • Creating Copilot Memory repository facts requires an enabled user with write access
  • Enable Copilot Memory for the user rather than for an individual repository
  • Select the VS Code memory path according to lifetime and workspace scope
  • Local VS Code memory is not a repository-distributed collaboration artifact
  • Do not rely on a VS Code Plan agent's plan in session notes in a later conversation
  • Unused Copilot memories expire rather than persisting indefinitely
  • Use the appropriate owner to remove persistent Copilot memories
  • Prune an outdated VS Code memory by asking the agent to update its file
  • Clear All Memory Files resets all VS Code memory scopes
  • Use /clear or /new for a fresh conversation rather than a continuity-preserving summary
  • Archive a completed conversation when it must remain recoverable
  • Set state-artifact retention within the enclosing retention limit
  • Use a Copilot Space for reusable external project context
  • Use a Space's custom instructions to specialize responses to its workflow
  • Attach GitHub sources directly when reusable context must track repository changes
  • Share a Copilot Space to give teammates the same selected project context
  • Use the remote GitHub MCP server to access Spaces from an IDE
  • Explicitly attach task-critical sources instead of relying on editor activity
  • Treat workspace indexing as selective discovery rather than full-repository context
  • Enable the memory tool and explicitly request a reusable note when persistence matters
  • Prioritize reusable guidance within the automatically loaded portion of user memory
  • Sharing a Space does not grant access to its restricted sources
  • Choose Space sources that the IDE integration supports
  • Enable the Spaces toolset and use Agent mode before requesting IDE Space context
  • Delete retained cloud history explicitly and choose whether to preserve the local copy
  • Moving a task to another repository leaves its learned repository facts behind
  • Treat Copilot Memory as a renewable convenience, not a permanent record

Unlock with Premium — includes all practice exams and the complete study guide.