- Add AI学习助手 agent creation script with all 39 tools, 3-layer KG+RAG memory - Add renshenguo (人参果) feishu bot integration (app_service + ws_handler) - Register renshenguo WS client in main.py startup - Add RENSHENGUO_APP_ID / RENSHENGUO_APP_SECRET / RENSHENGUO_AGENT_ID config - Reorganize docs from root into docs/ subdirectories - Move startup scripts to scripts/startup/ - Various backend optimizations and tool improvements Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
2.3 KiB
Markdown
40 lines
2.3 KiB
Markdown
# 知你客服 16 号 · 能力说明(B:Loop + 循环体内 LLM)
|
||
|
||
## 定位
|
||
|
||
在 **知你客服 15 号**(全量工具 + 单节点 `max_tool_iterations`)基础上,采用 **B 能力**:在同一次 API 调用内,用 **循环节点** 对 `loop_rounds` 数组**逐段**执行 **`zhini16-llm-subtask`**,再通过 **`zhini16-code-merge-rounds`** 合并各段 `reply`,供下游 Cache / End 使用。
|
||
|
||
| 项目 | 15 号 | 16 号 |
|
||
|------|--------|--------|
|
||
| 多轮工具 | 单 LLM 节点内 `max_tool_iterations` | **每段**子 LLM 仍有 `max_tool_iterations`(默认 12) |
|
||
| 多次顶层 LLM | 无(单次 `llm-unified`) | **有**(段数 = `len(loop_rounds)`,默认 3) |
|
||
| 主链 `llm-unified` | 使用 | **从主链摘除**(节点可保留在画布,无连线) |
|
||
|
||
## 拓扑(脚本写入)
|
||
|
||
1. `zhini16-code-build-rounds`:注入 `loop_rounds`(默认 `[1,2,3]`,可由环境变量改段数)。
|
||
2. `zhini16-loop-main`:`items_path=loop_rounds`,`item_variable=round`。
|
||
3. 循环体:`zhini16-llm-subtask` → `zhini16-loop-end`(**须为 loop 的第一条出边**,脚本已排序)。
|
||
4. 循环后:`zhini16-code-merge-rounds`:解析各段末行 JSON,拼接 `reply`,合并 `user_profile` 写入 `user_profile_update`,并设置 `right` / `reply`。
|
||
5. 原 `llm-unified` 的后继(如 Cache 写、End)接到 `merge` 之后。
|
||
|
||
## 引擎与限制
|
||
|
||
- 循环体为**单链**简化实现;勿在段内再叠复杂分支。
|
||
- 段与段之间**不自动**传递上一轮合并后的临时字段,仅依赖上游传入的 `memory` / `query` 等(与 `知你客服15号_循环工作流设计.md` 一致)。
|
||
- 总成本 ≈ **段数 ×(每段 tokens + 工具调用)**,请控制 `ZHINI16_LOOP_ROUNDS`(上限 8)。
|
||
|
||
## 创建 / 更新脚本
|
||
|
||
```text
|
||
backend/scripts/create_zhini_kefu_16.py
|
||
```
|
||
|
||
- 默认从 **知你客服15号** 复制为 **知你客服16号**;已存在则更新工作流与描述。
|
||
- 环境变量:`ZHINI16_LOOP_ROUNDS`(默认 3)、`ZHINI16_SUBTASK_MAX_TOOL_ITERATIONS`(默认 12)。
|
||
|
||
## 与 15 号文档的关系
|
||
|
||
- **A 能力**(仅提高 `max_tool_iterations`):见 `知你客服15号能力文档.md`。
|
||
- **B 能力**(Loop 拓扑与 `node_outputs` 注意点):见 `知你客服15号_循环工作流设计.md`。
|