---
title: 向量数据库应用图谱
---
flowchart LR
A["向量数据库<br><i>(Vector Database)</i>"]:::core
B["AI 搜索引擎<br><i>自然语言/语义/混合检索</i>"]:::nlp
C["RAG 知识库<br><i>检索增强生成/企业知识中台</i>"]:::rag
D["图像搜索<br><i>以图搜图/相似内容检索</i>"]:::vision
E["语音相似度识别<br><i>音频特征向量比对/查重</i>"]:::audio
F["多模态推荐系统<br><i>文本-图像-音频跨模态推荐</i>"]:::multi
G["AI Agent 长期记忆<br><i>个性化记忆/上下文增强</i>"]:::agent
A --> B
A --> C
A --> D
A --> E
A --> F
A --> G
%% 分色样式
classDef core fill:#ffe082,stroke:#fbc02d,stroke-width:2px,color:#6d4c00,rounded:12px
classDef nlp fill:#b3e5fc,stroke:#0288d1,stroke-width:2px,color:#01579b,rounded:10px
classDef rag fill:#b2dfdb,stroke:#00897b,stroke-width:2px,color:#004d40,rounded:10px
classDef vision fill:#d1c4e9,stroke:#7e57c2,stroke-width:2px,color:#4527a0,rounded:10px
classDef audio fill:#ffccbc,stroke:#ff7043,stroke-width:2px,color:#4e342e,rounded:10px
classDef multi fill:#a5d6a7,stroke:#388e3c,stroke-width:2px,color:#1b5e20,rounded:10px
classDef agent fill:#f8bbd0,stroke:#c2185b,stroke-width:2px,color:#880e4f,rounded:10px
---
title: "RAG 架构流程"
---
flowchart LR
U["用户提问<br><i>User Query</i>"]:::user
E["向量化查询<br><i>Embedding</i>"]:::embed
Q["向量数据库检索TopK<br><i>Vector DB Retrieval</i>"]:::db
L["拼接上下文 + Prompt<br><i>Retrieve & Augment</i>"]:::ctx
G["大语言模型生成答案<br><i>LLM Answer Generation</i>"]:::llm
U --> E
E --> Q
Q --> L
L --> G
%% 分色
classDef user fill:#ffe082,stroke:#fbc02d,stroke-width:2px,color:#6d4c00,rounded:10px
classDef embed fill:#b2dfdb,stroke:#00897b,stroke-width:2px,color:#004d40,rounded:10px
classDef db fill:#b3e5fc,stroke:#0288d1,stroke-width:2px,color:#01579b,rounded:10px
classDef ctx fill:#d1c4e9,stroke:#7e57c2,stroke-width:2px,color:#4527a0,rounded:10px
classDef llm fill:#a5d6a7,stroke:#388e3c,stroke-width:2px,color:#1b5e20,rounded:10px
其中“向量数据库”是整个系统是否能“答得准、答得新”的关键。
🔹 2)解决 LLM 的幻觉与更新难题
大模型参数固定,更新周期慢;但企业知识、法规变更、实时信息更新却是动态的。向量数据库允许:
不重训模型,知识实时更新
结合文档元信息(时间、角色、标签)做精细过滤
多模态融合(如图+文)场景更易扩展
🔹 3)嵌入式搜索能力延伸到终端和边缘设备
得益于 Milvus Lite、Qdrant + WebAssembly、FAISS Mobile 等轻量化部署能力,向量数据库开始:
本地运行在 Android/iOS 端,助力智能助手实现记忆检索
嵌入边缘网关实现图像内容筛选、事件去重等任务
🧱 6. 主流向量数据库选型对比
向量数据库在近两年迎来爆发式增长,以下是当前主流产品的功能对比:
特性
Milvus
Qdrant
Weaviate
FAISS
Pinecone
架构类型
分布式/云/本地
轻量/边缘/云
内建模块丰富
本地/轻量
云服务
数据持久化
✅ RocksDB
✅ WAL+存储分离
✅ 内建模块
❌ 非持久化
✅ 云自动持久
向量索引
IVF, HNSW, PQ
HNSW
HNSW, Flat
多种
HNSW (自研)
多模态支持
✅
✅
✅
❌
❌
社区活跃度
⭐⭐⭐⭐
⭐⭐⭐⭐
⭐⭐⭐
⭐⭐⭐⭐
⭐⭐(闭源)
适合场景
大规模生产部署
嵌入式/边缘
语义搜索/多模态
快速原型
云原生方案
选型建议:
Milvus:适合企业级大规模部署,配合 Zilliz Cloud 提供商用支持。
Qdrant:轻量、易部署,适合本地知识库、边缘部署。
FAISS:研究、实验首选;但缺乏服务能力。
Weaviate:语义丰富、嵌入Graph特性,适合 NLP/推荐等复杂搜索场景。
Pinecone:闭源云服务,操作简单但不可自托管,适合中小项目。
🌐 7. 部署模式与系统架构
向量数据库部署有三种典型模式:
---
title: "向量数据库部署架构"
---
flowchart LR
A["用户终端<br><i>Web/APP/AI应用</i>"]:::user
B["API Gateway<br><i>鉴权/限流/统一入口</i>"]:::api
C["向量服务层<br><i>检索/索引/服务编排</i>"]:::svc
D["嵌入模型服务<br><i>Embedding Model<br>(如OpenAI/BGE/自建)</i>"]:::embed
E["向量数据库集群<br><i>Milvus/Faiss/PGV/Weaviate等</i>"]:::vecdb
F["元数据存储<br><i>如PostgreSQL</i>"]:::meta
A --> B
B --> C
C --> D
C --> E
E --> F
%% 分色样式
classDef user fill:#ffe082,stroke:#fbc02d,stroke-width:2px,color:#6d4c00,rounded:12px
classDef api fill:#b3e5fc,stroke:#0288d1,stroke-width:2px,color:#01579b,rounded:10px
classDef svc fill:#b2dfdb,stroke:#00897b,stroke-width:2px,color:#004d40,rounded:10px
classDef embed fill:#d1c4e9,stroke:#7e57c2,stroke-width:2px,color:#4527a0,rounded:10px
classDef vecdb fill:#a5d6a7,stroke:#388e3c,stroke-width:2px,color:#1b5e20,rounded:10px
classDef meta fill:#ffccbc,stroke:#ff7043,stroke-width:2px,color:#4e342e,rounded:10px
嵌入模型服务:如 sentence-transformers、OpenAI Embeddings、DeepSeek Embedding API