M2-04 Ingestion & Indexing Module #24
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
设计知习文档导入与索引模块,负责将用户上传的资料解析、清洗、切片、生成 embedding 并写入 Qdrant 索引。
本 Issue 只做模块架构设计,不直接实现代码。
背景说明
用户上传的 PDF/DOCX/TXT/MD 等文件需要经过解析才能变成可检索的数据。Ingestion 模块是资料从"文件"到"知识"的加工流水线:DocumentImport 管理导入任务的状态机,解析生成 parsed.md,切片生成 chunk,调用 AI Gateway 生成 embedding,写入 Qdrant 索引。
注意:Vision 在本阶段只做 fallback 预留——仅用于 OCR 失败或复杂图片页,不做完整多模态文档理解。
模块职责
本模块负责:
本模块不负责:
候选数据对象
解析流程设计
请设计完整的导入流水线:
从 COS 拉取文件 → 文件类型判断 → 选择解析器
→ PDF:提取文本 + 图片 OCR(如有图片)
→ DOCX:提取文本 + 内嵌图片 OCR
→ TXT/MD:直接读取
→ 文本清洗 → 切片
→ 每个 chunk 调用 AI Gateway 生成 embedding
→ 批量写入 Qdrant(通过 Vector & Retrieval Module)
→ 更新 DocumentImport 状态为完成
→ 回写 parsed.md 到 COS(通过 File Storage)
基础设施依赖判断
API 设计
CAPI:
IAPI(Worker 消费):
AAPI:
Domain Event 设计
交付检查
验收标准
禁止事项
不建议当前阶段实现