Aerospike-based checkpoint saver for LangGraph
Project description
LangGraph Checkpoint Aerospike
Store LangGraph checkpoints in Aerospike using the provided AerospikeSaver.
Installation
pip install -U langgraph-checkpoint-aerospike
Usage
- Bring up Aerospike locally using prebuilt Aerospike Docker Image:
docker run -d --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server
-
Point the saver at your cluster (Default):
AEROSPIKE_HOST=127.0.0.1AEROSPIKE_PORT=3000AEROSPIKE_NAMESPACE=test
-
Build a LangGraph graph and compile it with the saver as the checkpointer. Passing the same
thread_idon a later run resumes from the persisted state:from typing import Annotated, TypedDict import aerospike from langgraph.graph import START, END, StateGraph from langgraph.graph.message import add_messages from langchain_core.messages import HumanMessage from langgraph.checkpoint.aerospike import AerospikeSaver # 1. Connect to Aerospike and build the checkpointer. client = aerospike.client({"hosts": [("127.0.0.1", 3000)]}).connect() checkpointer = AerospikeSaver(client=client, namespace="test") # 2. Define a minimal LangGraph graph. class State(TypedDict): messages: Annotated[list, add_messages] def chatbot(state: State) -> State: last = state["messages"][-1].content return {"messages": [("assistant", f"You said: {last}")]} builder = StateGraph(State) builder.add_node("chatbot", chatbot) builder.add_edge(START, "chatbot") builder.add_edge("chatbot", END) # 3. Compile with the Aerospike checkpointer. graph = builder.compile(checkpointer=checkpointer) # 4. Each thread_id is a separate, persisted conversation. config = {"configurable": {"thread_id": "demo"}} graph.invoke({"messages": [HumanMessage("hello")]}, config) # 5. A later call with the same thread_id resumes from the saved state, # even in a brand-new process — the history lives in Aerospike. result = graph.invoke({"messages": [HumanMessage("are you still there?")]}, config) for message in result["messages"]: message.pretty_print()
You can also inspect persisted checkpoints directly through the saver, e.g.
checkpointer.get_tuple(config) for the latest checkpoint or
checkpointer.list(config) to walk a thread's history.
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_aerospike-0.3.0.tar.gz.
File metadata
- Download URL: langgraph_checkpoint_aerospike-0.3.0.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3308f398329793b2634fea7a4c9a16404a21ba3d0b8ba3a162e4dd3bacf871c
|
|
| MD5 |
2b1690ddeffe12fe35266051071f0ba2
|
|
| BLAKE2b-256 |
522c014e61d563f5badd5dcc5f13d6f0c37a859980ed3d42cd9a03a0b4b12117
|
Provenance
The following attestation bundles were made for langgraph_checkpoint_aerospike-0.3.0.tar.gz:
Publisher:
release-checkpoint.yml on aerospike/langgraph-aerospike
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langgraph_checkpoint_aerospike-0.3.0.tar.gz -
Subject digest:
d3308f398329793b2634fea7a4c9a16404a21ba3d0b8ba3a162e4dd3bacf871c - Sigstore transparency entry: 2119010255
- Sigstore integration time:
-
Permalink:
aerospike/langgraph-aerospike@baa8a58d9de991d5c08fa7148334bb93b43c02e7 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/aerospike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-checkpoint.yml@baa8a58d9de991d5c08fa7148334bb93b43c02e7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langgraph_checkpoint_aerospike-0.3.0-py3-none-any.whl.
File metadata
- Download URL: langgraph_checkpoint_aerospike-0.3.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69e45b7498e1d8ed083477b193d04640047376695e914174eb42378147ef06f8
|
|
| MD5 |
eaef1f29eb47bec5f2d1084d60474b1b
|
|
| BLAKE2b-256 |
127d162e110dad18385fe11842496c1b2e2835bfc8fbf8e23804b9f9313a973d
|
Provenance
The following attestation bundles were made for langgraph_checkpoint_aerospike-0.3.0-py3-none-any.whl:
Publisher:
release-checkpoint.yml on aerospike/langgraph-aerospike
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langgraph_checkpoint_aerospike-0.3.0-py3-none-any.whl -
Subject digest:
69e45b7498e1d8ed083477b193d04640047376695e914174eb42378147ef06f8 - Sigstore transparency entry: 2119010307
- Sigstore integration time:
-
Permalink:
aerospike/langgraph-aerospike@baa8a58d9de991d5c08fa7148334bb93b43c02e7 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/aerospike
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-checkpoint.yml@baa8a58d9de991d5c08fa7148334bb93b43c02e7 -
Trigger Event:
push
-
Statement type: