Minimal Python SDK for interacting with the ViaRAG API. Designed for developers building RAG pipelines, chatbots, and AI-native workflows.
pip install viaragfrom viarag import ViaRAGClient
client = ViaRAGClient(api_key="your_api_key")
print(client.health_check())Creates a new client.
Returns the API's current health status.
client.health_check()Returns:
{"status": "ok"}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": "..."
}Runs a prompt directly through the LLM, no retrieval.
client.direct_query("Tell me a joke.")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}
]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", ...]Lists all documents you’ve uploaded.
client.list_documents()Returns:
[
{"doc_id": "abc123", "filename": "my_notes.pdf"},
...
]Deletes all chunks associated with a document.
client.delete_document_by_id("abc123")All API calls (except health_check) require a Bearer token:
client = ViaRAGClient(api_key="sk-...")Clone the repo and install locally:
git clone https://github.com/YOUR_USERNAME/viarag-sdk.git
cd viarag-sdk
pip install -e .GNU General Purpose License. See LICENSE file.
Built by ViaVeri Technologies to empower developers with simple, powerful RAG tools.