The recap
Phase 4: Giving AI knowledge
29. Semantic search finds by meaning, not exact words. "Can't get into my laptop" finds "Reset a locked account password" because their embeddings sit close together (Day 11).
30. A vector database stores millions of embeddings and quickly finds the nearest neighbors to a query, combined with normal filters like price or city. It finds very close matches fast instead of checking every row.
31. RAG = retrieve the right passages, augment the prompt with them, generate an answer that cites its source. The model answers from your documents instead of from memory.
32. Chunking decides how documents are cut into pieces for retrieval. Too big = noisy, too small = missing context. Keep tables and headings together, add overlap and metadata, and test with real questions.
33. Open-weight models give control but you run them; closed models via API give ease but you trust a provider. Choose by testing on your task, cost, compliance, latency and team skills.
The quiz (answers below, no peeking)
Q1. An employee searches the policy site for "days off after a family funeral". The page is titled "Bereavement leave". Keyword search finds nothing. What fixes it?
Q2. You store 500,000 product embeddings and need only items under $50 in stock in Texas. Which two things does the vector database combine?
Q3. A bank chatbot answers "What's the wire cutoff time?" with a confident but outdated time. Which technique would ground it in today's policy?
Q4. In an insurance benefits booklet, the deductible table got split across two chunks, so answers come back half right. What went wrong and how do you fix it?
Q5. A hospital's rules say patient notes must not leave its own environment. Which model option fits more naturally, and what's the trade-off?
Answers
A1. Semantic search. It matches meaning through embeddings, not exact words.
A2. Nearest-neighbor search on meaning plus metadata filters (price, stock, state).
A3. RAG: retrieve the current policy document, add it to the prompt, answer with a citation.
A4. A bad chunk boundary. Keep each table in one chunk, use overlap, and check it with test questions.
A5. An open-weight model run in-house. Trade-off: the hospital now runs the GPUs, updates and monitoring.
5/5? You're ready for agents.
