Skip to main content

langgraph-store-typedb

A LangGraph BaseStore implementation backed by TypeDB 3.x.

Stores LangGraph memory items as opaque JSON blobs keyed by (namespace, key).

Install

pip install langgraph-store-typedb

Requires Python 3.11+ and a TypeDB 3.8+ server.

Quickstart

from typedb.driver import TypeDB, Credentials, DriverOptions, DriverTlsConfig
from langgraph_store_typedb import TypeDBStore

driver = TypeDB.driver(
    "localhost:1729",
    Credentials("admin", "password"),
    DriverOptions(DriverTlsConfig.disabled()),
)
store = TypeDBStore(driver, database="langgraph_memory")
store.ensure_database()
store.ensure_schema()

store.put(("users", "alice"), "pref-1", {"theme": "dark"})
item = store.get(("users", "alice"), "pref-1")
print(item.value)  # {'theme': 'dark'}

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

Schema

Memory items are stored as a single entity type memory with attributes namespace_path (@key), ns_depth, mem_key, value_json, created_at, updated_at. See src/langgraph_store_typedb/resources/schema.tql.

namespace_path joins the namespace tuple with : and separates the key with / — e.g. ("users", "alice") + key pref-1 is stored as users:alice/pref-1. Namespace components and keys must not contain : or /.

Async

from langgraph_store_typedb import AsyncTypeDBStore, TypeDBStore

sync = TypeDBStore(driver, database="langgraph_memory")
sync.ensure_database()
sync.ensure_schema()
astore = AsyncTypeDBStore(sync)

await astore.aput(("users", "alice"), "pref-1", {"theme": "dark"})

AsyncTypeDBStore is a thin wrapper that offloads each operation to a thread via asyncio.to_thread. The underlying TypeDB Python driver is synchronous-only.

Limitations (v0.1)

Feature Status
search(query=...) (semantic) Not supported — raises NotImplementedError
index= on put Only None/False accepted; non-False raises NotImplementedError
ttl on put Silently ignored
filter= operators ($gt, $contains, …) Top-level exact match only
Wildcard * in list_namespaces paths Raises NotImplementedError
Atomic batch across ops Each op runs in its own transaction

License

MIT

Metadata

Release files for langgraph-store-typedb 0.1.0

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-store-typedb 0.1.0
File Interpreter ABI Platform
langgraph_store_typedb-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / langgraph_store_typedb-0.1.0-py3-none-any.whl

Download URL langgraph_store_typedb-0.1.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48a46228ee294d52b69b356d27e907c176a836966b7a59fbc0da2b9950ad2c86
BLAKE2b-256 checksum
How to use checksums
2fc3455ac5bef8df56582dd6c94123ac074b431301a60ace1b90cc8e691f1808
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.1.0 This release

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