Fixed: Microsoft Agent Framework Agent Leaves Its Memories Out of Tool Calls
My Microsoft Agent Framework agent remembered that an employee works from the Pune office on Tuesdays and Thursdays and prefers ticket updates on Microsoft Teams. Asked, it listed both. But when it raised a ticket in a new conversation, the ticket had neither. The instructions told the model where a ticket's details come from, and memories weren't on the list.
What I Was Doing
I was giving an IT service desk agent a memory in Part 16 of the IT Service Desk series. A context provider adds what the agent remembers about the signed-in employee to every run's instructions, as a list:
What you remember about this employee from earlier conversations (ID: memory):
- d0c8316b: Works from the Pune office on Tuesdays and Thursdays.
- d605a17f: Prefers ticket updates on Microsoft Teams rather than email.
In one conversation, the employee shared both facts and the agent saved them. In a new conversation, the employee wrote The Wi-Fi at the office keeps dropping on my laptop. What can I do?, got the steps from the knowledge base, and answered I already tried all of that. Please raise a ticket.
The agent's instructions, from an earlier part, said this about tickets:
- Write the ticket's title and description from what the employee told you and what your tools found.
Never invent details. After raising it, give the employee the new ticket's number.
What I Expected
A ticket that mentions the Pune office days and the Teams preference. The IT team needs both, and the agent already knew them.
What I Got
The agent called create_ticket with these arguments:
{
"type": "Incident",
"title": "Office Wi-Fi keeps dropping on laptop",
"description": "Office Wi-Fi connection repeatedly drops on Surface Laptop 7 (DW-LT-1001), running Windows 11 Enterprise. The employee already reselected Dewiride-Corp, forgot and reconnected to the network, and restarted the laptop. Issue persists at the office."
}
The laptop and the troubleshooting were there. The Pune office and Teams weren't.

What I Checked
Whether the memories reached the model. In another new conversation I asked What do you remember about me? The answer:
I remember:
- You work from the Pune office on Tuesdays and Thursdays.
- You prefer ticket updates on Microsoft Teams rather than email.
So the context provider worked, and the model could read the list.
Where the list sits in the request. Agent Framework describes AIContext.Instructions as additional instructions to provide to the AI model for the current invocation. In a later run, I asked Microsoft Foundry for the stored response: its instructions ended with the provider's list, right after the agent's own instructions. The memories travel in the same place as the ticket rule.
What the ticket rule allows. It names two sources for a ticket's details: what the employee told you and what your tools found. A memory is neither: the employee said it in another conversation, and no tool returned it. The next sentence, Never invent details., makes the model even more careful with anything outside those two sources.
Why It Happens
The model follows its instructions, and the ticket rule was more specific than the memory: it said exactly where a ticket's details come from. The agent used the memories when nothing narrower applied, such as when asked what it remembers, and left them out where a rule listed the allowed sources. The rule was written before the agent had a memory, and nobody had added memories to its list.
The Fix
Name memories as a source in the ticket rule:
- Write the ticket's title and description from what the employee told you, what you remember about them
and what your tools found. Never invent details. After raising it, give the employee the new ticket's number.
And say, where the instructions describe memories, what they're for in a ticket:
- You remember things about the employee from earlier conversations, and each request tells you what they are.
Use them when they help, so the employee doesn't have to repeat themselves. When you raise a ticket, include
what you remember that helps the IT team, such as where the employee works or how they like to be contacted.
After the Fix
I restarted the API and repeated the two messages in a new conversation:
{
"type": "Incident",
"title": "Office Wi-Fi keeps dropping on laptop",
"description": "Office Wi-Fi repeatedly disconnects on assigned Surface Laptop 7 (DW-LT-1001), running Windows 11 Enterprise. Employee already tried reconnecting to Dewiride-Corp, forgetting and reconnecting to the network, and restarting the laptop. The issue occurs at the office. Employee works from the Pune office Tuesdays and Thursdays and prefers ticket updates on Microsoft Teams."
}

The description now ends with both memories. Every ticket I raised after the fix included them.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Adding a memory to an agent without reading its existing rules | Rules that list their sources leave the memories out | Look for rules that say where information comes from, and add memories to them |
| Checking only that the agent can list its memories | The memories reach the model but aren't used where it matters | Check the tool calls where you expect the memories |
| Removing Never invent details to make the memories appear | The agent may make up details in tickets | Keep it, and name memories as a source |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The agent lists its memories when asked but leaves them out of tool arguments | A rule names the allowed sources for those arguments, and memories aren't one of them | Name memories as a source |
| The agent doesn't know its memories even when asked | The memories aren't in the request | Check that the context provider is in AIContextProviders and returns Instructions |
FAQ
Why not put the memories in the tool's description instead?
A tool's description says what the tool does and when to call it. The memories belong to the employee, not to one tool, and other answers use them too. The instructions are the one place that covers every answer and every tool.
Does the model see the memories in every run?
Yes. The context provider adds the list at the start of every run, so a memory saved in one conversation is in the next.
Conclusion
The agent had its memories, but a ticket rule written earlier named the only places a ticket's details may come from: the conversation and the tools. Adding what you remember about them to that rule, and saying in the memory section what memories are for in a ticket, put the employee's office days and contact preference into every ticket.
Additional Resources
- Context Providers — how a context provider adds instructions, messages and tools to a run.
- AIContext.Instructions — the instructions a context provider adds for one invocation.
