Skip to main content

langgraph-store-qdrant

A Qdrant store for LangGraph. It gives your agents long-term memory: data they save in one conversation and recall in later ones.

It plugs in anywhere LangGraph accepts a store, such as graph.compile(store=...), in place of InMemoryStore or PostgresStore.

Installation

uv add langgraph-store-qdrant

Usage

from qdrant_client import QdrantClient
from langgraph.store.qdrant import QdrantStore

store = QdrantStore(QdrantClient(url="http://localhost:6333"))
store.setup()  # run once

store.put(("users", "alice"), "prefs", {"theme": "dark", "lang": "en"})
store.get(("users", "alice"), "prefs").value
store.search(("users",), filter={"lang": "en"})
store.list_namespaces(prefix=("users",))
store.delete(("users", "alice"), "prefs")
from langchain.embeddings import init_embeddings

with QdrantStore.from_url(
    "http://localhost:6333",
    index={
        "dims": 1536,
        "embed": init_embeddings("openai:text-embedding-3-small"),
        "fields": ["text"],  # defaults to the whole value
    },
) as store:
    store.setup()
    store.put(("memories", "alice"), "m1", {"text": "Alice loves hiking"})
    store.put(("memories", "alice"), "m2", {"text": "Alice is vegetarian"})

    for hit in store.search(("memories", "alice"), query="food preferences"):
        print(hit.key, hit.score, hit.value)

index also accepts distance ("cosine", "dot", "euclid" or "manhattan") and Qdrant's hnsw_config, quantization_config, on_disk and search_params. Pass index=False to put to store an item without embedding it, or index=["title"] to embed other fields.

Async

from langgraph.store.qdrant import AsyncQdrantStore

async with AsyncQdrantStore.from_url("http://localhost:6333") as store:
    await store.setup()
    await store.aput(("users", "alice"), "prefs", {"theme": "dark"})
    item = await store.aget(("users", "alice"), "prefs")

In a graph

def remember(state: State, runtime: Runtime[Context]):
    namespace = ("memories", runtime.context["user_id"])
    memories = runtime.store.search(namespace, query=state["message"], limit=3)
    runtime.store.put(namespace, str(uuid.uuid4()), {"text": state["message"]})
    ...


graph = builder.compile(checkpointer=checkpointer, store=store)

Expiry

store = QdrantStore(
    client,
    ttl={
        "default_ttl": 60 * 24,  # minutes
        "refresh_on_read": True,
        "omit_expired": True,
        "sweep_interval_minutes": 10,
    },
)
store.put(("cache",), "k", {"v": 1}, ttl=5)
store.start_ttl_sweeper()  # or call store.sweep_ttl() yourself

LICENSE

Apache 2.0

Metadata

Release files for langgraph-store-qdrant 0.1.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-qdrant 0.1.0
File Size Uploaded Provenance
langgraph_store_qdrant-0.1.0.tar.gz 24.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-store-qdrant 0.1.0
File Interpreter ABI Platform
langgraph_store_qdrant-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.1 kB

Release files / langgraph_store_qdrant-0.1.0.tar.gz

Download URL langgraph_store_qdrant-0.1.0.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6d5ae95df4222c7627d23ebf73763ba816cb1161a8777348099c5959215abe62
BLAKE2b-256 checksum
How to use checksums
98f10c887b5522ca9457ccd74cf0814fee7af0b266ba37165fe066af83c0076c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.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":true}

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

Download URL langgraph_store_qdrant-0.1.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d19c35b82f8304acec39a212603da4c880b5c47e226a79886b02eed2f1aba86
BLAKE2b-256 checksum
How to use checksums
1311318aa03e70cb2c80869fdf054344700b12cb97a00123fa3155598c020327
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.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":true}

Security for langgraph-store-qdrant 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 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