向量数据库是专门存储、索引与检索高维向量的数据库系统,核心能力是把非结构化数据映射成数值向量后,用近似最近邻算法在亿级规模中快速找到语义最相近的记录。它解决的是关系数据库无法高效处理语义相似性查询的问题,也解决了大规模向量检索在延迟与成本上的工程约束。
当用户问的是「意思相近」而不是「字面相同」时,就需要向量数据库来做检索。
向量嵌入:把文本、图像或音频通过嵌入模型映射成固定维度的稠密向量。
近似最近邻索引:采用分层聚类或图索引等结构,把暴力比对的复杂度从线性降到对数级。
元数据过滤:检索时可叠加结构化条件,把向量相似度与业务规则组合使用。
集合操作:支持按条件筛选、范围查询与多向量集合间的联合检索。工程上向量数据库的真实门槛在写入与更新:原始数据变动频繁时,增量索引的维护成本可能超过检索本身,因此多数系统同时保留原始副本并异步重建索引。实践中的另一个常见模式是分片与副本:向量数据通常按规模分片以支撑水平扩展,同时保留多副本以保证高可用与就近读取。
向量数据库把语义检索从研究原型变成了可承载生产流量的基础设施,支撑了检索增强生成等应用模式,也让语义相似度这一原本难以量化的关系具备了工程可用的索引与查询能力。
翻译
A vector database is a storage engine built around high-dimensional vectors, combining a specialised index with approximate nearest-neighbour search so that semantically similar records can be retrieved from collections of billions of dimensions. The gap it closes is that relational engines answer exact-match and range questions efficiently, but semantic similarity is not an exact operation.
When the user means something rather than typing the exact words, vector search is what actually finds the right passage.
Vector embedding: text, images or audio are projected through an embedding model into fixed-length dense vectors.
Approximate nearest-neighbour indexing: hierarchical clustering or graph-based structures reduce search from linear brute force to roughly logarithmic cost.
Metadata filtering: structured predicates are combined with similarity scores so retrieval respects business rules rather than pure vector distance.
Collection operations: filtered scans, range predicates and multi-collection joins are supported alongside vector queries.The practical hurdle in production is writes and updates: when source data changes frequently, maintaining the incremental index can cost more than retrieval itself, so most systems keep a copy of the original records and rebuild the index asynchronously.A common production pattern is sharding with replication: vector data is usually partitioned to scale horizontally while multiple replicas preserve availability and enable geographically nearby reads.
The result is that semantic retrieval became ordinary infrastructure rather than a research prototype, which is what made retrieval-augmented generation practical at production scale.