Skip to main content

langchain-cairn

LangChain vector store for Cairn, the hybrid search database where a deletion is final.

pip install langchain-cairn
from cairn_db import Client
from langchain_cairn import CairnVectorStore, collection_schema

admin = Client("http://localhost:7200", api_key=ADMIN_KEY)
admin.create_collection("docs", collection_schema(1536, filterable={"source": "Enum"}))

store = CairnVectorStore(Client("http://localhost:7200", api_key=KEY).collection("docs"), embeddings)
store.add_documents(chunks)                      # chunk.metadata["parent"] = the source document
store.similarity_search("what changed in 2024?", k=4, filter={"source": "handbook"})
store.similarity_search("...", k=4, group_by="parent")   # each document once
store.hybrid_search("error E1234", k=4)          # vector + BM25, fused
store.as_retriever()
store.delete(parent="handbook.pdf")              # the document and all its chunks, everywhere
  • Schema. collection_schema creates the fields the store needs:
    • the text and the embedding;
    • parent;
    • metadata, which holds each document's whole metadata as JSON, so any metadata round-trips;
    • the filterable fields, which store the same metadata keys so they can be filtered.
  • Filters. Either a plain dict ({"source": "a"}: every key equals its value), or a Cairn filter ({"field": "page", "gte": 2}, and/or/not).
  • Scores. similarity_search_with_score returns the similarity for Cosine and Dot, and the squared distance for L2. similarity_search_with_relevance_scores maps them to [0, 1].
  • Deletions. A deletion by ids, by parent or by filter is final. The client carries its consistency token, so later searches never return the deleted documents, on any node.

Metadata

Release files for langchain-cairn 0.3.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-cairn 0.3.2
File Size Uploaded
langchain_cairn-0.3.2.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-cairn 0.3.2
File Interpreter ABI Platform
langchain_cairn-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / langchain_cairn-0.3.2.tar.gz

Download URL langchain_cairn-0.3.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4b4b605ad8f0605d0ef5d5cac321534047d3376a678ced28c935d8f8d1033d36
BLAKE2b-256 checksum
How to use checksums
dd8463a96d31a80f3b923eb4eb568fd0e93fdb3161ff16db3255dd654a907a4c
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 30, 2026.

Transparency log

Release files / langchain_cairn-0.3.2-py3-none-any.whl

Download URL langchain_cairn-0.3.2-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e31fda9bae9377b8a6766d10b17ad86172571a6c936966c286460d4e8565f3bd
BLAKE2b-256 checksum
How to use checksums
aacaf6096082ee9d0da66163adfec76e42ad04ddabbcc1c4b1cd3bb2872618f3
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 30, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.3

2 release files

This release

0.3.2 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