LangGraph checkpointer backed by Typesense
Project description
🔍 typesense-langgraph-checkpointer
LangGraph checkpoint saver backed by Typesense — for Python and JavaScript/TypeScript.
Features · Installation · Quick Start · API Reference · Development · Contributing
✨ Features
- Drop-in LangGraph saver — implements the full
BaseCheckpointSaverinterface - Dual-language — first-class Python and TypeScript packages from the same repo
- Blazingly fast search — leverages Typesense's in-memory engine for sub-millisecond checkpoint retrieval
- Thread management — full CRUD for threads, checkpoints, and pending writes
- Automatic schema setup — call
setup()once and collections are created for you - Zero-config local dev — Docker Compose included for instant Typesense instance
📦 Installation
Python
pip install langgraph-checkpoint-typesense
JavaScript / TypeScript
npm install @typesense-langgraph/checkpoint
🚀 Quick Start
Python
import typesense
from langgraph_checkpoint_typesense import AsyncTypesenseSaver
# 1. Create the saver
saver = AsyncTypesenseSaver.from_config(
host="localhost",
port=8108,
api_key="your-api-key",
protocol="http",
)
# 2. Initialize collections (run once)
await saver.setup()
# 3. Use with any LangGraph graph
from langgraph.graph import StateGraph
graph = StateGraph(...)
# ... define your nodes & edges ...
app = graph.compile(checkpointer=saver)
# 4. Invoke with a thread
config = {"configurable": {"thread_id": "my-thread"}}
result = await app.ainvoke({"input": "hello"}, config)
JavaScript / TypeScript
import { TypesenseSaver } from "@typesense-langgraph/checkpoint";
// 1. Create the saver
const saver = TypesenseSaver.fromConfig({
host: "localhost",
port: 8108,
apiKey: "your-api-key",
protocol: "http",
});
// 2. Initialize collections (run once)
await saver.setup();
// 3. Use with any LangGraph graph
import { StateGraph } from "@langchain/langgraph";
const graph = new StateGraph(...)
// ... define your nodes & edges ...
.compile({ checkpointer: saver });
// 4. Invoke with a thread
const config = { configurable: { thread_id: "my-thread" } };
const result = await graph.invoke({ input: "hello" }, config);
⚙️ Configuration
| Parameter | Python | JS/TS | Default | Description |
|---|---|---|---|---|
| Host | host |
host |
localhost |
Typesense server hostname |
| Port | port |
port |
8108 |
Typesense API port |
| API Key | api_key |
apiKey |
— | Typesense API key |
| Protocol | protocol |
protocol |
http |
http or https |
| Timeout | connection_timeout_seconds |
connectionTimeoutSeconds |
5 |
Connection timeout in seconds |
You can also pass a pre-configured Typesense Client directly to the constructor.
📖 API Reference
Python — AsyncTypesenseSaver
| Method | Description |
|---|---|
from_config(cls, **kwargs) |
Create a saver from connection parameters |
setup() |
Create Typesense collections if they don't exist |
aget_tuple(config) |
Retrieve a checkpoint tuple |
aput(config, checkpoint, metadata, new_versions) |
Store a checkpoint |
aput_writes(config, writes, task_id) |
Store pending writes |
alist(config, *, filter, before, limit) |
List checkpoint tuples |
adelete_thread(thread_id) |
Delete all data for a thread |
JavaScript / TypeScript — TypesenseSaver
| Method | Description |
|---|---|
fromConfig(config) |
Create a saver from connection parameters |
setup() |
Create Typesense collections if they don't exist |
getTuple(config) |
Retrieve a checkpoint tuple |
put(config, checkpoint, metadata, newVersions) |
Store a checkpoint |
putWrites(config, writes, taskId) |
Store pending writes |
list(config, options?) |
Async-generator of checkpoint tuples |
deleteThread(threadId) |
Delete all data for a thread |
🏗️ Architecture
graph LR
A["LangGraph Runtime"] -->|checkpoint & writes| B["TypesenseSaver"]
B -->|upsert / search| C["Typesense"]
C --> D[("checkpoints collection")]
C --> E[("writes collection")]
B -->|getTuple / list| A
The saver manages two Typesense collections:
langgraph_checkpoints— stores serialized checkpoint state, metadata, and channel versionslanggraph_writes— stores pending writes keyed by(thread_id, checkpoint_id, task_id, idx)
Both collections are created automatically by setup() with optimized schemas and sorting fields.
🛠️ Development
Prerequisites
- Docker
- Python ≥ 3.9
- Node.js ≥ 22
Start Typesense
docker compose up -d
Default API key: test-api-key (override with TYPESENSE_API_KEY env var).
Python
cd python
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -v
JavaScript / TypeScript
cd js
npm ci
npm run build
npm test
🤝 Contributing
Contributions are welcome! Please read the Contributing Guide and the Code of Conduct before opening a PR.
📄 License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
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 typesense_langgraph_checkpointer-0.1.7.tar.gz.
File metadata
- Download URL: typesense_langgraph_checkpointer-0.1.7.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bdd08c148ab20d36523b725ce7c9b25cbbddddc5d6345eaae852723daf6be25
|
|
| MD5 |
e22feafc356b792e2ed87d28eda4d7d4
|
|
| BLAKE2b-256 |
31fd1d6f3e5b2c9e9e476c4160aaec2a8917e6b17337614969e3e6822d9da5d0
|
Provenance
The following attestation bundles were made for typesense_langgraph_checkpointer-0.1.7.tar.gz:
Publisher:
python.yml on assim98/typesense-langgraph-checkpointer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typesense_langgraph_checkpointer-0.1.7.tar.gz -
Subject digest:
1bdd08c148ab20d36523b725ce7c9b25cbbddddc5d6345eaae852723daf6be25 - Sigstore transparency entry: 1409353393
- Sigstore integration time:
-
Permalink:
assim98/typesense-langgraph-checkpointer@71f80bf751e6cfdde83a41c64c0a1f7aa5f34f34 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/assim98
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@71f80bf751e6cfdde83a41c64c0a1f7aa5f34f34 -
Trigger Event:
push
-
Statement type:
File details
Details for the file typesense_langgraph_checkpointer-0.1.7-py3-none-any.whl.
File metadata
- Download URL: typesense_langgraph_checkpointer-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4e8c3589d32eb81f96663f081e6539a6a12a88108990ed91a79340bef721df0
|
|
| MD5 |
15a6622888b5e0bcb67da7ecb5dd65b7
|
|
| BLAKE2b-256 |
286d237e81868c04f0db53fb0bdc1b460720f0a745d83a753fa1665abd03d7b6
|
Provenance
The following attestation bundles were made for typesense_langgraph_checkpointer-0.1.7-py3-none-any.whl:
Publisher:
python.yml on assim98/typesense-langgraph-checkpointer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typesense_langgraph_checkpointer-0.1.7-py3-none-any.whl -
Subject digest:
e4e8c3589d32eb81f96663f081e6539a6a12a88108990ed91a79340bef721df0 - Sigstore transparency entry: 1409353400
- Sigstore integration time:
-
Permalink:
assim98/typesense-langgraph-checkpointer@71f80bf751e6cfdde83a41c64c0a1f7aa5f34f34 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/assim98
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@71f80bf751e6cfdde83a41c64c0a1f7aa5f34f34 -
Trigger Event:
push
-
Statement type: