Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Memory is rolling out for general availability. Memory might still be in preview in some regions.
Memory works without additional setup. By default, an agent applies the same criteria to determine what to remember, regardless of its purpose. To tailor memory to your agent's purpose, add memory guidance to the agent's instructions. Memory guidance tells the agent which details to remember, when to confirm or update them, and how to track ongoing work.
This article explains what memory guidance can add, how to write it, and how to test it.
Note
The harness used to build this agent uses usage-based billing. Using, building, testing, and evaluating agents might consume Copilot Credits. Learn more in Overview of usage-based billing.
What memory guidance can add
Memory guidance is most useful when it tells the agent something it can't work out on its own. Effective guidance covers one or more of the following areas:
- What to remember: Name the details that your agent's answers depend on. For example, an IT support agent can remember each user's device type and office location.
- When to ask, remember, and confirm: Tell the agent to ask for a missing detail instead of guessing, remember the answer, and confirm the saved detail before it relies on it. For example, a travel agent can ask for a user's home airport, remember it, and confirm it before it searches for flights.
- When to update: Describe when the agent should update a saved detail, and when it should keep the detail and note a temporary change. For example, a project agent can update a deadline that's officially moved, and note a temporary hold with its dates without changing the deadline.
- What to record for ongoing work: For triggered runs, describe how to identify each piece of work, what to record after each run, and when to recall earlier results. For example, an invoice processing agent can keep a note for each invoice by its number, record which approvals are still pending, and check that note in the next run.
- What not to remember: Narrow what the agent saves for your scenario. For example, an HR policy agent can remember only facts that employees state directly, not conclusions it draws from their questions.
Write memory guidance
- Be specific to your scenario: Generic guidance repeats what memory already does. Name the details, and say when the agent should remember, confirm, or update them. For example, for an IT support agent:
- Less effective: "Remember important details about the user."
- More effective: "Remember each user's device type and office location. If either detail is missing, ask before you troubleshoot. If a user reports a new device or a different office, update memory."
- Keep memory guidance together: Put it in one place in your instructions, such as under a "Memory" heading, so that it's easy to review and update.
Examples
The following examples show complete memory guidance for two kinds of agents, and the areas that each one covers.
Agent that people chat with
A store operations agent helps store managers check inventory, plan staffing, and track sales. Each task depends on which store the manager runs, and managers sometimes move to a different store. By default, the agent might remember a manager's store when it comes up, but it doesn't know that most answers depend on it.
Add the following instruction:
If you don't know which store the manager runs, then ask and remember it. Before you answer a store-specific question, confirm that the manager is still at that store. If they moved, update their store in memory. If they're covering another store temporarily, keep their usual store, and note the dates of the coverage.
This instruction covers:
- What to remember: The manager's store.
- When to ask, remember, and confirm: Ask once, remember the store, and confirm it before a store-specific answer.
- When to update: Update the store after a move. Keep the usual store, and note the dates of temporary coverage.
Managers name their store once. In later conversations, the agent confirms the saved store before it answers and updates memory when a manager reports a change.
Agent that runs on triggers
A bid evaluation agent runs whenever a supplier submits a bid or supporting document for a Request for Proposal (RFP). Bids and documents for the same RFP arrive over several days, and each one starts a new run. By default, the agent keeps a work note for each piece of work, but it doesn't know that your work is organized by RFP or what a recommendation depends on.
Add the following instruction:
Track each RFP in its own note, named by RFP number. After each run, record which bids you evaluated, your current recommendation and the reason for it, and any missing documents. When a new bid or document arrives, check the note for that RFP first. Reassess only the bids that the new information affects. If nothing material changed, keep the current recommendation.
This instruction covers:
- What to record for ongoing work: One note for each RFP number, with the bids evaluated, the recommendation and its reason, and missing documents.
- When to recall earlier results: Check the note first, and reassess only the bids that new information affects.
- When to update: Update the recommendation only when something material changed.
Each run continues from the last one. The agent doesn't re-evaluate bids it already reviewed, picks up where a missing document blocked the work, and changes its recommendation only when new information warrants it.
Test your memory guidance
Use information that isn't sensitive when you test.
For an agent that people chat with:
- In the Build tab, turn Memory on, and then select the Preview tab.
- Have a conversation that your guidance applies to.
- Open the memory portal, and check that the agent saved what your guidance describes.
- Start a new conversation, and check that the agent uses the saved information as your guidance describes.
For an agent that runs on triggers, trigger the agent more than once for the same piece of work. Then review the agent's activity to check that later runs continue from earlier ones.
Memory involves judgment, so test each scenario more than once. If the results differ from what you expect, make the guidance more specific, and test again.
Keep in mind
- Guidance shapes judgment: Memory guidance makes the agent more likely to save and use the right information. It doesn't guarantee a specific result.
- Guidance isn't a privacy control: Guidance can narrow what the agent saves, but don't rely on it to keep sensitive information out of memory.
- Settings stay separate: Instructions can't turn Memory on or off, change who can see memories, or change how long memories are retained.