Skip to content

Conversation

@rogerbarreto
Copy link
Member

Motivation and Context

Add Azure AI Foundry Memory Context Provider

Introduces Microsoft.Agents.AI.FoundryMemory, a new context provider package that enables agents to store
and retrieve long-term memories using 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
  • EnsureMemoryStoreCreatedAsync() to create memory stores with specified chat and embedding models
  • EnsureStoredMemoriesDeletedAsync() to clear memories for a scope
  • WhenUpdatesCompletedAsync() to poll pending memory updates in parallel until completion
  • Session serialization/deserialization support for state persistence
  • Configurable options for max memories, update delay, and context prompt
  • Sample application demonstrating end-to-end usage
  • Unit tests for constructor validation and serialization

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

…eation

- Remove IFoundryMemoryOperations interface (was only for test mocking)
- Remove AIProjectClientMemoryOperations wrapper class
- Provider now directly uses AIProjectClient with internal extension methods
- Extension methods return actual response models instead of extracted values
- Remove WaitForUpdateCompletionAsync from provider (sample uses delay)
- Simplify EnsureMemoryStoreCreatedAsync to return Task instead of Task<bool>
- Add memory store creation with chat_model and embedding_model
- Add UpdateMemoriesResponse with SupersededBy and Error fields
- Simplify unit tests to focus on constructor validation and serialization
- Update sample to use simple delay for memory processing wait
@rogerbarreto rogerbarreto self-assigned this Jan 30, 2026
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation .NET labels Jan 30, 2026
@github-actions github-actions bot changed the title .Net: Add Foundry Memory Context Provider [WIP] .NET: Add Foundry Memory Context Provider [WIP] Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants