Skip to main content

langgraph-store-core

Shared core for building LangGraph long-term-memory stores (BaseStore). Implement a backend by subclassing KVStore and supplying four small primitives — the core handles batch/abatch, timestamps, search filters, namespace prefix/suffix matching, list_namespaces, and semantic search.

from langgraph_store_core import KVStore

class MyStore(KVStore):
    def _read(self, prefix, key): ...        # -> row | None
    def _write(self, row): ...               # row = {prefix,key,value,created_at,updated_at,embedding}
    def _remove(self, prefix, key): ...
    def _scan(self, prefix): ...             # rows whose prefix starts with `prefix`

    # optional — native vector search; the default ranks `_scan` rows by cosine in Python
    def _vector_search(self, prefix, vector, filter, limit): ...   # -> [(row, score), ...]

Pass LangGraph's IndexConfig to any store built on the core and it embeds the configured fields on put and answers search(namespace, query="...") ranked by cosine similarity, with SearchItem.score populated:

store = MyStore(index={"dims": 1024, "embed": embedder, "fields": ["text"]})
store.put(("memories", "u1"), "k", {"text": "the user loves sushi"})
hits = store.search(("memories", "u1"), query="what food does the user like?")
  • embed: a LangChain Embeddings, a list[str] -> list[list[float]] callable, or a provider string ("openai:text-embedding-3-small"). bedrock_titan_embeddings() is included as a ready-made callable (needs boto3).
  • fields: JSON paths to embed; default ["$"] (whole value). put(..., index=False) skips one item; put(..., index=["title"]) overrides the fields.
  • A store without index is filter-only and ignores query, exactly as LangGraph documents.
  • Backends override _vector_search for native ANN (pgvector, Cosmos VectorDistance, Firestore find_nearest, DynamoDB SearchVectors); the core re-checks namespace and filter on what comes back, so a backend may push down only part of the filter.

langgraph_store_core.testing ships FakeEmbeddings (deterministic, no network) and MemoryKVStore for tests.

Concrete backends: langgraph-store-dynamodb, langgraph-store-postgres, langgraph-store-cosmosdb, langgraph-store-firestore.

Docs: https://skamalj.github.io/agentstate-reducer/

License

MIT

Metadata

Release files for langgraph-store-core 0.1.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-store-core 0.1.1
File Size Uploaded Provenance Actions
langgraph_store_core-0.1.1.tar.gz 8.4 kB Without provenance Details for langgraph_store_core-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-store-core 0.1.1
File Interpreter ABI Platform Actions
langgraph_store_core-0.1.1-py3-none-any.whl Python 3 none any Details for langgraph_store_core-0.1.1-py3-none-any.whl

Total release size: 16.7 kB

Release files / langgraph_store_core-0.1.1.tar.gz

Download URL langgraph_store_core-0.1.1.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
92338deb6daddb391822bec896d08ed91b0b8f008392c2de1cf7bd9ca9a6a5d9
BLAKE2b-256 checksum
How to use checksums
1857f5735231a703fa07f3358c57f8e49f63566ff4d1a9e4aed87b05fda3a364
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_core-0.1.1-py3-none-any.whl

Download URL langgraph_store_core-0.1.1-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a14ad42e099e40a342c616a88f0a1e34cd0a8aadd5f29b9f96e9710144e5fbd1
BLAKE2b-256 checksum
How to use checksums
301056beb0608b4489b00eec8bfcfa10dafa55f80213d369702a8401e1b73824
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}

Security for langgraph-store-core 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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