Skip to main content

VantaDB × LangChain

LangChain VectorStore adapter for VantaDB.

Install

Not on PyPI yet. The vantadb-langchain package builds and passes twine check locally; it will go live with the first adapters-v* tag release. Until then, install from source.

# Today, from a repo checkout
cd integrations/langchain && pip install .

Install from PyPI (after first release)

pip install vantadb-langchain

Quickstart

from langchain_openai import OpenAIEmbeddings
from vantadb_langchain import VantaDBVectorStore

embedding = OpenAIEmbeddings(model="text-embedding-3-small")

store = VantaDBVectorStore(
    embedding=embedding,
    db_path="./my_data",
    namespace="docs",
)

# Add documents
store.add_texts(
    ["VantaDB is an embedded vector database written in Rust.",
     "It supports hybrid search across vectors and text."],
    metadatas=[{"source": "docs"}, {"source": "docs"}],
)

# Search
results = store.similarity_search("vector database", k=5)
for doc in results:
    print(doc.page_content, doc.metadata)

API

  • similarity_search(query, k=4) — search by text
  • similarity_search_by_vector(embedding, k=4) — search by raw vector
  • similarity_search_with_score(query, k=4) — search with cosine distance
  • add_texts(texts, metadatas=None, ids=None) — add documents
  • delete(ids=...) — delete by key
  • from_texts(texts, embedding, metadatas=None, ids=None) — create + populate store

LangGraph (INTG-01)

Persistent LangGraph adapters — same embedded database, no server. Requires langgraph-checkpoint>=2,<5 (pinned major: upstream API is unstable).

from vantadb_langchain import VantaDBCheckpointer, VantaDBStore

# Short-term memory: per-thread checkpoints (put/get/list/writes/delete)
checkpointer = VantaDBCheckpointer(db_path="./my_data")
graph = builder.compile(checkpointer=checkpointer)
graph.invoke(inputs, {"configurable": {"thread_id": "user-1"}})

# Long-term memory: hierarchical KV store, namespaces are tuples
store = VantaDBStore(db_path="./my_data", embeddings=embedding)
await store.aput(("users", "123", "prefs"), "theme", {"mode": "dark"})
item = await store.aget(("users", "123", "prefs"), "theme")
results = await store.asearch(("users", "123"), query="dark mode")

Notes:

  • Namespace tuples map to VantaDB namespaces joined with / (parts must be non-empty strings without /).
  • search(filter=...) matches scalar value fields exactly; nested dicts/lists are payload-only.
  • Semantic query needs embeddings=; without it raises ValueError.
  • TTL is not supported (supports_ttl = False); index= is accepted and ignored.

Why VantaDB?

  • Embedded & local-first: the storage engine is a Rust library embedded in your process — no server to deploy, no network hop; data lives in your filesystem.
  • Persistent hybrid search: vectors + BM25 text search out of the box, where LangChain's InMemoryVectorStore covers only small single-process sessions.
  • Zero-setup alternative to hosted stacks: unlike Zep (requires a server) or Cognee (spins up its own knowledge-graph runtime), VantaDB is a plain library you import.

Development

pip install -e .

Metadata

Release files for vantadb-langchain 0.5.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 vantadb-langchain 0.5.0
File Size Uploaded
vantadb_langchain-0.5.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vantadb-langchain 0.5.0
File Interpreter ABI Platform
vantadb_langchain-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / vantadb_langchain-0.5.0.tar.gz

Download URL vantadb_langchain-0.5.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
57e70368b9febed746099963ec1b0c38d85980a5284e24cbe7377ced2cabe840
BLAKE2b-256 checksum
How to use checksums
13599360e9f18c1c98b6fb25203eae58328ee5aa8ccb13d25487326fea62281f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vantadb_langchain-0.5.0-py3-none-any.whl

Download URL vantadb_langchain-0.5.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f18b871cae0562e5edd93ce662200773b27e1468247ab92a7d3f8ae31235782
BLAKE2b-256 checksum
How to use checksums
620160fabecea108de5c9ccfbbac2109e2503bc75ed11aacdfc56dbf1406c344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.5.0 This release

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