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.1

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.1
File Size Uploaded
langgraph_singlestore-1.0.1.tar.gz 28.9 kB Details

Built distribution (wheel)

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

Total release size: 60.7 kB

Release files / langgraph_singlestore-1.0.1.tar.gz

Download URL langgraph_singlestore-1.0.1.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e9384a36df048d4c22559a79bc50ec42ee0017c7399b4626a76f0dc3b227f969
BLAKE2b-256 checksum
How to use checksums
c3e5da12ba87c6d121b2f47be2eedb9b22b6363665e1dd974cdbc06b44d90220
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.1-py3-none-any.whl

Download URL langgraph_singlestore-1.0.1-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12b1364a95fd9d5ccdbd71b40570767c6ad5ecebb6eba501b23331b36c93711b
BLAKE2b-256 checksum
How to use checksums
39ad36b2e5eeb4341158628960565e50076f248eda25811e8b5d6116ef00758a
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

This release

1.0.1 This release

2 release files

1.0.0

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