Files
agent-framework/dotnet/samples/GettingStarted/AgentWithMemory
T
westey b12ff578af .NET: [BREAKING] Add session statebag to use for state storage instead of inside providers (#3737)
* Add a StateBag to AgentSession and pass Agent and AgentSession to AIContextProvider and ChatHistoryProviders

* Convert all AIContextProviders to use the statebag

* Update InMemoryChatHistoryProvider to use StateBag

* Update Comsos and Workflow ChatHistoryProviders

* Update 3rd party chat history storage sample.

* Remove serialize method from providers

* Replacing provider factories with properties

* Remove Providers from Session and flatten state bag serialization

* Update samples to use getservice on agent

* Updated additional session types to serialize statebag

* Fix regression

* Address PR comments

* Address PR comments.

* Fix formatting

* Fix unit tests

* Remove InMemoryAgentSession since it is not required anymore.

* Address PR comments

* Convert sessions for A2AAgent, ChatClientAgent, CopilotStudioAgent and GithubCopilotAgent to use regular json serialization.

* Fix durable agent session jso usgae

* Add jso to InMemory and Workflow ChatHistoryProviders

* Update InMemoryChatHistoryProvider to use an options class for it's many optional settings.

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address PR feedback

* Fix verification bug.

* Improve state bag thread safety

* Address PR comments and fix unit tests

* Address PR comments

* Fix unit test

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
b12ff578af ยท 2026-02-10 12:03:37 +00:00
History
..

Agent Framework Retrieval Augmented Generation (RAG)

These samples show how to create an agent with the Agent Framework that uses Memory to remember previous conversations or facts from previous conversations.

Sample Description
Chat History memory This sample demonstrates how to enable an agent to remember messages from previous conversations.
Memory with MemoryStore This sample demonstrates how to create and run an agent that uses the Mem0 service to extract and retrieve individual memories.
Custom Memory Implementation This sample demonstrates how to create a custom memory component and attach it to an agent.