Skip to main content

RAGfly Python SDK

Official Python client for RAGfly. It speaks the English REST /v1 contract.

Using TypeScript/JavaScript? See the TypeScript SDK (npm install @ragfly/sdk) — same surface.

Install

pip install ragfly

Quick start

from ragfly import RAGfly

client = RAGfly(api_key="rf_...")

# RAG end to end (a long answer returns status "IN_PROGRESS": see get_answer below)
resp = client.ask("What are the Q1 sales figures?")
print(resp.status, resp.answer)

# Retrieval only
results = client.search("maintenance contracts", limit=5)
for doc in results.documents:
    print(doc.name, doc.max_similarity)

ask waits up to about 25 seconds. A longer answer comes back with status="IN_PROGRESS", its conversation_id and an empty answer; poll get_answer(conversation_id) every few seconds until status is COMPLETED (or FAILED). The question is charged once.

Operations

Everything the RAGfly application lets your user do is available as an operation, with the same permissions and audit as the web app.

ops = client.list_operations()["operations"]              # what this key can run
schema = client.get_operation("document_types.update")    # input_schema / output_schema

client.run_operation("document_types.update", {"code": "TDOC_...", "name": "Invoices"})

# write_confirm operations (deletes, reverts, resets) need confirm=True
preview = client.run_operation("document_types.delete", {"code": "TDOC_..."})
assert preview["executed"] is False
client.run_operation("document_types.delete", {"code": "TDOC_..."}, confirm=True)

Errors raise RAGflyError with status_code, the public code (NOT_FOUND, VALIDATION_ERROR, …) and details.

API keys

Create an API key from app.ragfly.ai → API Keys. A key only works on /v1; creating or revoking keys needs a signed-in person.

Methods

Area Methods
Session and documents session, set_active_workspace, unset_active_workspace, set_active_area, list_areas, list_locations, list_documents, get_document, document_edges, search, search_filtered, ingest_public_url, public_url_ingestion_status
Collections list_collections, get_collection, refresh_collection, save_collection, compose_collections, read_collection, save_search_as_collection
Queue, catalog, skills queue, list_runs, catalog, list_document_types, list_characteristics, get_function, list_skills, get_skill, run_skill
Answers and agents ask, get_answer, get_answering_guide, list_destinations, agent_context, run_agent_tool
Organization get_organization, update_organization, draft_organization
Usage, conversations, processes get_usage, list_conversations, delete_conversation, list_processes, get_process, update_process
Operations list_operations, get_operation, run_operation

Metadata

Release files for ragfly 1.1.0

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

Source distribution (sdist)

Source distribution for ragfly 1.1.0
File Size Uploaded Provenance Actions
ragfly-1.1.0.tar.gz 16.5 kB Without provenance Details for ragfly-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ragfly 1.1.0
File Interpreter ABI Platform Actions
ragfly-1.1.0-py3-none-any.whl Python 3 none any Details for ragfly-1.1.0-py3-none-any.whl

Total release size: 27.0 kB

Release files / ragfly-1.1.0.tar.gz

Download URL ragfly-1.1.0.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a00fb06539c747eaa893831e657330278b7bd32d7915e20e9e211c715b7bef84
BLAKE2b-256 checksum
How to use checksums
63ffc9f9af7272eea62ec71c6420fa94e57cd1e378c02acdff36908a0d46b5a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ragfly-1.1.0-py3-none-any.whl

Download URL ragfly-1.1.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4623610d29f0914f9adf8cbf52aedbf0d26f946e662a54634b1824ff44322c8a
BLAKE2b-256 checksum
How to use checksums
94f3ecfeffdcc36c4f731cf2abbb31f8e3b602c379bcc61c3d9cf50b47b8bc4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ragfly 1.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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