RAGFlow Dataset And Retrieval
Use only the bundled scripts in scripts/.
Prefer --json so returned fields can be relayed exactly.
Follow reference.md for all user-facing output.
Use This Skill When
- - the user wants to create, list, inspect, update, or delete RAGFlow datasets
- the user wants to upload, list, update, or delete documents in a dataset
- the user wants to start parsing, stop parsing, or check parse progress
- the user wants to retrieve chunks from one or more datasets
- the user wants to list configured RAGFlow models
Core Workflow
- 1. Resolve the target dataset or document IDs first.
- Run the matching script from
scripts/. - Use
--json unless a script only needs a simple text response. - Return API fields exactly; do not guess missing details.
Common commands:
CODEBLOCK0
Guardrails
- - For any delete action, list the exact items first and require explicit user confirmation before executing.
- Delete only by explicit dataset IDs or document IDs. If the user gives names or fuzzy descriptions, resolve IDs first.
- Upload does not start parsing. Start parsing only when the user asks for it.
- INLINECODE5 returns immediately after the start request; use
parse_status.py for progress. - For progress requests, use
parse_status.py on the most specific scope available:
- dataset specified: inspect that dataset
- document IDs specified: pass
--doc-ids
- no dataset specified: list datasets first, then aggregate status across datasets
- - If a parse status result includes
progress_msg, surface it directly. For FAIL, treat it as the primary error detail. - Use
--retrieval-test only for single-dataset debugging or when the user explicitly asks for that endpoint.
Output Rules
- - Follow
reference.md. - Use tables for 3+ items when possible.
- Preserve
api_error, error, message, and related fields exactly as returned. - Never fabricate progress percentages or inferred causes.
RAGFlow 数据集与检索
仅使用 scripts/ 目录下自带的脚本。
优先使用 --json 参数,以便精确传递返回字段。
所有面向用户的输出均遵循 reference.md。
使用此技能的时机
- - 用户需要创建、列出、查看、更新或删除 RAGFlow 数据集
- 用户需要上传、列出、更新或删除数据集中的文档
- 用户需要开始解析、停止解析或检查解析进度
- 用户需要从一个或多个数据集中检索数据块
- 用户需要列出已配置的 RAGFlow 模型
核心工作流程
- 1. 首先解析目标数据集或文档的 ID。
- 运行 scripts/ 中对应的脚本。
- 除非脚本仅需简单文本响应,否则使用 --json 参数。
- 精确返回 API 字段;不要猜测缺失的细节。
常用命令:
bash
python3 scripts/datasets.py list --json
python3 scripts/datasets.py info DATASET_ID --json
python3 scripts/datasets.py create 示例数据集 --description 季度报告 --json
python3 scripts/updatedataset.py DATASETID --name 已更新数据集 --json
python3 scripts/upload.py DATASET_ID /path/to/file.pdf --json
python3 scripts/upload.py list DATASET_ID --json
python3 scripts/updatedocument.py DATASETID DOC_ID --name 已更新文档 --json
python3 scripts/parse.py DATASETID DOCID1 [DOC_ID2 ...] --json
python3 scripts/stopparsedocuments.py DATASETID DOCID1 [DOC_ID2 ...] --json
python3 scripts/parsestatus.py DATASETID --json
python3 scripts/search.py 查询内容 --json
python3 scripts/search.py 查询内容 DATASET_ID --json
python3 scripts/search.py --dataset-ids DATASETID1,DATASETID2 --doc-ids DOCID1,DOCID2 查询内容 --json
python3 scripts/search.py --retrieval-test --kb-id DATASET_ID 查询内容 --json
python3 scripts/list_models.py --json
约束规则
- - 对于任何删除操作,先列出具体项目,并在执行前要求用户明确确认。
- 仅通过明确的数据集 ID 或文档 ID 进行删除。如果用户提供名称或模糊描述,先解析出 ID。
- 上传操作不会自动开始解析。仅在用户要求时才开始解析。
- parse.py 在发出开始请求后立即返回;使用 parsestatus.py 查看进度。
- 对于进度请求,在可用的最具体范围内使用 parsestatus.py:
- 指定了数据集:检查该数据集
- 指定了文档 ID:传递 --doc-ids 参数
- 未指定数据集:先列出数据集,然后汇总各数据集的解析状态
- - 如果解析状态结果中包含 progress_msg,直接展示。对于 FAIL 状态,将其作为主要错误详情处理。
- 仅在对单个数据集进行调试或用户明确要求该端点时,才使用 --retrieval-test 参数。
输出规则
- - 遵循 reference.md。
- 当项目数量为 3 个或以上时,尽可能使用表格。
- 保留 api_error、error、message 及相关字段的原始返回内容。
- 切勿编造进度百分比或推断原因。