1.7 KiB
1.7 KiB
id, title, type, domain, stack, tags, week
| id | title | type | domain | stack | tags | week | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ai.vector-db.index | 向量数据库 | index | ai |
|
|
|
向量数据库
RAG 的检索基础设施。重点是讲清楚距离度量、近似索引的召回和延迟取舍、带过滤的检索、选型理由,而不是背某个产品的 API。项目里使用 pgvector(复用第 3~4 周学的 PostgreSQL)。
学习路线
| 顺序 | 课程 | 级别 | 预计 |
|---|---|---|---|
| 1 | 向量检索原理:距离度量、暴力检索、HNSW / IVF 近似索引 | 基础 | 2.5 小时 |
| 2 | 向量库选型和 pgvector 实战:Chroma / pgvector / Milvus / Elasticsearch | 进阶 | 3 小时 |
企业场景
面试题
示例代码
- examples/vector-stores:
chroma_demo.py(内存模式,自带向量,元数据过滤、更新删除,和暴力检索对比召回率);pgvector_demo.py(HNSW 索引、过滤查询、执行计划,需要TEST_DATABASE_URL和 pgvector 扩展,否则跳过)
在 16 周计划中
官方资料
产品更新很快,接口和参数以官方文档为准:
- pgvector:https://github.com/pgvector/pgvector
- Chroma:https://docs.trychroma.com/
- Milvus:https://milvus.io/docs
- Elasticsearch 向量检索:https://www.elastic.co/docs/solutions/search/vector