Part of #3440
Summary
Add an \AIContextProvider\ implementation for Azure AI Foundry Memory service, enabling agents to store and retrieve long-term memories automatically.
Implementation Details
New Package: Microsoft.Agents.AI.FoundryMemory
Introduces \FoundryMemoryProvider, a context provider that integrates with Azure AI Foundry's managed memory service. The provider automatically extracts memories from conversations and retrieves relevant memories to augment agent context on each invocation, following the same pattern established by the Mem0 provider.
Features
- FoundryMemoryProvider implementing \AIContextProvider\ with automatic memory extraction and retrieval
- Scoped memory storage by configurable identifier (e.g., user ID) for multi-tenant scenarios
- Memory store management:
- \EnsureMemoryStoreCreatedAsync()\ - Create memory stores with specified chat and embedding models
- \EnsureStoredMemoriesDeletedAsync()\ - Clear memories for a scope
- Async update polling: \WhenUpdatesCompletedAsync()\ polls pending memory updates in parallel until completion
- Session serialization/deserialization support for state persistence
- Configurable options: max memories, update delay, and context prompt
Configuration
| Option |
Default |
Description |
| \MemoryStoreName\ |
(required) |
Name of the memory store in Azure AI Foundry |
| \MaxMemories\ |
5 |
Maximum memories to retrieve per search |
| \UpdateDelay\ |
0 |
Delay in seconds before processing updates |
| \ContextPrompt\ |
(default) |
Custom prompt prefix for injected memories |
Environment Variables (Sample)
- \FOUNDRY_PROJECT_ENDPOINT\ - Azure AI Foundry project endpoint
- \FOUNDRY_PROJECT_MEMORY_STORE_NAME\ - Memory store name
- \FOUNDRY_PROJECT_MODEL\ - Chat model deployment name
- \FOUNDRY_PROJECT_EMBEDDING_MODEL\ - Embedding model deployment name
Deliverables
Part of #3440
Summary
Add an \AIContextProvider\ implementation for Azure AI Foundry Memory service, enabling agents to store and retrieve long-term memories automatically.
Implementation Details
New Package: Microsoft.Agents.AI.FoundryMemory
Introduces \FoundryMemoryProvider, a context provider that integrates with Azure AI Foundry's managed memory service. The provider automatically extracts memories from conversations and retrieves relevant memories to augment agent context on each invocation, following the same pattern established by the Mem0 provider.
Features
Configuration
Environment Variables (Sample)
Deliverables