nex_docus/docs/sdd/specs/DV-0006-zvec-vectorization/design.md

20 lines
800 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# DV-0006ZVec 向量化 设计Design
## 上下文
`zvec_service.py`、`file_vector_sync_service.py`、`project_vectorization_task_service.py`。
## 分块
- 字符滑动窗口chunk_size默认 800/ overlap150每块生成 anchor、content_hash。
## 写入
- ZVec collection 每项目一个(`vector_index/<project_id>`embedding 用配置的 `model_type=embedding` 模型。
- `document_vector` 表逐块记录zvec_id/chunk_text/status/error
## 触发
- 写路径:`ProjectFileService → FileVectorSyncService`(后台、按项目串行)。
- 全量:`ProjectVectorizationTaskService`(后台任务 + 进度表)。
## 维度变更
- 检测现有 collection 维度与模型不一致 → 重建 collection旧向量作废需重向量化。