Embeddings & vector search
How text becomes a vector, what nearness in that space does and does not mean, and what it costs to store and search a few hundred million of them.
An embedding is a lossy compression of meaning into a fixed-length list of numbers. Everything interesting about vector search follows from those two words. Lossy is why a retrieval system misses the document containing the exact phrase you typed. Fixed-length is why a hundred million short paragraphs cost the same to store as a hundred million books, and why the storage bill is arithmetic rather than a mystery.
These pages work outward from the vector itself: what a model returns, why a dot product means anything, how an index avoids comparing your query to every row, and where the whole approach quietly fails. Where a number can be derived, it is derived in front of you. Where it can only come from an experiment, the experiment is named and attributed to whoever ran it.
What Are Embeddings? A Practical Introduction
What an embedding model returns, why distance between two of those returns means anything, and the four moving parts of a search that uses them.
5 min read
Choosing an Embedding Model: Dimensions, Cost and Quality
The six properties that actually differ between embedding models, why the leaderboard is the weakest of them, and a selection procedure that ends in a number you trust.
5 min read
Cosine Similarity vs Dot Product vs Euclidean
A proof that on normalised vectors all three metrics rank identically, and a list of the situations where they genuinely do not.
5 min read
Embedding Dimensions: Does 3072 Beat 768?
What each extra dimension costs in bytes and in query work, derived in full, set against what model vendors have published about the quality it buys.
5 min read
Matryoshka Embeddings: Truncating Vectors Without Losing Much
How a nested training objective makes the first 256 numbers of a vector useful on their own, what the original paper reports, and the two-stage retrieval it enables.
5 min read
Vector Databases Compared: What Actually Differs
The four index families every engine is built from, how to read someone else's recall/QPS curve without being misled, and the operational axes no benchmark covers.
5 min read
Do You Even Need a Vector Database?
The arithmetic that tells you when a brute-force scan is still fine, when Postgres with pgvector is fine, and the five signals that you have genuinely outgrown both.
5 min read
HNSW Explained: The Index Behind Most Vector Search
How a layered proximity graph finds near neighbours in logarithmic time, what M, ef_construction and ef_search each control, and what the graph costs in memory.
5 min read
Quantising Vectors: Binary, Scalar and Product Quantisation
Where the 4×, 32× and 64× compression ratios come from, the arithmetic of each scheme, and why rescoring recovers most of what compression costs.
5 min read
Semantic Search vs Keyword Search: Where Each Fails
Six query archetypes where a dense retriever loses to BM25, the two where it wins outright, and the fusion arithmetic that lets you stop choosing.
5 min read
Embedding Text vs Embedding Questions: The Asymmetry Problem
Why retrieval models want a prefix or an input type on queries and documents, what happens when you forget it, and how to detect that you have.
5 min read
Clustering Embeddings for Topic Discovery
The reduce-then-cluster pipeline that works on high-dimensional embeddings, why k-means is the wrong first choice, and how to turn clusters into labels people can read.
5 min read
Deduplication at Scale With Embeddings
How to find near-duplicates without comparing every pair, how to choose the similarity threshold by labelling rather than by guessing, and why transitivity will merge your whole corpus if you let it.
5 min read
Classification With Embeddings Instead of an LLM
Embed once, fit a linear model, classify for free — with the cost arithmetic that shows the gap, and an evaluation procedure for the accuracy question it cannot answer.
5 min read
Re-Embedding: What Happens When You Change Models
Why two models' vectors cannot share an index, the dual-column migration that avoids downtime, and the backfill arithmetic that tells you whether it takes hours or a week.
5 min read
Embedding Drift and Stale Vectors
Four different problems all called drift, the cheap monitors that detect each one, and the canary that catches a hosted model changing under a stable name.
5 min read
Multilingual Embeddings: Cross-Language Retrieval
How one vector space holds many languages, the language-bias failure that makes cross-lingual results look worse than they are, and how to build the language-pair table for your own corpus.
5 min read
Fine-Tuning an Embedding Model on Your Own Data
Turning click logs into training pairs, the in-batch-negatives loss that makes the training cheap, hard-negative mining, and the re-indexing bill you have just signed up for.
5 min read
Storing Vectors Cheaply: The Real Cost of 100M Embeddings
A cost model in one formula, worked at four scales, with the four levers ranked by how much they actually move the number.
5 min read
Sparse, Dense and Late-Interaction Retrieval (ColBERT)
Where the three retrieval paradigms differ in what they store and what they compare, what the ColBERT papers report, and the token-level storage arithmetic that decides whether you can use it.
5 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Inference, serving & latency
- Evaluation, benchmarks & LLM-as-judge
- Observability & LLMOps
- Hallucination & failure modes
- LLM cost engineering
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns