How to add persistence (“memory”) to your graph

Many AI applications need memory to share context across multiple interactions. In LangGraph4j, memory is provided for any StateGraph through Checkpointers.

When creating any LangGraph workflow, you can set them up to persist their state by doing using the following:

  1. A Checkpointer, such as the MemorySaver
  2. Pass your Checkpointers in configuration when compiling the graph.