2134
by @caesergattuso
Use for RAGFlow dataset and retrieval tasks: create, list, inspect, update, or delete datasets; list, upload, update, or delete documents in a dataset; start...
clawhub install 1234📖 About This Skill
name: ragflow-dataset-ingest description: "Use for RAGFlow dataset and retrieval tasks: create, list, inspect, update, or delete datasets; list, upload, update, or delete documents in a dataset; start or stop parsing uploaded documents; check parser status through
parse_status.py; and retrieve relevant chunks from RAGFlow datasets with search.py."
RAGFlow Dataset And Retrieval
Use only the bundled scripts in scripts/.
Prefer --json for script execution so the returned fields can be relayed exactly.
Trigger Phrases
Use this skill when the user intent matches any of these actions, in either Chinese or English, even if the wording is informal.
Workflow
For one-off usage, pass --base-url and --api-key-file.
For repeated usage, run one command with --save-to-memory and let later commands reuse the memory file or prompt interactively when needed.
python scripts/datasets.py create "My Dataset" --description "Optional description" --base-url http://127.0.0.1:9380 --api-key-file /path/to/key.txt --save-to-memory
python scripts/datasets.py list
python scripts/datasets.py info DATASET_ID
python scripts/update_dataset.py DATASET_ID --name "Renamed Dataset"
1. Create a dataset or confirm the target dataset. 2. Upload files.
When asking the user to provide files, prefer explicit local file paths. If the user's client supports drag-and-drop, they may also drop files into the conversation, but local paths work best and large drag-and-drop uploads may fail.
python scripts/upload.py list DATASET_ID --json
python scripts/upload.py DATASET_ID /path/to/file1 [/path/to/file2 ...]
python scripts/update_document.py DATASET_ID DOC_ID --name "Renamed Document"
Upload output returns document_ids. Pass those IDs into the next step.
Use delete commands when the task is cleanup instead of ingest:
python scripts/datasets.py delete --ids DATASET_ID1,DATASET_ID2
python scripts/upload.py delete DATASET_ID --ids DOC_ID1,DOC_ID2
⚠️ DELETION REQUIRES CONFIRMATION: Before executing any delete operation (datasets or documents): 1. List items to be deleted with details (names, IDs, counts) 2. Ask user for explicit confirmation (e.g., "yes", "confirm", "proceed") 3. Only proceed after user confirms
For dataset deletion, execute only against explicit dataset IDs. For document deletion, execute only against explicit document IDs. If the user gives filenames or a fuzzy description, list documents first, resolve exact IDs, get confirmation, and only then run the delete command. Do not perform fuzzy batch delete operations.
3. Start parsing, or stop parsing when explicitly requested.
python scripts/parse.py DATASET_ID DOC_ID1 [DOC_ID2 ...]
python scripts/stop_parse_documents.py DATASET_ID DOC_ID1 [DOC_ID2 ...]
python scripts/parse_status.py DATASET_ID
parse.py only sends the parse request and returns immediately.
stop_parse_documents.py sends a stop request for explicit document IDs, then returns one current status snapshot for those documents.
Use parse_status.py when the user asks to check progress or current parser status.
If parse_status.py returns an error, return the error message directly and do not guess the cause.
If a document status includes progress_msg, surface it automatically. For FAIL documents, treat progress_msg as the primary error detail.
For later requests like "Check the progress" or "Which files are currently being parsed", resolve scope by specificity:
4. Retrieve chunks from one or more datasets when the user asks knowledge questions against RAGFlow.
python scripts/search.py "What does the warranty policy say?"
python scripts/search.py "What does the warranty policy say?" DATASET_ID
python scripts/search.py --dataset-ids DATASET_ID1,DATASET_ID2 --doc-ids DOC_ID1,DOC_ID2 "What does the warranty policy say?"
python scripts/search.py --threshold 0.7 --top-k 10 "query"
python scripts/search.py --retrieval-test --kb-id DATASET_ID "query"
5. Inspect configured LLM factories and models when the user asks what models are available.
python scripts/list_models.py --json
python scripts/list_models.py --include-details --json
python scripts/list_models.py --group-by factory --json
python scripts/list_models.py --all --group-by factory --include-details --json
Model Listing
typegroups instead of reintroducing the raw server response shapeProgress And Status Output
RUNNING items first when reporting progressError Output
api_error, present that object directly rather than replacing it with a guessed explanationScope
Support only:
retrieval_test for single-dataset debugging when neededDo not use this skill for chunk editing, memory APIs, or other RAGFlow capabilities outside dataset operations and retrieval.
Runtime Credentials
Do not use .env or shell environment variables for this skill.
Pass --base-url explicitly when needed. For the API key, prefer --api-key-file /path/to/key.txt, or let the script prompt securely.
All scripts also support --memory-file and --save-to-memory. The default memory file is ~/.codex/memories/ragflow_credentials.json.
Example memory file:
{
"base_url": "http://127.0.0.1:9380",
"api_key": "ragflow-your-api-key-here",
"dataset_ids": ["dataset-id-1", "dataset-id-2"]
}
base_url must point to a trusted RAGFlow server because upload and update operations send document bytes and document metadata to that base URL over the API.
api_key should be a minimally scoped bearer token for that server. Do not reuse a broader admin credential unless that access level is actually required for the task.
Do not pass the raw API key directly on the command line because shell history and process listings may expose it.
Endpoints
GET /api/v1/datasetsPOST /api/v1/datasetsPUT /api/v1/datasets/DELETE /api/v1/datasetsGET /api/v1/datasets//documents POST /api/v1/datasets//documents PUT /api/v1/datasets//documents/ DELETE /api/v1/datasets//documents POST /api/v1/datasets//chunks DELETE /api/v1/datasets//chunks POST /api/v1/retrievalPOST /api/v1/chunk/retrieval_testGET /v1/llm/my_llmsCommands
python scripts/datasets.py list --base-url http://127.0.0.1:9380 --api-key-file /path/to/key.txt
python scripts/datasets.py create "Example Dataset" --description "Quarterly reports" --save-to-memory
python scripts/datasets.py create "Example Dataset" --embedding-model bge-m3 --chunk-method naive --permission me
python scripts/datasets.py info DATASET_ID
python scripts/update_dataset.py DATASET_ID --name "Updated Dataset" --description "Updated description"
python scripts/datasets.py delete --ids DATASET_ID1,DATASET_ID2 --json
python scripts/upload.py list DATASET_ID --json
python scripts/upload.py DATASET_ID ./example.pdf --json
python scripts/update_document.py DATASET_ID DOC_ID --name "Updated Document" --enabled 1 --json
python scripts/upload.py delete DATASET_ID --ids DOC_ID1,DOC_ID2 --json
python scripts/datasets.py list --json
python scripts/parse.py DATASET_ID DOC_ID1 --json
python scripts/stop_parse_documents.py DATASET_ID DOC_ID1 --json
python scripts/parse_status.py DATASET_ID --json
python scripts/search.py "query"
python scripts/search.py "query" DATASET_ID --json
python scripts/search.py --dataset-ids DATASET_ID1,DATASET_ID2 --doc-ids DOC_ID1,DOC_ID2 "query" --json
python scripts/search.py --retrieval-test --kb-id DATASET_ID "query" --json
python scripts/list_models.py --json
python scripts/list_models.py --include-details --json
Once credentials are saved to the memory file, the later examples can omit --base-url and --api-key-file. If no memory value exists, the scripts will prompt for the missing value interactively.
Notes
--avatar, --description, --embedding-model, --permission, --chunk-method, and --language.--data JSON payloads through scripts/update_dataset.py.--data JSON payloads through scripts/update_document.py.parse.py returns immediately after the start request. Do not wait for parse status in this command.api_error, return that API error object directly instead of replacing it with a guessed explanation.error, api_error.message, status_error.message, or error_detail.message, surface that message to the user immediately.CANCEL immediately. Use the returned snapshot or scripts/parse_status.py to confirm the terminal state.scripts/parse_status.py DATASET_ID across all datasets.scripts/parse_status.py DATASET_ID without --doc-ids.--doc-ids.POST /api/v1/retrieval.scripts/search.py accepts dataset_ids from the memory file as the default dataset scope when the user does not specify dataset IDs explicitly.--retrieval-test only when the user wants single-dataset debugging or specifically asks for that endpoint.scripts/list_models.py calls GET /v1/llm/my_llms and uses the resolved bearer API key from --api-key-file, the memory file, or a secure prompt.📋 Tips & Best Practices
--avatar, --description, --embedding-model, --permission, --chunk-method, and --language.--data JSON payloads through scripts/update_dataset.py.--data JSON payloads through scripts/update_document.py.parse.py returns immediately after the start request. Do not wait for parse status in this command.api_error, return that API error object directly instead of replacing it with a guessed explanation.error, api_error.message, status_error.message, or error_detail.message, surface that message to the user immediately.CANCEL immediately. Use the returned snapshot or scripts/parse_status.py to confirm the terminal state.scripts/parse_status.py DATASET_ID across all datasets.scripts/parse_status.py DATASET_ID without --doc-ids.--doc-ids.POST /api/v1/retrieval.scripts/search.py accepts dataset_ids from the memory file as the default dataset scope when the user does not specify dataset IDs explicitly.--retrieval-test only when the user wants single-dataset debugging or specifically asks for that endpoint.scripts/list_models.py calls GET /v1/llm/my_llms and uses the resolved bearer API key from --api-key-file, the memory file, or a secure prompt.