Files
AI-VideoAssistant/docs/content/customization/knowledge-base.md
Xin Wang b300b469dc Update documentation for Realtime Agent Studio with enhanced content and structure
- Revised site name and description for clarity and detail.
- Updated navigation structure to better reflect the organization of content.
- Improved changelog entries for better readability and consistency.
- Migrated assistant configuration and prompt guidelines to new documentation paths.
- Enhanced core concepts section to clarify the roles and capabilities of assistants and engines.
- Streamlined workflow documentation to provide clearer guidance on configuration and usage.
2026-03-09 05:38:43 +08:00

87 lines
2.9 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.
# 知识库
知识库负责承载助手需要引用的私有事实、业务资料和长文档内容,是 RAG检索增强生成能力的正式说明页。
## 什么时候应该用知识库
当问题答案主要来自“稳定文档”而不是实时外部动作时,优先使用知识库:
- 产品说明、政策条款、操作流程、培训材料
- 内部手册、FAQ、规范文档
- 需要被多位助手复用的领域知识
如果任务本质上是“查状态、写数据、执行动作”,那通常更适合 [工具](tools.md),而不是知识库。
## 工作原理
```mermaid
flowchart LR
subgraph Indexing["索引阶段"]
Doc[文档] --> Chunk[分块]
Chunk --> Embed[向量化]
Embed --> Store[(向量数据库)]
end
subgraph Query["查询阶段"]
Q[用户问题] --> Search[相似度检索]
Store --> Search
Search --> Context[相关片段]
Context --> LLM[LLM 生成回答]
end
```
核心原则很简单:把长文档转成可检索的片段,在用户提问时只把最相关的内容送给模型。
## 适合放进知识库的内容
| 适合 | 不适合 |
|------|--------|
| 稳定规则、标准答案、产品文档 | 高频变化的实时状态 |
| 领域术语、说明手册、培训材料 | 需要外部系统写入或变更的动作 |
| 需要跨助手复用的内容 | 只在单次会话里临时生成的数据 |
## 内容准备建议
- 优先上传结构清晰、主题明确的文档
- 对超长文档按主题拆分,减少一次索引的噪声
- 标题、章节名和表格说明对召回质量很重要,不要全部删掉格式信息
- 与其堆很多相近文档,不如先清理重复、过期和相互冲突的内容
## 常见配置项
| 配置项 | 作用 | 常见做法 |
|--------|------|----------|
| **相似度阈值** | 过滤弱相关结果 | 从保守值起步,再按误召回调 |
| **返回数量** | 控制一次送给模型的候选片段数 | 先少后多,避免上下文污染 |
| **分块大小** | 决定每个文档片段的长度 | 按文档类型和问题粒度调整 |
## 创建与维护
### 最小流程
1. 新建知识库
2. 上传文档
3. 完成索引
4. 用典型问题测试召回结果
5. 绑定到目标助手
### 日常维护
- 删除过期或互相矛盾的文档
- 当业务口径变化时,优先更新知识库而不是只改提示词
- 为关键问题准备固定测试问句,观察召回是否稳定
## 与助手的关系
知识库不是独立产品入口,而是助手的能力层:
- 助手决定是否、何时、以什么风格使用知识
- 知识库决定能够提供哪些事实片段
- 工作流和工具可以与知识库并用,但承担不同职责
## 相关文档
- [助手概念](../concepts/assistants.md) - 知识库在助手能力层中的位置
- [LLM 模型](models.md) - 为知识库准备嵌入或重排模型
- [工具](tools.md) - 当任务需要执行动作时,优先考虑工具而不是知识库