The `ragie` Python Client SDK, currently at version 1.15.1, provides an idiomatic interface to access the Ragie API for Retrieval-Augmented Generation (RAG) applications. It enables developers to integrate Ragie's RAG capabilities, including document ingestion, chunk retrieval, and interaction with LLMs. The library appears to have a regular release cadence with frequent updates and new features.
pip install ragieVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Ragie client, create a raw text document, wait for its processing to complete (indicated by the 'ready' status), and then perform a retrieval query to get relevant information based on the ingested document. Ensure you have `RAGIE_API_KEY` set as an environment variable.
Pin the `ragie` package version in your `requirements.txt` or `pyproject.toml` (e.g., `ragie==1.15.1`).
Always initialize the `Ragie` client using a context manager (`with Ragie(...) as client:`). This ensures that HTTP connections and other resources are properly closed and released.
Implement a polling mechanism or listen for webhooks to confirm the document's status is 'ready' before attempting retrievals.
Ensure `RAGIE_API_KEY` is correctly set and valid. Monitor your usage against plan limits and consider upgrading your plan if necessary. Refer to the Ragie documentation for error codes and resolutions.
pip install ragie
from ragie import RagieClient # Ensure RAGIE_API_KEY is set in environment or passed directly client = RagieClient(api_key="your_actual_api_key_here")
from ragie import RagieClient client = RagieClient() client.documents.upload(file_path="path/to/your/document.pdf")
from ragie import RagieClient
client = RagieClient()
with open("path/to/your/document.pdf", "rb") as f:
client.documents.upload(file=f)