Skip to main content

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 .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 isn't part of this SDK — that's a genuinely different problem (robots.txt compliance, politeness/rate limiting, avoiding crawl traps) than ingesting sources you already have. Crawl with whatever tool you already use, then pass the resulting URL list to ingest() — it already accepts a batch of sources in one call.

If you ingest into a collection with a non-default embed_model=, retrieve()/query() try to resolve the right model automatically — today's backend doesn't yet record which model created a collection, so until it does, pass the same embed_model= explicitly 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, so this is worth getting right rather than relying on the not-yet-live auto-detection.

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

Two distinct kinds of error, on purpose:

  • Backend/runtime failures — a bad response from the Liviate API, a timeout, an unsupported file type — always surface as liviate_rag.LiviateError or a subclass (APIError, RateLimitError, UnsupportedFileType, IngestTimeout), whatever the underlying transport, including calls routed through the openai client for embed()/query()'s generation step. except LiviateError reliably catches all of these.
  • Caller mistakes — a source ingest() can't classify, calling delete() with both/neither of ids/filter — raise the builtin ValueError directly, never a LiviateError. These are bugs in the calling code, not something except LiviateError is meant to catch; handle ValueError separately if you need to.

ingest() on a batch (list of sources) is worth calling out specifically: if some items fail but at least one succeeds, the call still returns normally — failures show up in result.warnings, per the API reference's "one bad item shouldn't abort the batch" design. But if every item in the batch fails, nothing was ingested, and that raises LiviateError rather than returning a quiet zero-chunk "success."

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

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liviate-rag 0.1.4
File Size Uploaded
liviate_rag-0.1.4.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for liviate-rag 0.1.4
File Interpreter ABI Platform
liviate_rag-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 58.4 kB

Release files / liviate_rag-0.1.4.tar.gz

Download URL liviate_rag-0.1.4.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4a8d3776a3663b7355737a0420ba3c0ab6a0df92f3002a1ce5f29e582dfc8f10
BLAKE2b-256 checksum
How to use checksums
2ed065da06002a687e89a30c33d0fc6f57af748d3d3111454107cc3c8959fe3b
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 16, 2026.

Transparency log

Release files / liviate_rag-0.1.4-py3-none-any.whl

Download URL liviate_rag-0.1.4-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b42ba65644cbd2d7a137b81cab820cb2209f69e881acf27395d98e6cb3e2901
BLAKE2b-256 checksum
How to use checksums
1bf38cd74310a97cbee0001e988a188a432d67e6f4449b36e5a9a05dddc5f409
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 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release 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