Skip to main content

langchain-rushdb

LangChain and LangGraph integration for RushDB. It works the same on RushDB Cloud and on a self-hosted RushDB engine.

Component LangChain / LangGraph interface What it does
RushDBVectorStore VectorStore Documents with filterable metadata and vector search; the filter is applied before ranking
RushDBHybridRetriever BaseRetriever Vector + BM25 keyword search fused in the engine (RRF or DBSF)
RushDBStore LangGraph BaseStore Long-term agent memory: namespaces, filters, semantic search, TTL
RushDBSaver LangGraph BaseCheckpointSaver Thread checkpoints and pending writes (human-in-the-loop, time travel)
pip install langchain-rushdb

Connect

Every class takes a rushdb.RushDB client, or builds one from the environment.

from rushdb import RushDB

# RushDB Cloud
client = RushDB("RUSHDB_API_KEY")

# Self-hosted engine (docker run -e RUSHDB_TOKEN=... -p 127.0.0.1:3000:3000 rushdb/rushdb)
client = RushDB("ENGINE_TOKEN", direct=True, engine_url="http://127.0.0.1:3000")

From the environment (client_from_env(), used when client is omitted):

Mode Variables
RushDB Cloud RUSHDB_API_KEY, optional RUSHDB_URL
Self-hosted RUSHDB_ENGINE_URL, RUSHDB_ENGINE_TOKEN, optional RUSHDB_SCOPE (multitenant engine)

The rest of this page is identical for both modes.

Vector store and hybrid retrieval

from langchain_openai import OpenAIEmbeddings
from langchain_rushdb import RushDBVectorStore, RushDBHybridRetriever

store = RushDBVectorStore(
    OpenAIEmbeddings(model="text-embedding-3-small"), client=client, hybrid=True
)
store.add_texts(
    ["RushDB stores JSON as a graph", "LangGraph persists agent state"],
    metadatas=[{"topic": "db", "year": 2026}, {"topic": "agents", "year": 2025}],
)

store.similarity_search("graph database", k=2, filter={"year": {"$gte": 2026}})

retriever = RushDBHybridRetriever(vectorstore=store, k=5, fusion="rrf")
retriever.invoke("how are agent checkpoints stored?")

Filters use the LangChain/MongoDB form on metadata: equality, $eq $ne $gt $gte $lt $lte, $in $nin, $exists, $contains $startsWith $endsWith, $and $or $not. An unsupported filter raises FilterError; it is never ignored. where= takes a raw RushDB filter, which can also match related records.

Only top-level metadata values that are strings, numbers, booleans or flat arrays of one of those are filterable. The full metadata, nested values included, is always returned.

Long-term memory store

from langchain_rushdb import RushDBStore

store = RushDBStore(
    client=client,
    index={"dims": 1536, "embed": "openai:text-embedding-3-small", "fields": ["text"]},
    ttl={"default_ttl": 60 * 24 * 30, "refresh_on_read": True},
)
store.put(("users", "u1", "memories"), "m1", {"text": "Prefers dark mode", "kind": "pref"})
store.search(("users", "u1"), query="ui preferences", filter={"kind": "pref"})

RushDB records have no native TTL. Expired items are hidden from every read. store.sweep() deletes them, and store.start_ttl_sweeper() runs sweep() periodically.

Checkpointer

from langgraph.graph import StateGraph
from langchain_rushdb import RushDBSaver

graph = builder.compile(checkpointer=RushDBSaver(client=client))
graph.invoke(inputs, {"configurable": {"thread_id": "t-1"}})

Embeddings: the one mode difference

The default is the same everywhere: you pass a LangChain Embeddings object and the connector stores and searches with the vectors it produces. On RushDB Cloud you can instead let RushDB compute embeddings:

RushDBVectorStore("managed", client=cloud_client)

A self-hosted engine never computes embeddings, so "managed" raises a ValueError there.

Data layout

The records the connector writes (labels LC_DOCUMENT, LG_STORE_ITEM, LG_STORE_VECTOR, LG_CHECKPOINT*) are specified in spec/README.md. The JavaScript package @rushdb/langchain uses the same layout.

Metadata

Release files for langchain-rushdb 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 langchain-rushdb 0.1.0
File Size Uploaded Provenance Actions
langchain_rushdb-0.1.0.tar.gz 212.3 kB With provenance Details for langchain_rushdb-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-rushdb 0.1.0
File Interpreter ABI Platform Actions
langchain_rushdb-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_rushdb-0.1.0-py3-none-any.whl

Total release size: 237.7 kB

Release files / langchain_rushdb-0.1.0.tar.gz

Download URL langchain_rushdb-0.1.0.tar.gz
Size 212.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ad17e06844f54ff3cccba12e47999ec6ea43802fd17978711ddab20ac390c0ba
BLAKE2b-256 checksum
How to use checksums
dae5bf63e97e972a917c03343a995840944f55cee2e26852a0284b738f488f17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

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

Download URL langchain_rushdb-0.1.0-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74f97ef9639efa29f126729a9194b7feff85eb42a00eae41ef6d4c9526dd8067
BLAKE2b-256 checksum
How to use checksums
f4f8e164bfa1275b14f80260e7db5ccfcedf8dd9a33bcaafe80acb2f8cfbf545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for langchain-rushdb 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_rushdb-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

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.0 This release

2 release files Full 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