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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3198de4a962f50baa378d3b62f294794bc64d414c79e6b7b19410d17b59440df
|
|
| MD5 |
ef89260a79f2f05815a18e9d096e7cb2
|
|
| BLAKE2b-256 |
e65561396946e1d4227784fdaf10b9d38deb7b4d4f7e50d97156c23a23a5d055
|
Provenance
The following attestation bundles were made for privaterag_langchain-0.1.0.tar.gz:
Publisher:
release.yml on erdkocak/PrivateRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
privaterag_langchain-0.1.0.tar.gz -
Subject digest:
3198de4a962f50baa378d3b62f294794bc64d414c79e6b7b19410d17b59440df - Sigstore transparency entry: 1507849158
- Sigstore integration time:
-
Permalink:
erdkocak/PrivateRAG@e4a7118cb95fa5320085b0a15e17fd83b7695e1c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/erdkocak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e4a7118cb95fa5320085b0a15e17fd83b7695e1c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file privaterag_langchain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: privaterag_langchain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d0b54fdb3008f5b57271d90eba6588d9c4aae41a07175a005e00a435a132cf5
|
|
| MD5 |
1da3344d9ec4b5d2b232284a1b6af96e
|
|
| BLAKE2b-256 |
89ba9349c1b47aa2a0d24a85a68664d17d3a506a8aa5f663ec3f75b98955049e
|
Provenance
The following attestation bundles were made for privaterag_langchain-0.1.0-py3-none-any.whl:
Publisher:
release.yml on erdkocak/PrivateRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
privaterag_langchain-0.1.0-py3-none-any.whl -
Subject digest:
0d0b54fdb3008f5b57271d90eba6588d9c4aae41a07175a005e00a435a132cf5 - Sigstore transparency entry: 1507849238
- Sigstore integration time:
-
Permalink:
erdkocak/PrivateRAG@e4a7118cb95fa5320085b0a15e17fd83b7695e1c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/erdkocak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e4a7118cb95fa5320085b0a15e17fd83b7695e1c -
Trigger Event:
workflow_dispatch
-
Statement type: