docs(agent): 补全会话与对话设计

This commit is contained in:
2026-06-01 00:52:40 +08:00
parent b26edb8877
commit b6e1e209a2
8 changed files with 246 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
# Agent 会话模块后端实现
## 1. 当前实现落点
当前 Agent 定义和调试入口位于 `com.bruce.agent`。后续会话能力建议继续放在该包下。
## 2. Controller 草案
- `AgentDefinitionController`:保留定义管理和兼容调试入口。
- `AgentSessionController`:新增会话查询、详情和消息发送。
- `AgentRunController`:新增运行入口,关联 Workflow 或模型调用。
## 3. Service 草案
| Service | 职责 |
|---------|------|
| `IAgentDefinitionService` | Agent 定义管理 |
| `IAgentSessionService` | 会话创建、关闭、查询 |
| `IAgentMessageService` | 消息写入和引用保存 |
| `IAgentRunService` | 对话编排、RAG 召回、模型调用 |
| `IAgentCapabilityBindingService` | 能力绑定维护 |
## 4. 校验规则
- Agent 必须启用才允许发起对话。
- RAG 对话必须绑定可用知识库和 Embedding 配置。
- 消息内容不能为空。
- `citation_json` 必须是数组结构。
- 会话关闭后不允许继续写入消息。