Skip to main content

causa-rag-client

The Python client for Causa RAG, a diagnostic bench for retrieval-augmented generation.

Point the bench at a RAG system you already run, and it will score every question in a golden set separately, name the pipeline stage that failed, and compare two runs question by question — so the effect of a configuration change is visible instead of assumed.

This package is the thin end: it drives an existing REST API and computes nothing itself. Evaluation always happens on the platform.

Install

pip install causa-rag-client            # the client alone (httpx)
pip install causa-rag-client[serve]     # plus serve(), which needs fastapi and uvicorn

Two roles

Connecting your RAG. serve() wraps a pair of your own functions in the platform's HTTP contract, so you do not write an HTTP server by hand:

from causa_rag_client import serve

def answer(question: str, corpus_id: str) -> dict:
    ...   # your pipeline
    return {"answer": text, "sources": [{"doc_id": d, "text": t} for d, t in hits]}

serve(answer=answer, port=8000)

Driving the bench. RagPlatformClient registers that endpoint, uploads a dataset, runs an experiment and fetches the result:

from causa_rag_client import RagPlatformClient

client = RagPlatformClient("http://localhost:8081")
client.register_rag(name="my-rag", url="http://localhost:8000")
run = client.run_experiment(rag="my-rag", dataset="golden.v1")
print(client.get_results(run))

The version number is the contract version

causa-rag-client is versioned by the HTTP contract it speaks, not by the platform's own version. The contract is at version 1, so the client is at 1.x and will stay there while the contract holds:

  • no field is removed or renamed;
  • no optional field becomes required;
  • the meaning of an existing field does not change;
  • new fields are additive and optional.

register_rag() and run_experiment() check the platform's reported contract version before sending anything and raise ContractVersionMismatch on a mismatch, rather than sending a request the platform cannot parse.

Not in Python?

The contract is ordinary JSON over HTTP and needs no client at all. The field-by-field reference is docs/external-rag-contract.md; adding two endpoints to a service you already run is the whole integration.

Licence

Apache-2.0. Copyright 2026 Alexander Laputski.

Download files

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

Source Distribution

causa_rag_client-0.1.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

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

causa_rag_client-0.1.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: causa_rag_client-0.1.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for causa_rag_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1fd71a5704f03deffb56542a541395df02c16b188a272c7e52286cfc77bae81
MD5 856a60c2e7ff0b2e342562d23fbcd6ee
BLAKE2b-256 edb7804ee20c454ff0b346316f90db85fc3ccf4f2b4657707d4789cc433c6fe1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for causa_rag_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a92db58617511d853c1a0f7e1bd2fecbcd3b167b44e1e3cad37674b4e821db27
MD5 89ce35a121213ad2658c524043c87af9
BLAKE2b-256 b6ef1763d66ca3ce5c7b8be0eeacd1a843a51706752110771e61cbcb905c7210

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page