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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.