ViaRAG SDK
Minimal Python SDK for interacting with the ViaRAG API. Designed for developers building RAG pipelines, chatbots, and AI-native workflows.
📦 Installation
pip install viarag
🚀 Quickstart
from viarag import ViaRAGClient
client = ViaRAGClient(api_key="your_api_key")
print(client.health_check())
🔧 Class: ViaRAGClient
ViaRAGClient(api_key: str, timeout: int = 30)
Creates a new client.
📡 Endpoints
✅ 1. health_check()
Returns the API's current health status.
client.health_check()
Returns:
{"status": "ok"}
🤖 2. simple_query(prompt: str, top_k: int = 5)
Runs a retrieval-augmented generation (RAG) query.
client.simple_query("What is ViaRAG?")
Returns:
{
"response": "ViaRAG is an API for retrieval-augmented generation...",
"contexts": [...],
"prompt": "..."
}
💬 3. direct_query(prompt: str)
Runs a prompt directly through the LLM, no retrieval.
client.direct_query("Tell me a joke.")
🔍 4. match_context(prompt: str, top_k: int = 5)
Returns top-k context chunks that match your prompt (no generation).
client.match_context("What is ViaVeri?")
Returns:
[
{"content": "...", "score": 0.92},
{"content": "...", "score": 0.87}
]
📄 5. upload_document(file_path: str, metadata: dict = None, chunking_config: dict = None)
Uploads a document and indexes it.
client.upload_document(
file_path="my_notes.pdf",
metadata={"source": "user-upload"},
chunking_config={"chunk_size": 1000, "chunk_overlap": 200}
)
Supports: .pdf, .docx, .txt
✂️ 6. chunk_text(text: str, chunk_size: int = 1000, chunk_overlap: int = 200, splitter: str = "recursive")
Chunks raw text without uploading a file.
chunks = client.chunk_text("A long string of text...")
Returns:
["Chunk 1", "Chunk 2", ...]
📚 7. list_documents()
Lists all documents you’ve uploaded.
client.list_documents()
Returns:
[
{"doc_id": "abc123", "filename": "my_notes.pdf"},
...
]
❌ 8. delete_document_by_id(doc_id: str)
Deletes all chunks associated with a document.
client.delete_document_by_id("abc123")
🔐 Authentication
All API calls (except health_check) require a Bearer token:
client = ViaRAGClient(api_key="sk-...")
🧪 Development
Clone the repo and install locally:
git clone https://github.com/YOUR_USERNAME/viarag-sdk.git
cd viarag-sdk
pip install -e .
📄 License
GNU General Purpose License. See LICENSE file.
👋 About
Built by ViaVeri Technologies to empower developers with simple, powerful RAG tools.
Metadata
Release files for viarag 0.1.3
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 |
|---|---|---|---|---|
| viarag-0.1.3.tar.gz | 4.7 kB | Without provenance | Details for viarag-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| viarag-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for viarag-0.1.3-py3-none-any.whl |
Total release size: 10.1 kB
Release files / viarag-0.1.3.tar.gz
| Download URL | viarag-0.1.3.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd0551314e0c7c988575b0294ce5bfe16f239f499ef979ed727361ef03e55e98
|
|
BLAKE2b-256 checksum How to use checksums |
d46be3bc51db7730993d2a5de5db12e333860e186191e8001303f6093488d443
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / viarag-0.1.3-py3-none-any.whl
| Download URL | viarag-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4385dcf7baa73f58e65509cc35fe87eacbe3a33a2525ce1dac7b9b7c734d1dea
|
|
BLAKE2b-256 checksum How to use checksums |
5bbce5505d05dfddd4213df88e833e37621b94149fe7acb2668acda0eeb0a196
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for viarag 0.1.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.