Registry / llm-agents / ragie
library2.0.0pypypi✓ verified 87d ago

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 ragie
INSTALL
IMPORT
SIG · RAGIE
R
ragie
llm-agentspythonv2.0.0
Install
4.0s avg
Import
1532ms
Disk
33MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 1.615s · 34.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.0s · import 1.449s · 35MB
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Ragie
from ragie import Ragie

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.

import os from ragie import Ragie from dotenv import load_dotenv load_dotenv() # Load environment variables from .env file RAGIE_API_KEY = os.environ.get("RAGIE_API_KEY", "") if not RAGIE_API_KEY: raise ValueError("RAGIE_API_KEY environment variable not set. Get one at https://secure.ragie.ai/api-keys") try: # Initialize the Ragie client using a context manager for resource cleanup with Ragie(auth=RAGIE_API_KEY) as ragie_client: # Create a raw document print("Creating a raw document...") document = ragie_client.documents.create_raw(request={ "data": "The quick brown fox jumps over the lazy dog. A common phrase used to test typewriters." }) print(f"Document created with ID: {document.id}") # Wait for the document to be ready (simplified polling for demonstration) print("Waiting for document to be ready...") while True: doc_status = ragie_client.documents.get(document_id=document.id) if doc_status.status == "ready": print(f"Document {document.id} is ready.") break # In a real application, you'd add a delay (e.g., time.sleep(1)) and/or timeout # Retrieve chunks based on a query print("Retrieving chunks...") retrieval = ragie_client.retrievals.retrieve(request={"query": "What is a common phrase?"}) if retrieval.chunks: for chunk in retrieval.chunks: print(f"Retrieved chunk: {chunk.text}") else: print("No chunks retrieved for the query.") except Exception as e: print(f"An error occurred: {e}") # Consider handling specific ragie.models.RagieError for API-related issues
Debug
Known issues
breakingThe SDK is currently in beta. Breaking changes may occur between versions without a major version update. Users are strongly advised to pin their usage to a specific package version to prevent unexpected breaks.
fix
Pin the `ragie` package version in your `requirements.txt` or `pyproject.toml` (e.g., `ragie==1.15.1`).
affects: All versions while in beta
gotchaImproper resource management can lead to open HTTP connections and memory leaks in long-lived applications. The `Ragie` client manages underlying `httpx` clients.
fix
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.
affects: All versions
gotchaDocuments ingested into Ragie are not immediately ready for retrieval. They go through a lifecycle (e.g., `pending`, `partitioning`, `indexed`, `ready`). Attempting to retrieve from a document that is not yet 'ready' will yield incomplete or no results.
fix
Implement a polling mechanism or listen for webhooks to confirm the document's status is 'ready' before attempting retrievals.
affects: All versions
gotchaInvalid or missing API keys are a common source of authentication failures (401 errors). Additionally, exceeding plan-based rate limits or quotas (e.g., page processing, retrieval limits) can result in 402 or 429 errors.
fix
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.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'ragie'
The `ragie` library is not installed in the current Python environment.
fix
pip install ragie
ragie.exceptions.AuthenticationError: Invalid API key provided. Please check your RAGIE_API_KEY.
The provided Ragie API key is missing or invalid, preventing successful authentication with the Ragie API.
fix
from ragie import RagieClient
# Ensure RAGIE_API_KEY is set in environment or passed directly
client = RagieClient(api_key="your_actual_api_key_here")
AttributeError: 'RagieClient' object has no attribute 'upload_document'
The `upload_document` method is not directly available on the `RagieClient` object and needs to be accessed via its `documents` attribute, or the method name has changed.
fix
from ragie import RagieClient
client = RagieClient()
client.documents.upload(file_path="path/to/your/document.pdf")
TypeError: Argument 'file' must be a file-like object, not str
The document ingestion method expects a file-like object (e.g., an opened file in binary mode), but received a string representing the file path.
fix
from ragie import RagieClient
client = RagieClient()
with open("path/to/your/document.pdf", "rb") as f:
    client.documents.upload(file=f)
Upgrade
Version history
2.0.0latest on PyPI · released Jun 3, 2026
Audit
Dependencies
httpxrequiredUsed internally for API calls; can be customized with a custom HTTP client instance.
openaioptionalCommonly used alongside Ragie for LLM interactions in RAG applications.
python-dotenvoptionalRecommended for securely managing API keys in development environments.
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
ragie — pip install ragie · libregistry