Files
SuperBizAgent-java/mvp/tables/知识域表-knowledge_domain.md
zhuyongxin 473bb5d004 docs(mvp): update RAG docs for py-rag extraction
- rewrite RAG architecture doc for py-rag service contract mapping, ingest and rebuild ops
- refresh observability/trace doc for post-L0 single-attempt semantics
- add py-rag chain exploration note; mark superseded Milvus/L0 notes with status banners
- close ISS-017 (superseded by L0 sinking); mark knowledge_domain table orphaned
- refresh architecture/mvp/engineering indexes
2026-09-30 17:03:50 +08:00

41 lines
1.7 KiB
Markdown
Raw Permalink 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
**状态**:孤儿表(2026-09-29 RAG 抽离后无写入方)
**来源**:`V009__add_knowledge_domain.sql`、`KnowledgeDomain`
> **2026-09-29 变更**:本表的写入方 `KnowledgeDomainService` 已随 RAG 模块抽离删除
> (L0 domain 分析下沉 py-rag)。表结构由 Flyway 保留(`ddl-auto: validate`),当前无读写方,
> 待后续迁移清理。历史数据仅供追溯。
## 定位
`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。