Embeddings in Depth
Turn text into vectors, compare them with cosine, store them, call embedding models safely, and build AskDocs' embedding step with a cache.
Phase 0 ended with a search that could not see that 'forgot my login' and 'reset your password' mean the same thing. This phase builds the fix from the ground up. You start with the simplest possible vector, a word count, see exactly why it fails, and then meet dense vectors, where nearby numbers mean nearby meaning. You compute dot product, cosine and distance by hand, learn why vectors are usually scaled to length 1, and watch a tiny model learn by pulling matching pairs together and pushing others apart.
Then the practical side: how much memory a million vectors take and how to shrink them, why a model silently ignores everything after its input limit, why some models want a different prefix for questions and for passages, how to choose a model by testing it on your own questions, and what a call to an embedding API looks like on the wire (request, response, batches, rate limits). LLM Engineering Topic 1.3 and Topic 8.3 introduce embeddings and vector search in one short topic each. This phase goes much deeper and does not repeat them.
You also run a real embedding model in your browser in four search labs, so every claim about paraphrases, negation and truncation is something you see, not something you are told. The phase ends with the Build topic, where AskDocs gets an Embedder interface, a fake for tests, a cache keyed by content, and meaning-based retrieval over the whole handbook, and with a playbook of recipes to copy.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.