Skip to main content

Minimal Python SDK for interacting with the ViaRAG API

Project description

ViaRAG SDK

Minimal Python SDK for interacting with the ViaRAG API. Designed for developers building RAG pipelines, chatbots, and AI-native workflows.

Product is currently in beta-testing and we cannot goerantee everythihg wibl beb right. Thanks for your patients.


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

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

viarag-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

viarag-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file viarag-0.1.1.tar.gz.

File metadata

  • Download URL: viarag-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for viarag-0.1.1.tar.gz
Algorithm Hash digest
SHA256 33c4da68ecdf00723e951ce4090f2918ab3a34046ed19d5e2d9760a5e8e2cada
MD5 9192133ac9ede948a7b87e96d7f09e74
BLAKE2b-256 506fc081937acf0dda4a1ffc074036f607aafb7653070d8c490cc68d919e1fee

See more details on using hashes here.

File details

Details for the file viarag-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: viarag-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for viarag-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc8d4747a5f22f44cb5ecc848bdd8bdf0bddf4b601a921f0e27a8d6826da5afd
MD5 2d6b3bade13e9318bef7702975cdd235
BLAKE2b-256 830066e29b338da15c39ec111ba83b4104ff44c01b05e0200e0a7b58f55141e9

See more details on using hashes here.

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