Skip to main content

LangChain retriever adapter for the PrivateRAG Python SDK.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

privaterag_langchain-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

privaterag_langchain-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file privaterag_langchain-0.1.0.tar.gz.

File metadata

  • Download URL: privaterag_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for privaterag_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3198de4a962f50baa378d3b62f294794bc64d414c79e6b7b19410d17b59440df
MD5 ef89260a79f2f05815a18e9d096e7cb2
BLAKE2b-256 e65561396946e1d4227784fdaf10b9d38deb7b4d4f7e50d97156c23a23a5d055

See more details on using hashes here.

Provenance

The following attestation bundles were made for privaterag_langchain-0.1.0.tar.gz:

Publisher: release.yml on erdkocak/PrivateRAG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file privaterag_langchain-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for privaterag_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d0b54fdb3008f5b57271d90eba6588d9c4aae41a07175a005e00a435a132cf5
MD5 1da3344d9ec4b5d2b232284a1b6af96e
BLAKE2b-256 89ba9349c1b47aa2a0d24a85a68664d17d3a506a8aa5f663ec3f75b98955049e

See more details on using hashes here.

Provenance

The following attestation bundles were made for privaterag_langchain-0.1.0-py3-none-any.whl:

Publisher: release.yml on erdkocak/PrivateRAG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page