Skip to main content

langchain-serenedb

A LangChain vector store integration for SereneDB

SereneDB speaks the PostgreSQL wire protocol, so this package connects with psycopg3. It maps the integration onto SereneDB's native capabilities:

Vector Store Search Feature SereneDB Feature used
Vector column FLOAT[N]
Distance ops <->, <=>, <#>, <+>
ANN index inverted index on the vector column e.g. USING inverted (emb ivf (metric='cosine', ...))
Full-text inverted index on the text column + BM25(idx.tableoid)
Metadata JSON column, explicit columns

Installation

pip install langchain-serenedb

Requires Python 3.10+.

Quickstart (engine + table)

from langchain_serenedb import SereneDBEngine, IVFIndex

engine = SereneDBEngine.from_connection_string(
    "host=127.0.0.1 port=7890 user=postgres dbname=postgres"
)

# Table only (vector search falls back to an exact scan until an index is built):
engine.init_vectorstore_table(table_name="my_docs", vector_size=768)

# Or create the table and its IVF ANN index in one call, so vector search is
# accelerated from the start:
engine.init_vectorstore_table("my_docs", 768, vector_index=IVFIndex())
#   ...or the combined full-text + vector index for hybrid search:
#   engine.init_vectorstore_table("my_docs", 768, hybrid_search_config=HybridSearchConfig())

# ... after writing rows, publish them to the inverted index:
engine.refresh_table("my_docs")

Tip: for a large bulk load, SereneDB trains better IVF clusters if you create the index after loading (store.apply_vector_index(IVFIndex())); creating it up front with the table is the convenient choice for incremental workloads.

Contributing

Building, testing, linting, and running the suite (locally or in Docker Compose) are covered in CONTRIBUTING.md.

License

MIT

Metadata

Release files for langchain-serenedb 26.11.2

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-serenedb 26.11.2
File Size Uploaded Provenance Actions
langchain_serenedb-26.11.2.tar.gz 213.8 kB With provenance Details for langchain_serenedb-26.11.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-serenedb 26.11.2
File Interpreter ABI Platform Actions
langchain_serenedb-26.11.2-py3-none-any.whl Python 3 none any Details for langchain_serenedb-26.11.2-py3-none-any.whl

Total release size: 251.3 kB

Release files / langchain_serenedb-26.11.2.tar.gz

Download URL langchain_serenedb-26.11.2.tar.gz
Size 213.8 kB
Tags Source
SHA-256 checksum
How to use checksums
29e502754851ee16bf470c5bef06f80a96876754bca8c8c463c6174b89788b13
BLAKE2b-256 checksum
How to use checksums
19c01e173f0fcf73e32028df469a97849e905f9b395e720721952bf3859b1674
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 4, 2026.

Transparency log

Release files / langchain_serenedb-26.11.2-py3-none-any.whl

Download URL langchain_serenedb-26.11.2-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b991693d2a878c624a49906edb1266ef99c60edfa4dc7b7813d982d459f3e0b
BLAKE2b-256 checksum
How to use checksums
2b7dd187b4b66b5587604328d32c4f95dee42e579c71903dcb41e40191d69b78
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 4, 2026.

Transparency log

Security for langchain-serenedb 26.11.2

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_serenedb-26.11.2.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 4, 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

26.11.2 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