how to retrieve the chat history in Langgraph using Checkpointer? #1184
Unanswered
jayashriv710
asked this question in
Q&A
Replies: 2 comments 4 replies
-
MemorySaver does not persist over program runs |
Beta Was this translation helpful? Give feedback.
2 replies
-
Some things to check:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm having an issue with using TypedDict and Annotated for storing chat history in a class. When I define my AgentState class like this, I can retrieve the chat history without any problems:
However, when I extend the AgentState class to include more fields, I'm unable to retrieve the chat memory
In this case, I can no longer retrieve the chat memory. Does anyone know why this might be happening and how I can fix it? Any help would be greatly appreciated!
Here is the structure of my StateGraph:
And this is how I invoke my app:
The Issue
After some conversations, when I ask about which country I'm talking about, the model does not remember the country. Here's an example of such a scenario:
My Concern
It seems like the state, specifically the messages key, is not being maintained across different invocations.
Could you please provide insights on how to ensure that the state, especially messages, is preserved and utilized correctly across multiple interactions? Do I need to adjust the way I'm invoking the graph or modify the AgentState definition to maintain the context better?
Beta Was this translation helpful? Give feedback.
All reactions