Skip to content

Commit 9ed1f37

Browse files
author
ajosh0504
committed
Adding notes about MongoDB checkpointer
1 parent d34ae18 commit 9ed1f37

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/50-adding-memory/1-lecture-notes.mdx

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,17 @@
55
Checkpoints in LangGraph are a snapshot of the graph state. This is how AI applications built using LangGraph persist short-term and long-term memory.
66

77
## Thread IDs
8-
Thread IDs are unique IDs assigned to memory checkpoints in LangGraph, allowing it to distinguish between conversation threads, facilitate human-in-the loop workflows and allow users to review and debug graph executions.
8+
9+
Thread IDs are unique IDs assigned to memory checkpoints in LangGraph, allowing it to distinguish between conversation threads, facilitate human-in-the loop workflows and allow users to review and debug graph executions.
10+
11+
## Persisting checkpoints in MongoDB
12+
13+
In this lab, you will persist the short-term memory of the agent in MongoDB. To do this, compile the agent's graph with the MongoDB checkpointer available in our LangGraph integration as follows:
14+
15+
```
16+
from langgraph.checkpoint.mongodb import MongoDBSaver
17+
checkpointer = MongoDBSaver(mongodb_client)
18+
app = graph.compile(checkpointer=checkpointer)
19+
```
20+
21+
Refer to [this](https://langchain-ai.github.io/langgraph/how-tos/persistence_mongodb/) documentation to learn more about the MongoDB checkpointer for LangGraph.

0 commit comments

Comments
 (0)