Vector Database Vocabulary: Embeddings, Search, and Similarity Explained

Vector embedding, semantic search, HNSW, ANN, cosine similarity, RAG pipeline — the vocabulary you need to work with vector databases and AI-powered search in English.

Vector databases are at the heart of modern AI applications — from semantic search to retrieval-augmented generation (RAG). As these technologies move from research into production, the vocabulary around them becomes essential for engineers writing design docs, reviewing PRs, and discussing architecture with data scientists. Here is the core terminology explained clearly.


Vectors and Embeddings

Vector embedding — A numerical representation of content (text, image, audio, code) as a list of floating-point numbers — a vector — in a high-dimensional space. Similar content produces similar vectors. Phrase: “We use an embedding model to convert product descriptions into 1,536-dimensional vectors and store them in the vector database.”

Embedding model — A machine learning model that produces vector embeddings. Examples: OpenAI text-embedding-3-small, Cohere Embed, sentence-transformers. The same model must be used for both storing and querying embeddings — mixing models breaks search.

Chunking strategy — The method used to split long documents into smaller pieces before embedding. Common strategies: fixed-size chunks, sentence-level chunks, paragraph-level chunks, semantic chunking. Phrase: “We tested three chunking strategies — semantic chunking gave the best retrieval precision for long legal documents.”


Search and Similarity

Semantic search — Finding results based on meaning rather than exact keyword matches. A query “how to cancel my subscription” finds documents about “ending a membership” even if the exact words don’t match. Phrase: “We replaced keyword search with semantic search — user satisfaction scores improved significantly for long-tail queries.”

Similarity search — Searching for vectors that are closest to a query vector according to a distance or similarity metric. Also called vector search or nearest neighbour search.

Cosine similarity — A metric measuring the angle between two vectors. Values range from -1 to 1; values closer to 1 mean more similar. Most commonly used for text embeddings. Phrase: “Cosine similarity works well for text embeddings because it ignores magnitude — only direction matters.”

Dot product similarity — Another similarity metric: the sum of element-wise products. For normalised vectors it is equivalent to cosine similarity. Some vector databases use dot product for performance reasons.

ANN (Approximate Nearest Neighbour) — An algorithm that finds vectors approximately closest to a query, trading a small amount of accuracy for dramatically faster search. Essential at scale — exact nearest neighbour search is too slow for millions of vectors.

HNSW (Hierarchical Navigable Small World) (pronunciation: each letter individually: H-N-S-W) — The most widely used ANN index algorithm. Builds a multi-layer graph structure enabling fast approximate search. Phrase: “HNSW gives sub-millisecond search latency on a million-vector index — much faster than a flat brute-force search.”


Vector Database Operations

Upsert — A combined insert-or-update operation: if a vector with the given ID exists, update it; otherwise insert it. The standard way to add vectors to most vector databases. Phrase: “We upsert product embeddings whenever the catalogue updates — IDs are the product SKU.”

Namespace — A logical partition within a vector database index that separates vectors from different sources or tenants. Phrase: “Each customer gets their own namespace — queries only search within the customer’s namespace.”

Metadata filtering — Filtering vector search results by attached metadata (e.g. category, date, language) before or after the vector search. Phrase: “We filter by language: 'en' and category: 'support' before the vector search — it narrows the candidate set and improves precision.”

Re-ranking — A post-retrieval step that re-orders the initial vector search results using a more accurate (and more expensive) model. Phrase: “We retrieve the top 50 candidates by vector similarity, then re-rank them with a cross-encoder — precision improved significantly.”


RAG Pipeline

RAG (Retrieval-Augmented Generation) pipeline — An architecture where a vector search retrieves relevant context documents, which are then provided to a language model as part of the prompt. Reduces hallucinations and enables answers grounded in your data. Phrase: “Our RAG pipeline retrieves the top 5 chunks from the knowledge base and injects them into the LLM prompt.”

Vector index — The data structure that enables fast similarity search over stored embeddings. An HNSW index, IVF (Inverted File Index), or flat index. Phrase: “Rebuilding the vector index after schema changes takes about 20 minutes on our dataset size.”


Practice: Set up a minimal vector search using a free tier of Pinecone, Weaviate, or Qdrant. Embed ten sentences, store them, and query for the most similar sentence to a new input. Then write a short technical explanation of what you built using the vocabulary from this post.

Let’s be honest, when you’re learning professional English, especially around technical topics like vector databases, it’s not just about knowing what something is. It’s about understanding how people talk about it – the subtle phrasing, the preferred terminology, and how feedback is typically given. This can feel particularly tricky because precision is paramount in development, but equally important is clear communication within a team.

For example, imagine you’ve spent hours building out a RAG (Retrieval-Augmented Generation) pipeline using embeddings to improve search accuracy. You’ve meticulously tuned your model and are proud of the results. A colleague reviews your pull request and adds this comment: “The embedding vector dimensionality is… interesting. Could you justify choosing 768? It seems a bit high for our typical query lengths, and might be impacting performance.” Now, simply knowing what “embedding vector dimensionality” means isn’t enough. Understanding the implied concern – that 768 might be excessive and negatively affect speed – is crucial. The colleague isn’t criticizing your choice; they are offering a suggestion based on their observations of potential impacts. Similarly, if you were describing the process to someone new, saying “We’re using cosine similarity to measure the distance between embeddings” would be perfectly acceptable, but adding “This allows us to find documents with similar semantic meaning” clarifies the why behind the technical term and makes it more accessible. Another common phrase is “fine-tuning the index,” which isn’t just about adjusting settings; it implies a process of iterative improvement based on observed behavior – perhaps adjusted parameters in HNSW or ANN algorithms to optimize search speed and recall.

It’s also important to note how people discuss troubleshooting. Instead of saying, “The search is returning irrelevant results,” a more constructive approach would be: “I’m seeing some drift in the similarity scores with certain queries. Let’s investigate whether the embedding model needs further refinement or if we need to adjust the HNSW index parameters – specifically, the efConstruction value.” This phrasing immediately signals a problem and suggests potential solutions without assigning blame. Furthermore, when describing the performance of an ANN (Approximate Nearest Neighbor) search, you might hear someone say “We’re aiming for a balance between recall and latency.” This highlights the inherent trade-off – prioritizing finding all relevant results (recall) versus minimizing the time it takes to find them (latency).

Here’s a simple example of using faiss to build an index:

import faiss
dimension = 768
index = faiss.IndexFlatL2(dimension) # L2 distance is common for cosine similarity
index.add([vector1, vector2, vector3])  # Add vectors to the index
print(index.nlist(10)) # Get the top 10 nearest neighbors

This demonstrates a basic usage of faiss, but understanding the underlying concepts – distance metrics (L2), indexing strategies (FlatL2), and adding data – is key to effectively utilizing vector databases.

Frequently Asked Questions

What English level do I need to read "Vector Database Vocabulary: Embeddings, Search, and Similarity Explained"?

This article is tagged Intermediate. If you find the vocabulary difficult, start with a related Vocabulary vocabulary exercise first, then come back — technical reading gets much easier once the core terms feel familiar.

Is this article free to read?

Yes. Every article on CoderSlingo, including this one, is free to read with no account, sign-up, or paywall.

How is reading this article different from doing an exercise?

Articles like this one explain concepts and vocabulary in context through prose, while exercises are interactive drills — fill-in-the-blank, matching, and multiple-choice — that test and reinforce specific terms. Reading builds understanding; exercises build recall.