M1-02 Vector & Retrieval Module #16
Closed
opened 2026-05-22 21:03:29 +08:00 by wangdl
·
2 comments
Labels
Clear labels
area:activity
活动/统计
area:admin
管理后台
area:admin-api
area:ai
AI/RAG
area:ai-runtime
AI Runtime / AI 分析体系相关
area:analytics
area:api
API 接口
area:auth
认证与授权
area:cos
对象存储
area:database
数据库/Migration
area:import
文件导入/解析
area:knowledge
知识库/知识点
area:learning-info
area:learning-session
area:quiz
测验/自测
area:reading-event
area:reading-progress
area:review
复习系统
area:security
安全相关
audit:api-admin-info
audit:api-info
audit:planned
已完成宏观规划,尚未代码审查
audit:reviewed
blocked-by:api-info-aggregation
blocked-by:api-info-core
blocked-by:api-info-ops
blocked-by:api-info-schema
blocked-by:processor
blocked-by:schema
priority:p0
最高优先级,阻塞发布
priority:p1
高优先级,里程碑必需
priority:p2
中优先级,后续版本
repo:api
API 仓库 Issue
status:blocked
被阻塞
status:done
已完成
status:partial
status:todo
type:aggregation
type:bug
缺陷修复
type:design
设计
type:docs
文档
type:feature
新功能
type:migration
type:refactor
重构
type:test
work:admin-api
work:aggregation
work:api
work:artifact
题目/卡片产物
work:audit
work:circuit-breaker
熔断
work:contract
work:design
架构/协议设计工作
work:docs
work:export
work:extend-existing
work:internal-api
Runtime 内部接口
work:job
Job 调度相关
work:new-module
work:new-table
work:ops
work:query
work:quota
额度/限流
work:schema
Prisma Schema 设计
work:security
work:service
Service 层实现
work:snapshot
Snapshot 构建
work:test
No Label
Milestone
No items
No Milestone
M1:AI / RAG 运行时与检索底座(P0~P1)
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wangdl/api-server#16
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking 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?
目标
设计知习后端向量存储与检索模块,为知识库和 RAG 系统提供 Qdrant 向量数据库的完整访问能力,包括 collection 管理、向量写入/删除、语义检索、rerank 和引用上下文组装。
本 Issue 只做模块架构设计,不直接实现代码。
背景说明
知习的知识库问答(RAG)和候选知识点生成依赖向量检索。用户上传的资料经过 Ingestion 模块解析、切片、embedding 后,需要写入 Qdrant 向量数据库。RAG Chat 查询时需要从 Qdrant 检索相关片段,经过 rerank 后组装成 LLM 上下文。
Vector & Retrieval 模块是全系统唯一的向量数据库访问入口。MySQL 是业务权威库,Qdrant 是索引库——这一原则必须遵守。
模块职责
本模块负责:
本模块不负责:
候选数据对象
基础设施依赖判断
API 设计
Internal Provider(供其他模块调用):
AAPI:
Domain Event 设计
Admin 视图设计
Qdrant 状态页:
检索调试页(Knowledge Ops 共享):
交付检查
验收标准
禁止事项
不建议当前阶段实现
✅ M1-02 实施完成
架构决策
@qdrant/js-client-restzhixi_chunks交付内容
src/modules/vector/vector.service.tssrc/modules/vector/vector.controller.tssrc/modules/vector/vector.module.tstest/mocks/qdrant.mock.tsE2E 测试 (test/m1.e2e-spec.ts M1-02)
GET /admin-api/vector/collectionGET /admin-api/vector/countPOST /admin-api/vector/reindex运行
🔍 审计备注 — 2026-05-24
检查项: VectorService.rerank() 使用
@Optional() AiGatewayService,如果 AiModule 未加载会降级到 vector score。结论: 可接受。fallback 逻辑保证了 rerank 不会因依赖缺失而崩溃。等 M2 或 M3 阶段可考虑直接调用 SiliconFlow HTTP API 以去除对 AiGatewayService 的耦合。
wangdl referenced this issue2026-06-05 19:34:43 +08:00
wangdl referenced this issue2026-06-05 19:36:08 +08:00