LangChain has announced the stable release of LangGraph v0.2, and has announced an important update by introducing a new checkpointer library. According to the LangChain blog, this library aims to improve the resiliency and functionality of large-scale language model (LLM) applications by simplifying the creation and customization of checkpointers.
Why LangGraph v0.2 was developed
A core feature of LangGraph is its built-in persistence layer implemented via checkpointers. These checkpointers save the state of the graph at each step, enabling features such as session memory, error recovery, human-participation capabilities, and time travel. LangGraph was designed from the beginning to be database-agnostic, allowing users to implement their own checkpointer adapters.
However, there was no clear blueprint for creating custom checkpointers for popular databases like Postgres, Redis, and MongoDB. LangGraph v0.2 bridges this gap by providing a dedicated checkpointer library.
New checkpointer library in LangGraph v0.2
The new release includes a collection of checkpointer libraries that make it easier to create and customize checkpointers.
langgraph_checkpoint
: Basic interface for checkpoint saver and serialization/deserialization.langgraph_checkpoint_sqlite
: A SQLite-based checkpointer suitable for local workflows and experiments.langgraph_checkpoint_postgres
: An optimized Postgres checkpointer for production environments, now open sourced for community use.
These implementations can be used interchangeably, allowing users to tailor their applications to their specific needs.
LangGraph Postgres Checkpointer for Production
that langgraph_checkpoint_postgres
The implementation serves as a blueprint for creating an optimized production-ready checkpoint. It includes several optimizations, including using Postgres pipeline mode to reduce database roundtrips and storing each channel value separately to minimize storage requirements.
Getting started with LangGraph v0.2
To get started, users can get the necessary checkpointer interfaces and implementations using:
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.memory import MemorySaver
from langgraph.checkpoint.sqlite import SqliteSaver
from langgraph.checkpoint.postgres import PostgresSaver
SQLite and Postgres checkpointers require separate installation via: pip install langgraph-checkpoint-sqlite
and pip install langgraph-checkpoint-postgres
Each LangGraph checkpointing library follows semantic versioning, so any significant changes in the main library will result in a corresponding major version update of the checkpointing library.
Running Agents at Scale with LangGraph Cloud
LangGraph v0.2 also introduces LangGraph Cloud, a runtime environment designed to deploy large-scale agents. LangGraph Cloud manages job queues, servers, and handles concurrent users and large data states, including a powerful Postgres checkpointer. It supports real-world interaction patterns such as double-text, asynchronous background tasks, and cron jobs.
LangGraph Studio, a desktop app for visualizing and debugging agent trajectories, is now available to all LangSmith users. LangGraph Cloud is currently in open beta for Plus and Enterprise plan users.
Additional changes in LangGraph v0.2
The latest version also includes several important changes and deprecations.
Important changes
- Change name
thread_ts
andparent_ts
tocheckpoint_id
andparent_checkpoint_id
. - Because we used a namespace package, re-exporting imports is no longer possible.
- SQLite checkpointers have been moved to a separate library.
Discontinued
- eliminate
langgraph.prebuilt.chat_agent_executor.create_function_calling_executor
. - eliminate
langgraph.prebuilt.agent_executor
.
conclusion
LangChain would like to thank the community for their feedback and support. With LangGraph v0.2, users can expect easier customization and maintenance of checkpointer implementations, paving the way for more resilient and feature-rich LLM applications.
Image source: Shutterstock