Guide
What Is a Vector Database?
A plain-English guide to vector databases: what they are, what embeddings and vector embeddings are, how similarity search and approximate nearest neighbour indexes such as HNSW and IVF work, how vector databases power RAG and semantic search, whether you need a dedicated one or the vector search in a database you already run, where they fail, and a short history.
Quick answer: A vector database is a database built to store embeddings, which are lists of numbers that represent the meaning of text, images or audio, and to find the stored items whose numbers are closest to a query’s. That lets software search by meaning rather than by exact words, so a search for “how do I cancel” can find a document that only says “terminating your subscription”. Vector databases are the storage and search layer behind retrieval-augmented generation (RAG), semantic search and recommendation systems. The one caveat: you often do not need a separate product, because PostgreSQL, Elasticsearch, OpenSearch, Redis and MongoDB all offer vector search inside the database you may already run.
Definition: A vector database stores data as vectors, fixed-length lists of numbers produced by an embedding model, and retrieves the items most similar to a query vector. Items with similar meaning sit close together in that numerical space, so “closest vectors” means “most related content”. Special indexes make that search fast across millions or billions of items.
This page is the explainer: what vector databases and embeddings are, how they work and when you need one. It does not rank products. For the ranked, priced comparison of Qdrant, pgvector, Pinecone, Milvus, Weaviate and the rest, see best vector databases. For the models that create the vectors, see best embedding models. For the architecture a vector database usually sits inside, see what is RAG. For one-line definitions of the surrounding vocabulary, see the AI glossary.
What is a vector database?
A vector database is a system that stores vectors alongside the data they describe and answers one main question very quickly: which stored vectors are nearest to this one?
A vector, in this context, is an ordered list of numbers such as [0.12, -0.48, 0.91, ...]. AI systems create vectors with an embedding model, which reads a sentence, a product description, a photo or a clip of audio and outputs a list of a few hundred to a few thousand numbers. The model is trained so that items with similar meaning get similar lists of numbers. Each list is a point in a space with hundreds or thousands of dimensions, and related items land near each other.
A vector database then does three jobs:
- Stores each vector with an ID, the original content or a pointer to it, and metadata such as author, date or access permissions.
- Indexes the vectors so that nearest-neighbour search does not have to compare the query against every stored item.
- Queries by taking a new vector, usually the embedded version of a user’s question, and returning the closest matches, often filtered by metadata.
Vector database vs traditional database
| Traditional relational database | Vector database | |
|---|---|---|
| Stores | Rows and columns of exact values | Vectors (lists of numbers) plus metadata |
| Typical query | ”Find orders where customer_id = 4821" | "Find the 10 passages most similar in meaning to this question” |
| Match type | Exact match, ranges, joins | Similarity: nearest neighbours by distance |
| Answer | Correct or empty | Ranked by closeness, usually approximate |
| Index | B-tree, hash | HNSW graph, IVF clusters, quantised codes |
| Good for | Transactions, reporting, records | Semantic search, RAG, recommendations, deduplication |
A keyword search engine sits between the two. It finds documents that share words with the query, ranked by measures such as BM25. It works well for names, product codes and error strings, and poorly when the query and the document use different words for the same thing. Vector search has the opposite profile, which is why many systems combine the two (see hybrid search below).
Vector database vs vector index vs vector search
These terms are often used interchangeably, and the difference matters when choosing a tool.
| Term | What it is | Examples |
|---|---|---|
| Vector index | The data structure that makes nearest-neighbour search fast | HNSW, IVF, DiskANN |
| Vector search library | Code that builds and searches an index in memory, with no server, persistence or access control | Faiss from Meta, hnswlib |
| Dedicated vector database | A full database built around vector search: storage, durability, filtering, scaling, APIs | Qdrant, Milvus, Weaviate, Pinecone, Chroma |
| Vector search in an existing database | Vector types and indexes added to a general-purpose database | pgvector for PostgreSQL, Elasticsearch, OpenSearch, Redis, MongoDB |
Some dedicated vector databases are built on these libraries: Milvus’s search engine, Knowhere, incorporates Faiss, hnswlib and Annoy (Milvus). A library on its own is not a database: it does not save data safely, filter by permissions or serve many users at once.
What is an embedding?
An embedding is a list of numbers that represents a piece of content, positioned so that content with similar meaning has similar numbers. Embeddings are what a vector database stores.
An embedding model creates them. You give it a chunk of text, an image or a sound, and it returns a vector with a fixed number of dimensions. Two examples of output sizes, from the providers’ own documentation:
- OpenAI’s text-embedding-3-small returns 1,536 numbers per input and text-embedding-3-large returns 3,072.
- Google’s Gemini Embedding 2 returns 3,072 by default, can be set to return fewer, and puts text, images, video, audio and PDFs into one shared space.
No single number means anything on its own. The meaning is in the position of the whole vector relative to others. Two support tickets about refunds will sit close together; a ticket about a refund and a recipe for bread will sit far apart.
What are vector embeddings?
“Vector embeddings” and “embeddings” mean the same thing: the vector is the list of numbers, and “embedding” describes how the content has been placed (embedded) in a mathematical space.
Google’s 2013 word2vec paper describes the classic illustration. Word vectors learned from large amounts of text captured relationships as directions: the vector for “king”, minus “man”, plus “woman” landed closest to the vector for “queen”. Modern embedding models work on whole sentences, paragraphs, images and audio rather than single words, but the principle is the same: distance in the space tracks difference in meaning.
| Content | What an embedding captures | Typical use |
|---|---|---|
| Text passage | Topic, intent and meaning, beyond the exact words | RAG, semantic search, support ticket routing |
| Search query | What the person is looking for | Matching queries to documents |
| Image | Objects, scene, style | Visual search, finding near-duplicate photos |
| Product or user | Preferences and attributes learned from behaviour | Recommendations |
| Code | What a function does | Code search in AI coding tools |
| Audio | Speech content or sound characteristics | Finding similar clips, voice matching |
Where embeddings come from
Embedding models are neural networks, often built on the same transformer architecture as large language models, trained so that matching pairs (a question and its answer, a caption and its image) end up close together and unrelated pairs end up far apart. They are cheap to run compared with chat models. OpenAI’s documentation puts text-embedding-3-small at about 62,500 pages per dollar, assuming about 800 tokens a page, so embedding a 500-page book costs less than a cent.
Three practical points follow from how embeddings work:
- The query and the documents must use the same embedding model. Vectors from different models live in different spaces and cannot be compared. Changing embedding model usually means re-embedding the whole collection.
- Quality is set by the embedding model, not the database. The database finds the nearest vectors quickly. Whether the nearest vectors are actually the most relevant depends on the model that produced them. Best embedding models compares the options on measured retrieval quality.
- Size is a cost lever. Many embedding models are trained so their vectors can be shortened with little quality loss, a technique called Matryoshka representation learning. In the MTEB benchmark scores Google publishes in its embeddings documentation, cutting from 1,536 to 768 dimensions lowered the score from 68.17 to 67.99, and cutting to 128 dimensions lowered it to 63.31.
How much space vectors take
A vector stored at full precision (32-bit floating point) takes 4 bytes per dimension. That adds up fast at scale.
| Vector | Bytes each | 1 million vectors | 100 million vectors |
|---|---|---|---|
| 3,072 dimensions, float32 | 12,288 | 12.3 GB | 1,229 GB |
| 1,536 dimensions, float32 | 6,144 | 6.1 GB | 614 GB |
| 1,024 dimensions, float32 | 4,096 | 4.1 GB | 410 GB |
| 1,024 dimensions, int8 | 1,024 | 1.0 GB | 102 GB |
| 1,024 dimensions, binary | 128 | 0.13 GB | 12.8 GB |
The usual fix is quantisation: storing each number with fewer bits. In tests by Hugging Face and mixedbread on the MTEB retrieval tasks, int8 vectors took 4 times less memory and binary vectors 32 times less. With a rescoring step against the full-precision vectors, int8 kept about 99% of retrieval performance and binary about 96%.
How does a vector database work?
Every vector database follows the same basic flow.
| Stage | What happens |
|---|---|
| 1. Embed | Each document, chunk, image or product is turned into a vector by an embedding model |
| 2. Insert | The vector is stored with its ID, original content or a link to it, and metadata |
| 3. Index | The database organises vectors into a structure (a graph, clusters or compressed codes) built for fast nearest-neighbour search |
| 4. Query | A new input, such as a user’s question, is embedded with the same model |
| 5. Search | The index is searched for the vectors closest to the query vector, with any metadata filters applied |
| 6. Return | The top matches come back ranked by similarity score, usually with their original content |
In a RAG system, those returned passages are then pasted into a language model’s prompt so it can answer from them. The RAG guide covers the stages either side of the database: chunking, reranking and generation.
Measuring similarity: cosine, dot product and Euclidean distance
“Closest” needs a definition. Vector databases use a distance or similarity metric, chosen when the index is created.
| Metric | What it measures | Notes |
|---|---|---|
| Cosine similarity | The angle between two vectors, ignoring their length | Ranges from -1 (opposite) to 1 (same direction). OpenAI’s embeddings guide uses it |
| Dot product (inner product) | Angle and length combined | Gives the same ranking as cosine when vectors are normalised to length 1, and is slightly cheaper to compute |
| Euclidean distance (L2) | Straight-line distance between two points | Also gives the same ranking as cosine when vectors are normalised to length 1 |
| Hamming distance | Number of differing bits | Used with binary-quantised vectors |
The right metric is the one the embedding model was trained for, which its documentation usually states. Using a different one degrades results without any error message.
Why exact search is too slow
The simplest search compares the query vector with every stored vector and keeps the closest. This is called flat or brute-force search, and it is perfectly accurate. It is also slow at scale: 10 million vectors of 1,536 dimensions means around 15 billion multiplications for every single query.
Vector databases solve this with approximate nearest neighbour (ANN) search. An ANN index finds most of the true nearest neighbours while checking only a small fraction of the collection. The trade-off is measured as recall: the share of the true top results that the index actually returns. A recall of 0.95 at 10 means the index found, on average, 9.5 of the real 10 nearest vectors. Every ANN index lets you trade recall for speed, and a benchmark result means nothing without its recall figure.
The main index types
| Index | How it works | Strengths | Weaknesses |
|---|---|---|---|
| Flat | Compares against every vector | Exact results, no build time | Gets slower in direct proportion to the size of the collection |
| IVF (inverted file) | Groups vectors into clusters; a query searches only the nearest few clusters | Faster to build and uses less memory than HNSW | Lower recall at the same speed; the clusters are learned from the data, so they can drift as the data changes |
| HNSW (hierarchical navigable small world) | Builds a layered graph linking each vector to its neighbours; a query hops through the graph from coarse to fine layers | High recall at high speed | Slower to build and uses more memory than IVF |
| DiskANN and similar | A graph designed to live mostly on SSD rather than in RAM | Microsoft’s DiskANN paper searched a billion vectors on one workstation with 64GB of RAM and an SSD | Higher latency than an in-memory graph |
| Quantisation (scalar, binary, product) | Compresses vectors into short codes, often combined with IVF or HNSW | int8 cuts memory by 4 times and binary by 32 times | Some accuracy loss, usually recovered by rescoring with full vectors |
The IVF and HNSW trade-offs above are as pgvector’s documentation states them: HNSW “has better query performance than IVFFlat (in terms of speed-recall tradeoff), but has slower build times and uses more memory” (pgvector).
HNSW comes from a 2016 paper by Yury Malkov and Dmitry Yashunin. pgvector, Qdrant, Weaviate, Milvus, Redis, Elasticsearch and OpenSearch all support it.
Filtering and hybrid search
Real queries rarely want only “the most similar items”. They want the most similar items that this user is allowed to see, from the last year, in English. That is filtered vector search, and it is one of the main things a vector database does that a bare library does not. Filtering after the search can leave too few results, and filtering before it can slow a graph index, so systems differ in how they combine the two.
Hybrid search combines vector search with keyword search (usually BM25) and merges the two ranked lists, often with a method called reciprocal rank fusion. Vector search finds passages that mean the same thing in different words; keyword search catches exact names, codes and error messages that embeddings tend to blur. Weaviate, Elasticsearch and OpenSearch are among the systems that offer it as a built-in query.
What are vector databases used for?
| Use | How the vector database is used |
|---|---|
| RAG for chatbots and assistants | Stores chunks of company documents; retrieves the passages relevant to each question so a language model can answer from them |
| Semantic search | Matches queries to documents, products or help articles by meaning rather than keywords |
| Recommendations | Finds products, songs, videos or articles near the ones a user liked |
| Image and multimodal search | Finds visually similar images, or images that match a text description |
| Deduplication and clustering | Spots near-duplicate documents, tickets or records that are worded differently |
| Agent memory | Stores past conversations, notes and tool results so an AI agent can recall relevant context later |
| Anomaly and fraud detection | Flags items that sit far from any normal cluster |
| Code search | Finds functions by what they do, inside AI coding tools and code hosts |
Vector databases and RAG
A language model only knows what was in its training data. RAG gives it access to private, recent or specialist information by retrieving relevant passages at question time and placing them in the prompt.
The vector database is the retrieval step. Documents are split into chunks, each chunk is embedded and stored, and every question is embedded and matched against the store. The quality of the answer is capped by the quality of that retrieval: if the right passage is not returned, the model cannot use it. The RAG guide covers the whole pipeline, including when long context windows or agentic search replace a vector lookup.
You do not always see the database. OpenAI’s file search and Google’s Gemini API File Search store and search vectors for you behind a simple upload, and Amazon Bedrock Knowledge Bases and Pinecone Assistant offer the same on their platforms.
Is the vector database being replaced?
For code, in some tools. Anthropic’s Boris Cherny said in May 2025 that early versions of Claude Code used RAG and that the team settled on agentic search, in which the agent runs file-search commands itself, because “it outperformed everything else by a lot” (OfficeChai). Cursor reported the opposite result for its own coding agent: adding semantic search gave 12.5% higher accuracy in answering questions on average, by Cursor’s own measurement (Cursor). For large collections of documents, images and products, vector search is usually one tool among several (vector, keyword and metadata search) that a system or agent can choose between. The RAG guide sets out both sides.
Do you need a vector database?
Often not a separate one. Vector search is a feature of most major databases, and the right starting point depends on what you already run.
| Option | What it is | Examples | Best when |
|---|---|---|---|
| Vector search in a database you already run | Vector types and indexes added to your existing database | pgvector (PostgreSQL), Elasticsearch, OpenSearch, Redis, MongoDB | Search is one feature of your product, and one system to operate matters more than peak performance |
| Dedicated open-source vector database | A purpose-built engine you host yourself | Qdrant, Milvus, Weaviate, Chroma, Vespa, LanceDB | Retrieval is central, you want control, and you can run the infrastructure |
| Managed vector database | A dedicated engine run for you as a cloud service | Pinecone, Zilliz Cloud, Qdrant Cloud, Weaviate Cloud | Retrieval is central and you have no platform team to spare |
| Object-storage-based retrieval | Vectors kept on cheap cloud storage, with compute only when queried | Amazon S3 Vectors, turbopuffer | Very large collections, many tenants, or infrequent queries |
| Managed RAG service | Upload files; the provider handles embedding, storage and search | OpenAI file search, Gemini API File Search, Amazon Bedrock Knowledge Bases | You want a working retrieval system without building one |
A few rules of thumb:
- For a prototype, a local library or a lightweight database such as Chroma is enough.
- If your data is already in PostgreSQL, pgvector keeps vectors in the same transactions, backups and permissions as the rows they describe, and handles millions of vectors.
- A dedicated system pays off when you reach tens or hundreds of millions of vectors, need heavy filtering at low latency, need many isolated tenants, or want retrieval tuned independently of your main database.
- If the whole collection fits in a model’s context window, you may not need retrieval at all: the model can read everything on every question, at a higher cost per question. The RAG guide compares the two.
The ranked comparison, with each system’s pricing, licence and benchmark record, is on our best vector databases page, linked at the top of this guide.
Examples of vector databases
This is a reference list by type, not a ranking.
| System | Type | Licence | Notes |
|---|---|---|---|
| pgvector | PostgreSQL extension | PostgreSQL Licence | Adds vector search to PostgreSQL; HNSW and IVFFlat indexes |
| Qdrant | Dedicated | Apache 2.0 | Written in Rust; self-hosted or managed cloud |
| Milvus / Zilliz Cloud | Dedicated | Apache 2.0 | Built for very large collections; Zilliz runs the managed version |
| Weaviate | Dedicated | BSD-3-Clause | Hybrid keyword and vector search built in |
| Pinecone | Managed only | Proprietary | Fully managed service; no self-hosted option |
| Chroma | Dedicated | Apache 2.0 | Open source, with a managed Chroma Cloud |
| Elasticsearch / OpenSearch | Search engine | Elastic: AGPLv3, SSPL or ELv2; OpenSearch: Apache 2.0 | Vector search alongside full keyword search |
| Redis | In-memory database | RSALv2, SSPLv1 or AGPLv3 (Redis 8 and later) | Keeps indexes in memory, for low latency |
| MongoDB Vector Search | Document database | Source-available (SSPL) | Vector search in MongoDB Atlas and, since 30 June 2026, generally available in self-managed Community and Enterprise Advanced deployments (MongoDB) |
| Amazon S3 Vectors | Object storage | Proprietary | Vectors stored directly in S3; generally available since 2 December 2025 (AWS) |
| LanceDB | Embedded and lakehouse | Apache 2.0 | Designed for multimodal data stored as files |
| Faiss | Library | MIT | Meta’s similarity search library; used inside many other systems |
Where vector databases fail
Vector search is powerful and easy to get subtly wrong. The common failure modes:
| Problem | What goes wrong | Usual fix |
|---|---|---|
| Exact-term misses | A search for a product code, surname or error string returns passages about similar topics but not the exact one | Hybrid search with keyword matching |
| Similar is not relevant | The nearest passage is on the right topic but does not answer the question | A reranker, better chunking, a stronger embedding model |
| Approximate results | The index misses some true nearest neighbours, so the best passage is occasionally skipped | Tune the index for higher recall; rescore |
| Embedding lock-in | Switching embedding model means re-embedding and re-indexing everything | Choose the model carefully; plan for re-indexing |
| Stale data | Documents change but their vectors do not | Re-embed on update; delete old vectors |
| Tight filters | Strict metadata filters make queries slow or return too few results | A system with filter-aware indexing |
| Memory cost | Full-precision vectors at scale need large amounts of RAM | Quantisation, shorter vectors, disk-based indexes |
Security and privacy
Embeddings are not anonymised data. A 2023 study by John Morris and colleagues (EMNLP 2023) recovered 92% of 32-token text inputs exactly from their embeddings, using a method that repeatedly corrects its guess and re-embeds it with the same embedding model.
A vector store should be secured like the documents it was built from: behind authentication, and with permissions, so that a RAG system retrieves only what the person asking is allowed to see. The OWASP Top 10 for LLM Applications lists “vector and embedding weaknesses” as its own risk category.
Benchmarks need care
Many published vector database performance numbers are run by vendors, and they are hard to compare because speed depends on the recall level, hardware, dataset and settings chosen. In one public exchange, Elastic published a benchmark showing a 7 times throughput advantage for Elasticsearch over Qdrant, and Qdrant replied on 8 July 2026 with a 2.1 times advantage for Qdrant at matched recall (Qdrant). On 13 July, Elastic re-ran Qdrant’s setup on identical hardware and found the two systems in the same range at around 0.96 recall (Elastic). The VIBE benchmark, from academic researchers, compares indexing algorithms rather than full databases. When comparing products, check the recall level first: a system that is faster at 0.94 recall has not beaten one at 0.98.
A short history of vector databases
| Year | Event |
|---|---|
| 1975 | Jon Bentley describes the k-d tree, an early structure for nearest-neighbour search in low dimensions |
| 1998 | Piotr Indyk and Rajeev Motwani publish locality-sensitive hashing, an early approximate method for high dimensions |
| 2011 | Hervé Jégou, Matthijs Douze and Cordelia Schmid publish product quantisation for nearest-neighbour search, the compression method behind the IVF-PQ indexes in Faiss and several vector databases |
| 2013 | Google researchers publish word2vec, making learned word embeddings mainstream |
| 2016 | Yury Malkov and Dmitry Yashunin publish HNSW |
| 2017 | Facebook AI Research releases Faiss, its open-source library for billion-scale similarity search |
| 2018 to 2019 | Google researchers publish BERT (2018), and Nils Reimers and Iryna Gurevych adapt it to produce sentence embeddings with Sentence-BERT (2019); Microsoft publishes DiskANN; Zilliz open-sources Milvus and Pinecone is founded |
| 2021 | pgvector is first released, on 20 April, adding vector search to PostgreSQL |
| 2023 | pgvector adds HNSW indexes in version 0.5.0 on 28 August; MongoDB makes Atlas Vector Search generally available on 4 December |
| 2025 | Elasticsearch makes Better Binary Quantization its default for vectors of 384 dimensions or more in version 9.1; Amazon S3 Vectors reaches general availability on 2 December |
| 2026 | MongoDB Vector Search becomes generally available in self-managed deployments on 30 June; in July, Elastic re-runs Qdrant’s rebuttal of an Elastic benchmark and finds the two systems in the same range |
Related pages
- Best embedding models: the models that create the vectors, plus rerankers
- What is RAG?: the architecture most vector databases are built to serve
- What is prompt engineering?: how retrieved passages fit into the wider job of choosing what a model sees
- What is an LLM?: how the language models that use retrieved passages work
- What is agentic AI?: agents that use vector search as one tool among several
- What is MCP?: the protocol many agents use to connect to tools, including search
- What is the A2A protocol?: the standard agents use to hand work to other agents
- AI hallucinations: why retrieval reduces made-up answers but does not remove them
- Best LLM observability tools: tracing and scoring retrieval quality in production
- AI glossary: one-line definitions of embeddings, semantic search and the rest
Frequently asked questions
What is a vector database in simple terms?
A vector database is a database that stores data as lists of numbers called vectors, created by an AI embedding model, and finds the items whose numbers are closest to a query’s. Because similar meanings get similar numbers, it can search by meaning instead of exact words. It is the storage and search layer behind many AI chatbots that answer from company documents.
What is a vector database used for?
Vector databases are used for retrieval-augmented generation (RAG), semantic search, recommendations, image search, deduplication and memory for AI agents. In RAG, a vector database finds the passages relevant to a user’s question so a language model can answer from them.
What is an embedding?
An embedding is a list of numbers that represents a piece of text, an image or audio, positioned so that similar content has similar numbers. An embedding model creates it. OpenAI’s text-embedding-3-small, for example, turns any input into 1,536 numbers. Embeddings are what a vector database stores and compares.
What are vector embeddings?
Vector embeddings are the same thing as embeddings: numerical representations of content in which distance tracks difference in meaning. The “vector” is the list of numbers and “embedding” describes how the content is placed in a mathematical space. Two passages about the same topic produce vector embeddings that sit close together.
How does a vector database work?
A vector database stores vectors with their content and metadata, organises them in an index built for fast similarity search, and answers queries by embedding the input with the same model and returning the nearest stored vectors. It uses approximate nearest neighbour indexes, such as HNSW, which find nearly all of the closest matches while checking only a small fraction of the data.
What is the difference between a vector database and a regular database?
A regular relational database finds exact matches, such as every order with a given customer ID. A vector database finds similar items, such as the ten passages closest in meaning to a question, ranked by a similarity score. Many regular databases, including PostgreSQL with the pgvector extension, now do both.
Do I need a vector database for RAG?
You need vector search for most RAG systems, but not necessarily a separate vector database. If your data is already in PostgreSQL, Elasticsearch, OpenSearch, Redis or MongoDB, their built-in vector search is often enough. Managed services such as OpenAI file search handle the vector storage for you. A dedicated vector database pays off at large scale or with heavy filtering needs.
Is pgvector a vector database?
pgvector is an open-source extension that adds vector storage and search to PostgreSQL, rather than a standalone vector database. It supports HNSW and IVFFlat indexes and keeps vectors in the same tables and transactions as the rest of your data.
What is the best vector database?
This guide explains vector databases rather than ranking them. The ranked comparison of Qdrant, pgvector, Pinecone, Milvus, Weaviate and the rest, with prices, licences and benchmark records, is on our best vector databases page, linked at the top of this guide.
What is HNSW?
HNSW, short for hierarchical navigable small world, is a graph-based index for vector search. It links each vector to its nearest neighbours in a layered graph, and a query hops through the layers from coarse to fine to reach the closest matches quickly. It was introduced in a 2016 paper by Yury Malkov and Dmitry Yashunin and is supported by pgvector, Qdrant, Weaviate, Milvus, Redis, Elasticsearch and OpenSearch.
What is cosine similarity?
Cosine similarity measures the angle between two vectors, ignoring their length, on a scale from -1 (opposite) to 1 (pointing the same way). It is a common way to measure how similar two text embeddings are. When vectors are normalised to length 1, cosine similarity gives the same ranking as the dot product, which is cheaper to compute.
Is a vector database the same as semantic search?
No. Semantic search is the task of finding results by meaning; a vector database is one tool for doing it. Semantic search usually works by embedding documents and queries and comparing the vectors, and the vector database stores those vectors and finds the closest matches. Many production systems combine semantic search with keyword search, called hybrid search.
Can text be recovered from embeddings?
Partly, yes. A 2023 study by John Morris and colleagues recovered 92% of 32-token text inputs exactly from their embeddings, using repeated calls to the embedding model that produced them. Embeddings should be treated as being as sensitive as the text they came from, and vector databases secured accordingly.