liviate-rag
Client SDK for Liviate's RAG stack — ingest, embed, retrieve, rerank, and (optionally) generate — in a few lines of Python.
pip install liviate-rag
Quickstart
from liviate_rag import RAGClient
client = RAGClient(api_key="...") # or set LIVIATE_API_KEY
client.ingest("handbook.pdf", collection="hotel-kirstine")
result = client.query("Har I parkering?", collection="hotel-kirstine", model="anthropic/claude-sonnet-5")
print(result.answer)
print(result.sources)
print(result.usage)
print(result.timing)
Want ranked context only, and to call your own LLM?
context = client.retrieve("Har I parkering?", collection="hotel-kirstine", top_k=5)
An AsyncRAGClient with the same method surface is available for async
codebases:
from liviate_rag import AsyncRAGClient
async with AsyncRAGClient() as client:
result = await client.query("...", collection="...", model="...")
Ingest
ingest() handles a single file, URL, text string, or file-like stream —
detecting which one automatically from content, never a filename
extension. See _ingest/detect.py for the exact detection order.
Supported file types
| Type | Extension |
|---|---|
.pdf |
|
| Word | .docx |
| Markdown | .md |
| Plain text | .txt |
| CSV | .csv |
| JSON | .json |
| HTML | .html |
Plus raw text (source_type="text") and URLs (a single page is scraped or
downloaded automatically depending on its content type).
OCR / scanned images are explicitly out of scope for v1 — ingest()
raises UnsupportedFileType rather than failing silently or half-parsing.
Whole-site crawling (ingest_site()) is not yet implemented — it
raises NotImplementedError. Use ingest() with a list of individual page
URLs in the meantime; it already accepts a batch of sources in one call.
If you ingest into a collection with a non-default embed_model=, pass the
same embed_model= to retrieve()/query() when querying it — a query
embedded with a different model than the collection's vectors either
returns garbage or fails outright on a dimension mismatch.
Removing content
result = client.ingest("handbook.pdf", collection="hotel-kirstine")
client.delete("hotel-kirstine", ids=result.point_ids) # by id
client.delete("hotel-kirstine", filter={"must": [...]}) # by metadata filter
Errors
Every error from the Liviate API — whatever the underlying transport,
including calls routed through the openai client for embed()/query()'s
generation step — surfaces as this package's own exception hierarchy
(liviate_rag.LiviateError and subclasses: APIError, RateLimitError,
UnsupportedFileType, IngestTimeout), never a raw httpx/openai
exception. The one deliberate exception: ingest() raises the builtin
ValueError when it can't classify a source.
Development
pip install -e ".[dev]"
pytest tests/unit tests/integration # no network/credentials required
LIVIATE_E2E=1 pytest tests/e2e # real environment, run manually
Metadata
Release files for liviate-rag 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| liviate_rag-0.1.1.tar.gz | 25.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| liviate_rag-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.1 kB
Release files / liviate_rag-0.1.1.tar.gz
| Download URL | liviate_rag-0.1.1.tar.gz |
|---|---|
| Size | 25.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
042110a8b72f171c81ea59db0ac7c58f1f3fd660543bd6ebf2da81f21550911c
|
|
BLAKE2b-256 checksum How to use checksums |
40d6a24523a5ea853089d9432f62db44c52689976b01ee6b1bb81225ab80fb55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency logRelease files / liviate_rag-0.1.1-py3-none-any.whl
| Download URL | liviate_rag-0.1.1-py3-none-any.whl |
|---|---|
| Size | 27.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13da724149ae69a92fa9fdb98376308abc21fbf26aa9f1cf0ebc11aaac117cd2
|
|
BLAKE2b-256 checksum How to use checksums |
fe10004f713a8edc7f5869f4829e25ddc255c84eff38cc20fe09f174285b7dd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency log