Files
SuperBizAgent-java/mvp/tables/知识域表-knowledge_domain.md
T

37 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 知识域表:knowledge_domain
**状态**:当前表
**来源**:`V009__add_knowledge_domain.sql`、`KnowledgeDomain`
## 定位
`knowledge_domain` 保存知识库领域级元数据,为 RAG backend 的 domain hint、检索选择和可观测性提供基础信息;它不是 Agent-facing Tool contract。
## 字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `id` | BIGINT | 是 | 自增主键 |
| `domain_id` | VARCHAR(64) | 是 | 领域 ID,通常对应文档 category,例如 `payment`、`infrastructure` |
| `description` | VARCHAR(256) | 否 | 领域描述 |
| `when_to_retrieve` | TEXT | 否 | 何时检索该领域的提示说明 |
| `document_count` | INT | 是 | 当前领域文档数量 |
| `created_at` | DATETIME | 是 | 创建时间 |
| `updated_at` | DATETIME | 是 | 更新时间 |
## 索引
| 索引 | 字段 | 用途 |
|---|---|---|
| unique | `domain_id` | 保证领域 ID 唯一 |
## 关系
- `knowledge_domain.domain_id` 与 `api_document.metadata` 或向量库 chunk metadata 中的 `category` 逻辑关联。
- 当前没有数据库外键,领域文档数量由服务逻辑维护。
## 注意点
- `when_to_retrieve` 是检索策略提示,不是事实证据。
- Diagnosis Agent 与 SemanticGuard 不能把领域描述当作诊断结论依据;事实仍应来自当前 Run 经 EvidenceGuard 验真的 Tool evidence。