Skip to main content

langgraph-checkpoint-typedb

A LangGraph BaseCheckpointSaver implementation backed by TypeDB 3.x.

Persists graph state across invocations using TypeDB as the backing store. Mirrors the schema shape of langgraph-checkpoint-postgres (checkpoints, blobs, writes) translated to TypeDB entities.

Install

pip install langgraph-checkpoint-typedb

Requires Python 3.11+ and a TypeDB 3.8+ server.

Quickstart

from typedb.driver import TypeDB, Credentials, DriverOptions, DriverTlsConfig
from langgraph_checkpoint_typedb import TypeDBSaver

driver = TypeDB.driver(
    "localhost:1729",
    Credentials("admin", "password"),
    DriverOptions(DriverTlsConfig.disabled()),
)
saver = TypeDBSaver(driver, database="langgraph_checkpoints")
saver.ensure_database()
saver.ensure_schema()

graph = builder.compile(checkpointer=saver)
graph.invoke({"input": "hi"}, config={"configurable": {"thread_id": "u-1"}})

The saver does not own the driver lifecycle — call driver.close() yourself when done.

Schema

Three entity types:

  • checkpoint — one per (thread_id, checkpoint_ns, checkpoint_id).
  • checkpoint_blob — channel values keyed by (thread_id, checkpoint_ns, channel, version).
  • checkpoint_write — intermediate writes keyed by (thread_id, checkpoint_ns, checkpoint_id, task_id, idx).

Composite keys are encoded into a single @key string attribute using ASCII Unit Separator (\x1f) as a delimiter. Binary blobs (from LangGraph's JsonPlusSerializer) are base64-encoded — TypeDB 3.x has no native bytes attribute type.

See src/langgraph_checkpoint_typedb/resources/schema.tql.

Async

from langgraph_checkpoint_typedb import AsyncTypeDBSaver, TypeDBSaver

sync = TypeDBSaver(driver, database="langgraph_checkpoints")
sync.ensure_database()
sync.ensure_schema()
asaver = AsyncTypeDBSaver(sync)

graph = builder.compile(checkpointer=asaver)
await graph.ainvoke({"input": "hi"}, config={"configurable": {"thread_id": "u-1"}})

AsyncTypeDBSaver offloads each operation to a thread via asyncio.to_thread. The underlying TypeDB Python driver is synchronous-only.

Limitations

Feature Status
get_delta_channel_history Raises NotImplementedError
prune strategies keep_latest only; others raise NotImplementedError
delete_for_runs Implemented; orphan blob cleanup deferred
list(filter=...) operators Top-level exact match only
Server-side limit pushdown Applied client-side
Atomic batching across put + put_writes Each op runs in its own transaction

License

MIT

Metadata

Release files for langgraph-checkpoint-typedb 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-checkpoint-typedb 0.0.2
File Interpreter ABI Platform
langgraph_checkpoint_typedb-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / langgraph_checkpoint_typedb-0.0.2-py3-none-any.whl

Download URL langgraph_checkpoint_typedb-0.0.2-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc7cd996c1f0f52510ea48ac61b55181acdf36a4172fc1a2c2c480aec4d6e6ce
BLAKE2b-256 checksum
How to use checksums
c34d4494a8ca44ab509ca6a344e667a34957e9ddc776a14294ec9b46cfd67cec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page