KurrentDB checkpoint implementation for LangGraph
Project description
LangGraph Checkpoint KurrentDB: Experimental
KurrentDB checkpoint implementation for LangGraph. This is an experimental release and not be ready to be used in production, yet. This project is intended to show that KurrentDB has the right native capabilities to be used as a checkpointing mechanism for LangGraph.
If you would like to see a production version of the checkpointer, feel free to upvote this issue: https://github.com/kurrent-io/langgraph-checkpoint-kurrentdb/issues/3
Overview
LangGraph is an orchestration framework for complex agentic systems. This package provides a checkpointing mechanism for LangGraph using KurrentDB. We use KurrentDB's event sourcing capabilities to store the state of the LangGraph execution. The versioning of state is mapped to KurrentDB's native event versioning and every the channel value is kept into its own stream. Every step in the thread then only has a pointer (channel value name and version) to the actual channel value (event).
Installation
pip install langgraph-checkpoint-kurrentdb
Or using Poetry:
poetry add langgraph-checkpoint-kurrentdb
Usage
Setting up the KurrentDB checkpointer for your LangGraph:
from langgraph.graph import StateGraph
from langgraph_checkpoint_kurrentdb import KurrentDBSaver
from kurrentdbclient import KurrentDBClient
# Initialize the KurrentDB client
client = KurrentDBClient(uri="esdb://localhost:2113?Tls=false")
# Create the KurrentDB checkpoint saver
saver = KurrentDBSaver(client)
# Create your LangGraph
builder = StateGraph(int)
builder.add_node("add_one", lambda x: x + 1)
builder.set_entry_point("add_one")
builder.set_finish_point("add_one")
# Compile with the KurrentDB checkpointer
graph = builder.compile(checkpointer=saver)
# Use thread ID to identify this execution
config = {"configurable": {"thread_id": "example-thread-1", "checkpoint_ns": ""}}
result = graph.invoke(42, config)
# Later, retrieve the state
state = graph.get_state(config)
Tests
poetry run pytest --cov --cov-report=term-missing
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langgraph_checkpoint_kurrentdb-0.1.0.tar.gz.
File metadata
- Download URL: langgraph_checkpoint_kurrentdb-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.9 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c89b5c77d50e4bad2c3e9006ba4572f994d61757d1e271f49651cfbce84398e
|
|
| MD5 |
0a1b967336deff789da64c51c162df8f
|
|
| BLAKE2b-256 |
dc79173fd70fb452c03669957f7e11f9de65895205559fdd8ee67dec7d2caea2
|
File details
Details for the file langgraph_checkpoint_kurrentdb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langgraph_checkpoint_kurrentdb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.9 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85bc83e19dcdf49ce28d3debf00268a7465c1cc58571e71af85434580ad353ee
|
|
| MD5 |
cdc737bfa65c0b68a729eb76ce790fe4
|
|
| BLAKE2b-256 |
186870401baab68d8cde4a15463a7d575bcc40c97f1196062e3e6adbbbd2be2e
|