Week 1 · Day 4 of 10
Retrieval: answers from your own documents (RAG)
Students can index a company's own documents, answer questions grounded in them, cite the sources, and say so when the answer isn't there.
1LearnEmbeddings, retrieval and citations
Embeddings and similarity, chunking, Postgres with pgvector from Python, the retrieve-then-generate pattern, citations, and saying "I don't know" when the sources don't cover a question.
How your app answers from your documents
- Chunks
Try it live
Try it live
Ask this course a question
Answers come only from this site's own content, found by embeddings and cited. Ask something the course doesn't cover and it should say it doesn't know.
Check your understanding
What does an embedding capture?
Why split documents into chunks before indexing them?
Retrieval finds nothing relevant to the question. What should the app do?
2BuildCited answers from your documents
Index a folder of documents, answer questions over them with citations, and refuse when the answer is not in the sources.
Done when: your app answers from your documents and shows where each answer came from.
3CapstoneLoad your real documents
Load your own real documents.
4HomeworkWrite 15 test questions
Write ten questions your documents should answer and five they shouldn't, with the right responses. They become tomorrow's test set.
For teachers: the day 4 teaching kit.