AGENT SKILL

sdk-http-integration

Use RAGFlow public HTTP APIs, the Python SDK, OpenAI-compatible chat completions, API keys, streaming, references, and client error handling.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
sdk-http-integration
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use RAGFlow public HTTP APIs, the Python SDK, OpenAI-compatible chat completions, API keys, streaming, references, and client error handling.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

SDK and HTTP Integration

Use this sub-skill when a task needs to call RAGFlow through its public REST API, Python SDK, OpenAI-compatible chat completions, retrieval endpoint, API keys, or client-side troubleshooting.

Start here

  • For endpoint families, SDK objects, request shapes, and migration notes, read references/api-sdk-reference.md.
  • For authentication, status codes, RAGFlow response codes, and safe error handling, read references/auth-and-errors.md.
  • For common failures such as wrong base_url, API key errors, stream parsing, ID confusion, DELETE bodies, and server availability, read references/troubleshooting.md.
  • To prepare or optionally run a harmless health check request, use scripts/ragflow_api_smoke.py --help.

Public integration boundaries

  • Prefer the Python package ragflow-sdk for Python clients and RAGFlow(api_key, base_url, version="v1") for SDK entrypoints.
  • Use HTTP paths under /api/v1 for public REST calls; do not depend on backend module internals or frontend hooks.
  • For OpenAI-compatible chat calls, configure OpenAI clients with base_url="<server>/api/v1/openai/<chat_id>/chat" and call client.chat.completions.create(...).
  • Treat dataset, document, chunk, chat, agent, session, and memory IDs as distinct resource identifiers; do not substitute one ID type for another.
  • Use the public examples in these references as distilled patterns; do not require future agents to open repository examples or tests.

Typical workflows

  • Dataset/document/chunk flow: create or list a dataset, upload or create documents, parse documents, list or update chunks, then retrieve chunks through /api/v1/retrieval or RAGFlow.retrieve(...).
  • Chat flow: create or list a chat assistant, create or list sessions, ask through Session.ask(...) or /api/v1/chat/completions, and preserve reference metadata when citations matter.
  • Agent flow: list or get agents, create sessions when needed, call /api/v1/agents/chat/completions, and request traces only when debugging component behavior.
  • Memory flow: create/list/update/delete memories and add/search/retrieve messages through the SDK methods summarized in references/api-sdk-reference.md.

Safety defaults

  • Never print real API keys in generated curl commands or logs.
  • Do not run destructive deletes unless the user explicitly provides target IDs or asks for delete_all semantics.
  • Prefer non-stream requests while debugging request shape; add streaming only after auth, URL, and payload validation pass.
  • Run scripts/ragflow_api_smoke.py without --execute first; it only prints a redacted prepared request by default.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351