Skip to main content

privaterag-langchain

Thin LangChain retriever adapter for the core PrivateRAG Python SDK.

The adapter keeps LangChain imports isolated to this package. The core privaterag SDK does not import LangChain.

Install

Published packages declare the core privaterag SDK as a dependency. If LangChain is not already present in the environment, install the optional extra:

python -m pip install privaterag-langchain[langchain]

The v0 supported framework range is langchain-core>=1.0,<1.4; see ../../docs/adapter_compatibility.md for the tested lower-bound and current-version matrix.

For local editable development:

python -m pip install -e python/privaterag
python -m pip install -e "python/privaterag-langchain[langchain]"

Usage

from privaterag import PrivateRAGClient
from privaterag_langchain import PrivateRAGRetriever

client = PrivateRAGClient.from_manifest(
    "http://127.0.0.1:18090/manifest.json",
    embed_query=local_embed_query,
)

retriever = PrivateRAGRetriever(
    client,
    top_k=2,
    retrieval_count=4,
)

documents = retriever.get_relevant_documents("What needs review before onboarding?")

top_k must be positive. retrieval_count, when provided, must be positive and greater than or equal to top_k; otherwise the adapter fails before delegating to the SDK. See ../../docs/padding_policy.md.

Returned LangChain Document objects use retrieved chunk text as page_content. Metadata includes the original chunk metadata plus chunk_id, document_id when present, score when present, and namespaced privaterag_* copies of those retrieval fields.

The adapter delegates retrieval to privaterag.PrivateRAGClient. It does not implement embedding providers, LLM calls, reranking, server-side vector search, or direct chunk lookup. The current supported simplepir-rs-v0-1000-1k backend is supported only within its documented v0 limits and remains unaudited, not externally audited, and not production-grade cryptographic assurance. The old simplepir-rs-experimental-v0 profile remains smoke-scale, experimental, unaudited, and compatibility/development-only.

Metadata

Release files for privaterag-langchain 0.1.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 privaterag-langchain 0.1.0
File Size Uploaded
privaterag_langchain-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for privaterag-langchain 0.1.0
File Interpreter ABI Platform
privaterag_langchain-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / privaterag_langchain-0.1.0.tar.gz

Download URL privaterag_langchain-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3198de4a962f50baa378d3b62f294794bc64d414c79e6b7b19410d17b59440df
BLAKE2b-256 checksum
How to use checksums
e65561396946e1d4227784fdaf10b9d38deb7b4d4f7e50d97156c23a23a5d055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 11, 2026.

Transparency log

Release files / privaterag_langchain-0.1.0-py3-none-any.whl

Download URL privaterag_langchain-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d0b54fdb3008f5b57271d90eba6588d9c4aae41a07175a005e00a435a132cf5
BLAKE2b-256 checksum
How to use checksums
89ba9349c1b47aa2a0d24a85a68664d17d3a506a8aa5f663ec3f75b98955049e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.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