Lesson 3 of 4 Context Management and Agent Memory

Choosing Memory Strategies for Single Agents and Agent Teams

This lesson explains the memory strategies that allow agents to personalize and learn from past interactions, both a single agent's memory about its users and memory that a team of agents shares, and how Foundry and custom implementations provide them.

Learning outcomes

After completing this lesson, you will be able to:

  • Combine session memory with user memory for a single agent.
  • Describe Foundry Agent Service memory stores.
  • Distinguish private, workflow-shared and cross-workflow memory, and control who may write to each.

Single-agent memory

A single agent typically combines session memory, the current conversation, with user memory that persists across sessions: profile facts (role, location), preferences (language, format), and summaries of past interactions. At the start of a conversation or step, relevant memories are retrieved and injected; at the end, new memories are extracted and stored. Extraction can be done by a model that identifies durable facts, with consolidation that merges duplicates and updates contradicted facts.

Put in order

The memory cycle of a conversation

Exam skills 2.2.2

Arrange how a single agent uses long-term user memory during a conversation.

Log in to try this activity Interactive activities are free with an account.

Foundry Agent Service memory

Foundry Agent Service provides managed memory stores (preview). A memory store is configured with chat and embedding model deployments; it extracts user profile and chat summary memories from conversations, consolidates them and returns relevant memories to the agent, scoped by a user identifier. Updates in 2026 added procedural memory, viewing and editing of individual memory items, and time-to-live settings on stores. Agents use memory through a memory search tool or the Memory Store API. Because the feature is in preview, behaviour and limits can change.

True or false

Foundry memory stores

Exam skills 2.2.2

Check how Foundry Agent Service memory stores work.

Log in to try this activity Interactive activities are free with an account.

Multi-agent memory

In a team, memory can be private to an agent (its own procedures and learned patterns), shared within a workflow (the case file that all agents working on a case read) or shared across workflows (customer facts used by every agent that serves that customer). The design decides which agents may read and which may write each kind. Allowing every agent to write shared memory risks one agent's mistake or a prompt injection polluting the memory that others trust, so writes are restricted to designated agents or go through validation.

The following table summarizes the strategies.

MemoryScopeWritersExample
SessionOne conversationThe agent in the conversationCurrent troubleshooting steps
UserOne user, across sessionsExtraction process with consolidationPreferred language and delivery option
Case or workflowOne caseDesignated agentsVerified facts and decisions on a claim
ProceduralOne agent or teamReviewed updatesSteps that resolved a recurring issue
Match the pairs

Kinds of memory in a team

Exam skills 2.2.2

Match each memory kind with its typical writers.

Log in to try this activity Interactive activities are free with an account.
Worked example

Polluted shared memory

In a support team of four agents, any agent can write to shared customer memory. After a web-search agent processed a forum page, the memory recorded that a customer was entitled to a free replacement, and other agents offered it.

Write access to shared customer memory should be limited to the agent that handles verified account data, with validation of entitlement-related facts against the system of record. The web-search agent should not write shared memory at all. A guardrail on tool responses would reduce injections, but the write permission is the root cause.

Check yourself

How is shared memory protected from being polluted by one agent?

Show answer

By restricting which agents may write to it and validating important facts before they are stored.

Exam Tips

Remember for the exam

  • User memory: extract, consolidate, retrieve, scoped per user.
  • Foundry memory stores (preview) provide user profile and chat summary memories.
  • Restrict which agents may write shared memory; validate important facts.