How the ReAct Memory Agent works
mainThe agent follows a ReAct (Reasoning and Acting) pattern to manage long-term memory:
- Memory Retrieval: The chatbot reads from the graph's
Storeto list and access previously extracted memories. - Memory Storage: When the agent decides to call a tool to save information, LangGraph routes the request to the
store_memorynode, which persists the data to theStore. - Scoping: Memories are scoped to a configurable
user_id, enabling the agent to learn user preferences across different conversational threads.