ragflow-python-sdk

ragflow-python-sdk is a skill for Claude Code from infiniflow/ragflow. It costs 64 tokens per session (1,004 once invoked), scanned A, original, Apache-2.0.

A Python library for connecting software to a RAGFlow server. RAGFlow stores documents, breaks them into searchable passages, and uses those passages to answer questions.

In plain words
What is it for?
Use it to create datasets, upload and parse files, retrieve passages, create chat assistants and sessions, and ask questions from Python code.
Why use it?
It removes the need to build HTTP requests and document-processing steps by hand when automating a RAG pipeline. It also makes it clear that uploaded documents must be parsed before they can be searched.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ragflow plugin — 3 skills, 1 MCP server shipped together

Good fit Use it to create datasets, upload and parse files, retrieve passages, create chat assistants and sessions, and ask questions from Python code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/infiniflow/ragflow/ragflow-python-sdk
About the project

RAGFlow is an open-source Retrieval-Augmented Generation engine that combines document retrieval, context management, and agent capabilities to help build AI applications. Developers use it to turn complex data into searchable, context-aware systems through workflows, datasets, and agent templates; the catalogue entries support working with RAGFlow.

infiniflow/ragflow · 95,209 stars · on GitHub · ragflow.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add infiniflow/ragflow --skill ragflow-python-sdk
Clone the repo
git clone --depth 1 https://github.com/infiniflow/ragflow

Made for: Claude Code.

Or install ragflow, the plugin that ships this one along with the rest of its 3 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ragflow-python-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/infiniflow/ragflow/ragflow-python-sdk/github.svg)](https://agentmods.dev/skills/infiniflow/ragflow/ragflow-python-sdk)
Your own site
<a href="https://agentmods.dev/skills/infiniflow/ragflow/ragflow-python-sdk"><img src="https://agentmods.dev/badge/skills/infiniflow/ragflow/ragflow-python-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ragflow-python-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/infiniflow/ragflow/ragflow-python-sdk"><img src="https://agentmods.dev/badge/skills/infiniflow/ragflow/ragflow-python-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00064 $0.01004
Opus 5.5 $0.00026 $0.00402
Sonnet 5.5 $0.00013 $0.00201
Haiku 4.5 $0.00006 $0.00100

Measured 3d ago against content hash d2468d8c1f1f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ragflow-python-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ragflow/skills/ragflow-python-sdk/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RAGFlow Python SDK

References: docs/references/python_api_reference.md, docs/references/http_api_reference.md, sdk/python/ragflow_sdk/.

python3.13 -m pip install "ragflow-sdk>=1.0.0,<2" openai

The repository SDK is version 1.0.0 and requires Python 3.13.

import os
from ragflow_sdk import RAGFlow

rag = RAGFlow(api_key=os.environ["RAGFLOW_API_KEY"], base_url="http://localhost:9380")

Ingest

dataset = rag.create_dataset(name="handbook")          # parser_id="table" etc. for other chunk methods
with open("policy.pdf", "rb") as f:
    docs = dataset.upload_documents([{"display_name": "policy.pdf", "blob": f.read()}])

ids = [d.id for d in docs]
for doc_id, status, chunks, tokens in dataset.parse_documents(ids):   # blocks until done
    print(doc_id, status, chunks, tokens)
    if status != "DONE":
        raise RuntimeError(f"parse failed for {doc_id}: {status}")

parse_documents yields DONE, FAIL, or CANCEL as status rather than raising on failure; stop or report unless the status is DONE. Use dataset.async_parse_documents(ids) to start parsing without waiting. Uploading alone does not make documents searchable; they must be parsed. avatar/description are set afterwards with dataset.update(...).

Retrieve

chunks = rag.retrieve(
    dataset_ids=[dataset.id],
    question="How many vacation days do new hires get?",
    page_size=10,
    similarity_threshold=0.2,
    vector_similarity_weight=0.3,
)
for c in chunks:
    print(c.content)

All document_ids passed together must share an embedding model.

Chat

assistant = rag.create_chat("Handbook bot", dataset_ids=[dataset.id])
session = assistant.create_session()
# ask() always yields Message objects; consume with next() when stream=False.
answer = next(session.ask("How many vacation days do new hires get?", stream=False))
print(answer.content)

# Streaming yields intermediate content then a final full answer; take the last.
parts = list(session.ask("And after five years?", stream=True))
print(parts[-1].content)

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 121 lines · 64 tokens per session scan A d2468d8c1f1f

Subscribe to this mod's changes

ragflow-python-sdk is a skill published in the GitHub repository infiniflow/ragflow (95,209 stars, last pushed today), licensed Apache-2.0. It adds 64 tokens to every session and 1,004 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-03.

Related

ragflow-python-sdk compared with skills from other repositories

ragflow-python-sdk next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ragflow-python-sdkinfiniflow/ragflowSkill95ktodayApache-2.0A64Claude Code
ragericrisco/rsc-harnessSkill7093d agoMITA79Claude Code, Codex
pinecone-quickstartpinecone-io/pinecone-cursor-pluginSkill323d agoMITA94Cursor
pinecone-n8npinecone-io/pinecone-cursor-pluginSkill323d agoMITA67Cursor
pinecone-full-text-searchpinecone-io/pinecone-cursor-pluginSkill323d agoMITA179Cursor
pinecone-clipinecone-io/pinecone-cursor-pluginSkill323d agoMITA74Claude Code, Cursor
pinecone-helppinecone-io/pinecone-cursor-pluginSkill323d agoMITA52Cursor