internalsGet Pro

AI Engineering · Module 04

Embeddings and vector search

Lessons
10
Free
0
Reading
~2 h

Your progress

0 / 10 lessons done

Sign in to track

Lessons

  1. Semantic search: finding by meaning, not keywordsSearch boxes, “related items” panels and every RAG system find their documents this way. Knowing which work happens once and which happens on every search tells you what the feature costs, where it is slow and when it will return the wrong thing.12 min
  2. Embedding models: choosing and comparing themEvery vector you store is tied to the model that made it. The model you pick on day one decides search quality for years, and replacing it means embedding your whole corpus again.16 min
  3. Similarity measures: cosine, dot product, distanceEvery vector store and every vector index asks you to pick a similarity measure before it stores anything. The wrong pick can quietly put the wrong documents first, and the right one usually takes one line of the model’s documentation.7 min
  4. Vector databases: what they add to searchThe first similarity search in most products is a loop over every vector, and it works in the demo. Knowing what that loop costs, and what else a real search needs, tells you when to keep it and when a vector database earns its place.15 min
  5. pgvector: vector search inside PostgreSQLMost teams adding search by meaning already run PostgreSQL. Knowing what pgvector does, how to tell whether its index is used, and where it runs out lets you ship the feature without a second database, and know when you will need one.17 min
  6. Approximate nearest neighbours: speed vs recallEvery vector index you will use is approximate, and it ships with a default setting someone else chose. Measuring what it misses, and picking the setting yourself, decides whether search is both fast enough and good enough for your feature.7 min
  7. Vector indexes: HNSW, IVF and quantizationA vector index that worked on a sample can need more memory than the server has once every customer’s data is in it. Knowing what each index stores and how it changes over time lets you size the machine and pick the index before launch, not after the first slow search.18 min
  8. Filtering vector search by metadataAlmost every real vector search has a WHERE clause: one customer, one language, recent items only. Get the filter wrong and the search either returns nothing or shows one customer’s private data to another.17 min
  9. Choosing a vector store for your workloadEvery retrieval feature needs somewhere to keep its vectors, and the choice is hard to undo once millions are stored. Teams often pick a store from a feature list or a benchmark; the ones that pick from their own workload numbers avoid running a second database they didn’t need, or outgrowing one they did.17 min
  10. Lab: semantic search over 10,000 documentsEvery search feature, and every RAG system after it, rests on a vector search that someone has to build and check. Measuring recall on a small labelled set is how you find out whether a bad result comes from the embeddings or from the index, before users find out for you.18 min

Practise with

Terms this module teaches 34

Open glossary

Binary quantization

Keeping only one bit for each number of a vector: whether it is above zero. Vectors become 32 times smaller than 32-bit floats and are compared by counting differing bits, with a large loss of recall unless results are rescored.