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.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_serenedb-26.9.3.tar.gz | 211.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_serenedb-26.9.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 247.8 kB
Release files / langchain_serenedb-26.9.3.tar.gz
| Download URL | langchain_serenedb-26.9.3.tar.gz |
|---|---|
| Size | 211.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46388a63c74f1d643f55f04751112c3e3fe1b84b1597369fd21452da32e98c1b
|
|
BLAKE2b-256 checksum How to use checksums |
12ef08a6076aa43e6e3d9898ff5d0181c4b0223c9632a3816b30713ccdc1499d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 3, 2026.
Transparency logRelease files / langchain_serenedb-26.9.3-py3-none-any.whl
| Download URL | langchain_serenedb-26.9.3-py3-none-any.whl |
|---|---|
| Size | 36.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b79b7f4e4d74ebdd475c4213d298bb7df92644edebe59d1c39aaa278010480d0
|
|
BLAKE2b-256 checksum How to use checksums |
d570b2fb8df518dd024a52de304dadf7f42176f1b67ef216e7762190705ad719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 3, 2026.
Transparency log