基地址:环境变量
KNOWHUB_API(默认http://localhost:9999)
POST /api/agent
所有远程子 Agent 共用这一个入口,通过 agent_type 区分。
{
"agent_type": "remote_librarian", // 必填,见下方两个可选值
"task": "任务描述", // 必填
"messages": null, // 可选,预置消息 [{role, content}]
"continue_from": null, // 可选,传入 sub_trace_id 续跑
"skills": null // 可选,指定 skill 白名单
}
{
"sub_trace_id": "trace-xxx",
"status": "completed", // completed | failed
"summary": "执行结果摘要",
"stats": {},
"error": null
}
默认 600 秒(环境变量 REMOTE_AGENT_TIMEOUT 可调)。
agent_type: "remote_librarian"
用途:向知识库提问、上传/整理知识。
示例 — 查询知识:
POST /api/agent
{
"agent_type": "remote_librarian",
"task": "查询 ControlNet 在姿态控制方面的使用经验和最佳实践"
}
示例 — 上传知识:
POST /api/agent
{
"agent_type": "remote_librarian",
"task": "{\"task\": \"ControlNet 姿态控制\", \"content\": \"经验内容...\", \"types\": [\"strategy\"]}",
"skills": ["upload_strategy"]
}
agent_type: "remote_research"
用途:使用浏览器做深度调研,搜索外部信息并沉淀为知识。
示例:
POST /api/agent
{
"agent_type": "remote_research",
"task": "调研 2026 年主流 AI 图像生成工具的 ControlNet 支持情况,对比各平台的精度和易用性"
}
示例 — 续跑(上次中断的调研继续执行):
POST /api/agent
{
"agent_type": "remote_research",
"task": "继续上次的调研",
"continue_from": "trace-xxx-yyy"
}