docs(project): 调整中文模块文档位置
This commit is contained in:
32
docs/数据库设计/5.Agent会话数据库设计.md
Normal file
32
docs/数据库设计/5.Agent会话数据库设计.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Agent 会话数据库设计
|
||||
|
||||
## 1. 表结构
|
||||
|
||||
| 表 | 说明 |
|
||||
|----|------|
|
||||
| `agent_definition` | Agent 定义 |
|
||||
| `agent_session` | Agent 会话 |
|
||||
| `agent_message` | Agent 消息 |
|
||||
| `agent_capability_binding` | 能力绑定 |
|
||||
|
||||
## 2. 关键约束
|
||||
|
||||
- `agent_definition.agent_code` 唯一。
|
||||
- `agent_session.session_code` 唯一。
|
||||
- `agent_session.agent_id` 引用 `agent_definition`。
|
||||
- `agent_session.workflow_run_id` 可引用 `workflow_run`。
|
||||
- `agent_message.session_id` 引用 `agent_session`。
|
||||
- `agent_capability_binding` 使用 `(owner_type, owner_id, capability_type, capability_id)` 唯一。
|
||||
|
||||
## 3. JSON 字段
|
||||
|
||||
- `agent_session.metadata_json` 保存会话扩展信息。
|
||||
- `agent_message.citation_json` 保存引用切片摘要。
|
||||
- `agent_capability_binding.config_json` 保存能力绑定配置。
|
||||
|
||||
## 4. 脚本
|
||||
|
||||
- `script/sql/agent_definition.sql`
|
||||
- `script/sql/agent_session.sql`
|
||||
- `script/sql/agent_capability_binding.sql`
|
||||
- `docs/STUDIO_PROTOTYPE_SCHEMA.sql`
|
||||
Reference in New Issue
Block a user