Install
openclaw skills install skill-for-ragflowOperate RAGFlow v0.25.6 deployments through the bundled Node CLI and API client. Use when user needs to manage RAGFlow datasets, documents, uploads, parsing, chunks, retrieval, chat assistants, chat sessions, agents, agent sessions, embedded website access, metadata filters, model discovery, system settings, or API diagnostics. Also use when the user asks about knowledge bases, document chunking, vector retrieval, embed code, or RAG workflows and the current context explicitly involves a RAGFlow server or deployment.
openclaw skills install skill-for-ragflowUse this skill to operate RAGFlow through scripts/ragflow.js. The CLI wraps the full v0.25.6 REST API - every action goes through node {baseDir}/scripts/ragflow.js <command> [options]. Prefer --json on any command when the output will be parsed or chained into another step.
RAGFLOW_URL and RAGFLOW_API_KEY in the environment or this skill's .env.RAGFLOW_DELETE_CHUNK_RETRIES and RAGFLOW_DELETE_CHUNK_RETRY_DELAY_MS.RAGFLOW_REPRO_TIMEOUT_MS, RAGFLOW_REPRO_DELETE_RETRIES, RAGFLOW_REPRO_DELETE_RETRY_DELAY_MS, and RAGFLOW_REPRO_EMBEDDING_MODEL.https:// for RAGFLOW_URL to protect the API key in transit. Local development (http://localhost) is acceptable for testing.RAGFLOW_API_KEY in chat messages or commit it to version control. Use environment variables or the skill's .env file.| Scenario | Commands |
|---|---|
| Knowledge base setup | create-dataset, list-datasets, get-dataset, update-dataset, delete-datasets |
| Document ingestion | upload-documents, list-documents, get-document, update-document, delete-documents, download-document, preview-document, metadata-summary |
| Parsing & chunking | start-parsing, stop-parsing, wait-parsing, list-chunks, add-chunk, update-chunk, delete-chunks |
| Direct retrieval | retrieve |
| Chat assistant | create-chat, list-chats, get-chat, update-chat, patch-chat, delete-chats |
| Chat sessions | create-session, list-sessions, delete-sessions, chat, chat-session |
| Agent | create-agent, list-agents, get-agent, update-agent, delete-agents |
| Agent Tags | list-agent-tags, update-agent-tags |
| Agent sessions | create-agent-session, list-agent-sessions, delete-agent-sessions, agent-chat |
| Connector | list-connectors, create-connector, get-connector, update-connector, delete-connector |
| RAPTOR | run-raptor, trace-raptor |
| Embedded website access | list-system-tokens, create-system-token, delete-system-token, embed-code, embed-info, embed-chat, embed-agent-chat |
| Model discovery | list-models |
| System | system-version, get-log-levels, set-log-level |
create-dataset --name "My KB" --chunk-method naiveupload-documents --dataset <id> --files ./doc1.pdf ./doc2.txtstart-parsing --dataset <id> --doc-ids <doc_id1> <doc_id2>wait-parsing --dataset <id> --doc-ids <doc_id1> <doc_id2>retrieve --question "What is X?" --datasets <id>create-chat --name "Q&A" --datasets <id> --llm-id qwen-turbo@Tongyi-Qianwencreate-session --chat <chat_id>chat-session --chat <chat_id> --session <session_id> --question "Hello"create-agent --title "Assistant" --dsl @agent_dsl.jsoncreate-agent-session --agent <agent_id>agent-chat --agent <agent_id> --session <session_id> --question "Hello"list-agent-tags --agent <agent_id>update-agent-tags --agent <agent_id> --tags "Tag1,Tag2"create-connector --name "GitHub" --type github --token <token>list-connectorsget-connector --id <id>run-raptor --dataset <id> --method raptortrace-raptor --id <id>
agent-chat is streaming by default. Use --stream false when you need the final JSON result in one response.embed-code --chat <chat_id> --type fullscreen or embed-code --agent <agent_id> --type widgetembed-info --chat <chat_id> or embed-info --agent <agent_id>embed-chat --chat <chat_id> --question "Hello" or embed-agent-chat --agent <agent_id> --question "Hello"embed-chat automatically creates the embedded chatbot session when --session is omitted. RAGFlow's shared-site route only creates a session and returns the prologue on the first no-session request, so the CLI bootstraps session_id first and then sends the real question.
The first step in any RAGFlow operation is resolving the target resource ID. After that, choose the right path:
RagflowClient method.delete-datasets, delete-documents, delete-chunks, delete-chats, delete-sessions, or delete-agents - unless the resource is a temporary artifact you created in the same workflow and the user asked you to clean up.filename as the document name. If a user attachment is materialized as a task ID or temporary path, pass the original filename inline: upload-documents --files <original-name>=<path>.model@provider format. When creating datasets with --embedding-model or chat assistants with --llm-id, the server expects the full identifier, for example text-embedding-v4@Tongyi-Qianwen or qwen-turbo@Tongyi-Qianwen, not a numeric model row ID. Use list-models to discover model names and providers.chat-session posts to /api/v1/chat/completions with chat_id and session_id in the body.POST /api/v1/chat/completions now appends only the latest message to stored history. Use --pass-all-history or set pass_all_history_messages: true in the API payload to replace the entire history. conversation_id is accepted as an alias for session_id.embed-code, embed-info, embed-chat, and embed-agent-chat use the shared-site /api/v1/chatbots/* or /api/v1/agentbots/* routes. If --beta is not supplied, the CLI reuses the first /api/v1/system/tokens item with beta or creates one. For chatbot completions, the CLI auto-bootstraps session_id unless --session is supplied.beta values, and embed URLs or iframe HTML containing auth= are operational secrets. Use them when needed for the task, but do not print the full values back to the user unless the user explicitly asks for them.embed-code uses --origin when supplied; otherwise it falls back to RAGFLOW_URL. When the API base URL and the public web origin differ, pass --origin explicitly so the generated iframe points at the actual shared-site page.AGENT_GUIDE.md. In practice, hand-authored agents should include components, history, path, retrieval, variables, globals, and graph, plus graph.nodes[].data.name for every component-backed node.agent-chat posts to /api/v1/agents/chat/completions with agent_id in the body.Agent produces loop items, prefer an object-shaped structured output such as {"items":[...]} and point Iteration.params.items_ref at agent:0@structured.items. Start from references/examples/agents/04-iteration-agent.json.rm_chunk deleted chunks 0, expect N due to document-store refresh lag even when the chunk exists. The CLI handles this automatically - it retries after confirming the chunk is still visible via exact ID lookup. If retries still fail, run scripts/repro-delete-chunks.js for a clean diagnosis.When presenting results to the user, follow the templates in references/REFERENCE.md. Key conventions:
--json output. For the final user-facing response, convert that raw result into a concise summary that follows the reference templates instead of pasting the CLI payload verbatim.UNSTART, RUNNING, CANCEL, DONE, FAILtoken, beta, and any auth= query value unless the user explicitly asks for the secretFor embed and token-related commands, apply these response rules: