Skip to content

Commit cd5ffd2

Browse files
Add information about setup for persistence (#1759)
## Overview We currently say you have to call `setup` for a saver or store but don't specify what that does or best practices for when to call it. ## Type of change **Type:** Update existing documentation ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x] I have read the [contributing guidelines](README.md) - [x] I have tested my changes locally using `docs dev` - [x] I have used **root relative** paths for internal links --------- Co-authored-by: Lauren Hirata Singh <lauren@langchain.dev>
1 parent 5b5990b commit cd5ffd2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/oss/langgraph/add-memory.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,3 +2141,12 @@ await checkpointer.deleteThread(threadId);
21412141

21422142
**LangMem** is a LangChain-maintained library that offers tools for managing long-term memories in your agent. See the [LangMem documentation](https://langchain-ai.github.io/langmem/) for usage examples.
21432143
:::
2144+
2145+
## Database management
2146+
2147+
If you are using any database-backed persistence implementation (such as Postgres or Redis) to store short and/or long-term memory, you will need to run migrations to set up the required schema before you can use it with your database.
2148+
2149+
By convention, most database-specific libraries define a `setup()` method on the checkpointer or store instance that runs the required migrations. However, you should check with your specific implementation of @[`BaseCheckpointSaver`] or @[`BaseStore`] to confirm the exact method name and usage.
2150+
2151+
We recommend running migrations as a dedicated deployment step, or you can ensure they're run as part of server startup.
2152+

src/oss/langgraph/persistence.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ LangGraph has a built-in persistence layer, implemented through checkpointers. W
99
![Checkpoints](/oss/images/checkpoints.jpg)
1010

1111
<Info>
12-
**LangGraph API handles checkpointing automatically**
13-
When using the LangGraph API, you don't need to implement or configure checkpointers manually. The API handles all persistence infrastructure for you behind the scenes.
12+
**Agent Server handles checkpointing automatically**
13+
When using the [Agent Server](/langsmith/agent-server), you don't need to implement or configure checkpointers manually. The server handles all persistence infrastructure for you behind the scenes.
1414
</Info>
1515

1616
## Threads

0 commit comments

Comments
 (0)