Primitives
- Thread => This is the current conversation
- langraph accepts the config, As part of that config we can pass thread id
- To remember the conversations with in particular thread we use short term memory.
-
To save the state at every node with in a thread langgraph has checkpointer
- prompt
Explain configurable structure in langgraph
- Adding memory to conversations
from langgraph.checkpoint.memory import InMemorySaver
memory_enabled_graph = state_learning_graph.compile(
checkpointer=InMemorySaver()
)
- Creating sessions (threads)
user1_config = {"configurable": {"thread_id": "1"}}
user2_config = {"configurable": {"thread_id": "2"}}
-
Refer Here for the changes done
-
Create a simple graph, use checkpointer with inmemory and create two session scenario
