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 (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=, 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.3

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.3
File Size Uploaded
liviate_rag-0.1.3.tar.gz 29.3 kB Details

Built distribution (wheel)

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

Total release size: 59.1 kB

Release files / liviate_rag-0.1.3.tar.gz

Download URL liviate_rag-0.1.3.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6dc6c00c73d3abe070d76fd78038edbeb82366c21dac9f38624861e25e80840d
BLAKE2b-256 checksum
How to use checksums
4fc8755cb342fdda905b75be0db1fa65e5b3a483c0baaad2306458e2e6f97397
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.3-py3-none-any.whl

Download URL liviate_rag-0.1.3-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
108b6259c23a575dc212b6b93855cc99c5c7052ec550136bc9c6a40a30e188f4
BLAKE2b-256 checksum
How to use checksums
b9914abf65a267e733ddadfb7305cbcf4e0b506bf05b7d2f0761146da480570d
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

0.1.4

2 release files

This release

0.1.3 This release

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