Skip to main content

langgraph-singlestore

SingleStore-backed persistence for LangGraph: graph checkpointing (BaseCheckpointSaver) and long-term memory (BaseStore).

Status

All public classes are re-exported from the top-level langgraph_singlestore package for convenience:

from langgraph_singlestore import (
    AsyncSingleStoreSaver,
    AsyncSingleStoreStore,
    SingleStoreIndexConfig,
    SingleStoreSaver,
    SingleStoreStore,
)
Component Status
langgraph_singlestore.SingleStoreSaver Implemented — get_tuple, list, put, put_writes, migrations.
langgraph_singlestore.AsyncSingleStoreSaver Implemented — async wrapper over the sync saver via the default executor.
langgraph_singlestore.SingleStoreStore Implemented — CRUD, TTL sweeper, namespace listing, optional vector search.
langgraph_singlestore.AsyncSingleStoreStore Implemented — async wrapper over the sync store via the default executor.

Installation

pip install langgraph-singlestore

Store quickstart

from langgraph_singlestore import SingleStoreStore

store = SingleStoreStore(
    host="127.0.0.1",
    port=3306,
    user="root",
    password="",
    database="langgraph",
)
store.setup()  # idempotent; applies pending migrations

store.put(("users", "u1"), key="profile", value={"name": "Ada"})
item = store.get(("users", "u1"), key="profile")

Callers may pass any one of:

  • an existing singlestoredb.Connection via connection=...,
  • an existing SQLAlchemy Pool via connection_pool=..., or
  • plain connection kwargs (host, user, ...) — an internal QueueConnectionPool is built lazily.

connection and connection_pool are mutually exclusive.

TTL

Pass a TTLConfig and start the background sweeper to expire items:

from langgraph.store.base import TTLConfig

store = SingleStoreStore(ttl_config=TTLConfig(...), **conn_kwargs)
store.setup()
store.start_ttl_sweeper()
# ...
store.stop_ttl_sweeper()

Pass an index config with dims, embed, and an ann_index_config to enable semantic search():

from langgraph_singlestore import SingleStoreStore
from singlestore_langchain_core import ANNIndexConfig

store = SingleStoreStore(
    index={
        "dims": 1536,
        "embed": my_embeddings,
        "ann_index_config": ANNIndexConfig(...),
    },
    **conn_kwargs,
)
store.setup()
results = store.search(("docs",), query="what is singlestore?")

Async

AsyncSingleStoreStore exposes the same constructor and shares the sync class's state; async methods delegate to the sync implementation via the default executor.

from langgraph_singlestore import AsyncSingleStoreStore

store = AsyncSingleStoreStore(**conn_kwargs)
await store.asetup()
await store.aput(("users", "u1"), key="profile", value={"name": "Ada"})

Checkpoint saver quickstart

SingleStoreSaver persists LangGraph checkpoints, pending writes, and blobs to SingleStore. It implements the full BaseCheckpointSaver interface (get_tuple, list, put, put_writes) and their async counterparts (aget_tuple, alist, aput, aput_writes).

from langgraph_singlestore import SingleStoreSaver

saver = SingleStoreSaver(
    host="127.0.0.1",
    port=3306,
    user="root",
    password="",
    database="langgraph",
)
saver.setup()  # idempotent; applies pending migrations

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

saver.close()

Or build one from a connection URL:

saver = SingleStoreSaver.from_conn_string(
    "user:password@127.0.0.1:3306/langgraph"
)
saver.setup()

Like SingleStoreStore, the saver accepts any one of:

  • an existing singlestoredb.Connection via connection=...,
  • an existing SQLAlchemy Pool via connection_pool=..., or
  • plain connection kwargs (host, user, ...) — an internal QueueConnectionPool is built lazily from pool_size, max_overflow, and timeout.

connection and connection_pool are mutually exclusive. When you pass your own connection, the saver never closes it — lifecycle stays with the caller.

Async

AsyncSingleStoreSaver shares the sync class’s constructor and state. Every a* method dispatches to the default executor, so the same SingleStore connection pool serves both sync and async callers.

from langgraph_singlestore import AsyncSingleStoreSaver

saver = AsyncSingleStoreSaver.from_conn_string(
    "user:password@127.0.0.1:3306/langgraph"
)
await saver.asetup()
try:
    graph = builder.compile(checkpointer=saver)
    await graph.ainvoke(
        {"input": "hi"},
        config={"configurable": {"thread_id": "t1"}},
    )
finally:
    await saver.aclose()

The async saver adds asetup() and aclose() helpers for non-blocking lifecycle management; all read/write methods are inherited from SingleStoreSaver.

Layout

The top-level langgraph_singlestore package re-exports every public class. Under the hood, implementations live in langgraph_singlestore.checkpoint (the checkpoint saver) and langgraph_singlestore.store (the long-term memory store). Shared connection, filter, and index helpers live in singlestore-langchain-core.

Development

make lint
make test                # unit tests, sockets disabled
make integration_tests   # boots a SingleStore container via singlestoredb

Release files for langgraph-singlestore 1.0.0

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

Source distribution (sdist)

Source distribution for langgraph-singlestore 1.0.0
File Size Uploaded
langgraph_singlestore-1.0.0.tar.gz 28.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-singlestore 1.0.0
File Interpreter ABI Platform
langgraph_singlestore-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.7 kB

Release files / langgraph_singlestore-1.0.0.tar.gz

Download URL langgraph_singlestore-1.0.0.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d91ee387879a3131fa115b333ba95b0d368e05e0aa1b823479950e70f0ac9c65
BLAKE2b-256 checksum
How to use checksums
05f9a40836838ddec794e0bb8229227f74c2f8b3da8379857e723c75606d3793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.11.16 Linux/6.17.0-1022-azure

Release files / langgraph_singlestore-1.0.0-py3-none-any.whl

Download URL langgraph_singlestore-1.0.0-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36d7dafc7279317fb7b3d7f84c87d9752ef1757d7b87ef402682a57b8467d1ec
BLAKE2b-256 checksum
How to use checksums
f27ba0d3946549e03b9ad250bfa925a266a068bcf13e9e85d16641074ee705a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.11.16 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

0.1.0

2 release files

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