Skip to content
Discussion options

You must be logged in to vote

@aidin1324 this should not be done at the checkpointer level. you can change the reducer in your agent to always keep at most last N messages if you want the messages to be updated in the graph state (e.g. update add_messages in your state schema implementation https://github.com/langchain-ai/langgraph/blob/main/libs/langgraph/langgraph/graph/message.py#L266).

you would just need to be careful to make sure the resulting message history is valid

see more on reducers here https://langchain-ai.github.io/langgraph/concepts/low_level/#reducers

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tchiayan
Comment options

@tingyiy
Comment options

Answer selected by aidin1324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants