Reload the AI context from the previous session #5356
Unanswered
Sachin-Nand
asked this question in
Q&A
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was going through this example : https://github.com/microsoft/agent-framework/blob/main/dotnet/samples/02-agents/Agents/Agent_Step17_AdditionalAIContext/Program.cs
I understand what the code is trying to do. My question is how do I store the AIContext ? I am aware that there is a StoreAIContextAsync method for AIContextProvider.
I am trying to understand the difference between StoreChatHistoryAsync from ChatHistoryProvider and StoreAIContextAsync from AIContextProvider.
In the code that I referenced earlier had the following user chat
Console.WriteLine(await agent.RunAsync("I need to pick up milk from the supermarket.", session) + "\n");
Console.WriteLine(await agent.RunAsync("I need to take Sally for soccer practice.", session) + "\n");
Console.WriteLine(await agent.RunAsync("I need to make a dentist appointment for Jimmy.", session) + "\n");
Console.WriteLine(await agent.RunAsync("I've taken Sally to soccer practice.", session) + "\n");
I then saved the entire conversation to a .json file through ChatHistoryProvider , then loaded it into a new session and prompted the model.
"Did I pick up milk from the supermarket and took Sally to soccer practice ? "
The response was, both the task were complete which is incorrect, as only “taking Sally to soccer practice” was done. The reason both tasks were marked as complete was because the to-do list was empty as it was a new session. The reloaded conversation was ignored.
I am trying to understand if there is a way that the AIContext can be made aware across sessions, the way it is possible through ChatHistoryProvider.
Beta Was this translation helpful? Give feedback.
All reactions