RAG, Embeddings & Search
Advanced · 13 missions · about 4 hours
Make AI answer from your documents instead of from memory. Build every piece of a retrieval pipeline by hand: chunking, embeddings, vector and keyword search, hybrid ranking, cited prompts and search-quality metrics. Finish with a grounded Q&A engine that cites its sources and knows when to say "I don't know."
Missions
- Why RAG? Give the model the right page: Training data, context windows, and where answers really come from.
- Chunking with overlap: Split documents into pieces that keep their meaning.
- Cosine similarity: how close are two meanings?: The math behind semantic search, with the guards production needs.
- Top-k search: find the best matches: Score everything, sort best-first, and keep your index intact.
- Grounded prompts with numbered citations: Make the model answer from your sources, cite them, or say "I don’t know".
- Metadata filters (and the multi-tenant trap): Filter first, then rank, or another customer’s data leaks in.
- Keyword search with BM25: Exact words still matter: codes, names and rare terms.
- Hybrid search with reciprocal rank fusion: Merge meaning-based and keyword results without comparing apples to oranges.
- Measure search quality: recall@k and MRR: Stop guessing whether a change made retrieval better.
- Vector databases: what they do for you: Approximate search, fixed dimensions, upserts and keeping the index in sync.
- Fix the AI: grounding and refusing: The bot answers questions your docs never covered. Make it say "I don’t know".
- Use AI to build your search test set: Generate realistic labeled questions, including ones your docs can’t answer.
- Boss: build a mini RAG engine: Ingest, hybrid search, filters, cited answers and refusals, end to end.
Part of: AI Product Engineer career path