How to choose an embedding model: MTEB and your own evals
How to choose an embedding model: read MTEB the right way, weigh dimensions, context length and cost, then test on your own queries with a Python harness.
Tags
12 posts tagged
How to choose an embedding model: read MTEB the right way, weigh dimensions, context length and cost, then test on your own queries with a Python harness.
Hybrid RAG combines keyword (BM25) and vector search, then fuses the rankings. Why each misses what the other finds, and how to fuse them, with runnable Python.
Contextual retrieval prepends an LLM-written note on where each chunk sits in its document before indexing, cutting RAG retrieval failures. With Python.
RAG chunking strategies decide how documents are split before embedding. Fixed-size, recursive, structure-aware and semantic chunking compared, with Python.
ColBERT is a late interaction retriever: one vector per token and a MaxSim score instead of one vector per document. How it works and costs, with Python code.
Matryoshka embeddings pack the most useful information into the first dimensions, so you can truncate vectors to cut storage. How it works, with a Python demo.
pgvector is a Postgres extension that stores embeddings and runs nearest-neighbor search in SQL. Types, operators, HNSW vs IVFFlat and the filtering trap.
HNSW is a layered graph index for approximate nearest neighbor search. How M, ef_construction and ef_search trade recall for speed, with a Python build.
Cosine similarity scores two embeddings by the angle between them. When it equals the dot product, when Euclidean distance agrees, with a Python demo.
Semantic search finds results by meaning using embeddings, not shared words. How it differs from keyword (BM25) search, where each fails, with a Python demo.
A vector database stores embeddings and finds the nearest ones to a query fast. How ANN indexes trade recall for speed, with a runnable Python IVF demo.
Embeddings turn text into vectors of numbers so that similar meanings sit close together. How they are made and compared, with a runnable Python demo.