Skip to main content

langgraph-store-dynamodb

Amazon DynamoDB long-term-memory store (BaseStore) for LangGraph — namespaced key/value agent memory with prefix search, Mongo-style filters, list_namespaces, sync + async, and native semantic search via DynamoDB vector search.

pip install langgraph-store-dynamodb

Usage

from langgraph_store_dynamodb import DynamoDBStore

store = DynamoDBStore(table_name="langgraph-store")          # table auto-created (PAY_PER_REQUEST)

store.put(("users", "1", "memories"), "food", {"text": "loves sushi", "kind": "pref"})
item  = store.get(("users", "1", "memories"), "food")
hits  = store.search(("users", "1"), filter={"kind": "pref"}, limit=10)
spaces = store.list_namespaces(prefix=("users",))

graph = builder.compile(store=store)                          # as a LangGraph store

Pass a LangGraph IndexConfig and the store embeds the configured fields on put and ranks search(query=...) by cosine similarity using DynamoDB's SearchVectors — no external vector database.

from langgraph_store_core import bedrock_titan_embeddings
from langgraph_store_dynamodb import DynamoDBStore

store = DynamoDBStore(
    table_name="langgraph-memory",
    index={"dims": 1024, "embed": bedrock_titan_embeddings(dimensions=1024), "fields": ["text"]},
)
store.put(("memories", "kamal"), "k1", {"text": "the user loves sushi", "kind": "pref"})
hits = store.search(("memories", "kamal"), query="what food does the user like?", filter={"kind": "pref"})
print(hits[0].score, hits[0].value)

embed may be any LangChain Embeddings, a list[str] -> list[list[float]] callable, or a provider string. fields defaults to ["$"] (the whole value as JSON). put(..., index=False) skips embedding for one item; put(..., index=["title"]) overrides the fields.

The table is created with a vector index (embedding, cosine, dims, PK as an inline filter). A vector index can only be declared at table creation, so use a new table name when enabling semantic search on an existing store. SearchConditionExpression only allows equality on a string search-schema attribute, so a prefix search resolves to its concrete namespaces (keys-only scan) and runs one ANN query per namespace, merged by score — an exact namespace is a single call. Value filters cannot be expressed there (only top-level search-schema attributes), so the store oversamples and applies them on the returned candidates.

Requires boto3>=1.43.78 and a region where DynamoDB vector search is available (GA 2026-08-05). Bedrock model access is needed only for the default Titan embedder.

Upgrading from 0.1.x

0.2.0 is a rewrite on langgraph-store-core. Same table (PK = namespace, SK = key, value, created_at, updated_at), same constructor (max_read_request_units / max_write_request_units still accepted). New in 0.2.0: prefix search (not just exact namespace), filter, offset, list_namespaces, GetOp/ListNamespacesOp in batch, ordered abatch, semantic search, and region_name / boto_session / endpoint_url options. Namespaces are now joined with a unit separator instead of :; items written by 0.1.x are still read and are migrated on their next put. aioboto3 is no longer required.

AWS permissions

dynamodb:DescribeTable, CreateTable, GetItem, PutItem, DeleteItem, Query, Scan, and SearchVectors (for semantic search), plus bedrock:InvokeModel for the default embedder.

License

MIT · part of the langgraph-store family · docs: https://skamalj.github.io/agentstate-reducer/

Release files for langgraph-store-dynamodb 0.2.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-store-dynamodb 0.2.0
File Size Uploaded
langgraph_store_dynamodb-0.2.0.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-store-dynamodb 0.2.0
File Interpreter ABI Platform
langgraph_store_dynamodb-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size:15.4 kB

Release files / langgraph_store_dynamodb-0.2.0.tar.gz

Download URL langgraph_store_dynamodb-0.2.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8d7f25e195fdb2a43516df73886ec266fcbbb292deccf677c371529380052477
BLAKE2b-256 checksum
How to use checksums
6677ea16de66b380d0fa305f440e35304d8c373215757afcdc7a3e539a53108f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / langgraph_store_dynamodb-0.2.0-py3-none-any.whl

Download URL langgraph_store_dynamodb-0.2.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bfd72d9c6c72b967048369fc49bab672820feb8d121dd9db38b48a3cc599972
BLAKE2b-256 checksum
How to use checksums
d085d400d0acbb5f045793ca12c7ab08d0e64d59ac9a7ac0cdb99b42cd0a6e6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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