โ† AI Product Building learning path
AI Product Building ยท Module 4 of 10

Retrieval-augmented generation (RAG)

RAG lets a model answer from your own documents.

๐Ÿ“– Key ideas

  1. Split documents into chunks and create embeddings (number vectors) for each.
  2. Store embeddings in a vector database or search index.
  3. At question time, retrieve the most relevant chunks.
  4. Send those chunks with the question so the model answers from them.
  5. Show sources so users can check the answer.
๐Ÿ’ก Real-life example: Like an open-book exam: the student first finds the right pages, then writes the answer from them.
EmbeddingNumbers that capture the meaning of text
Vector databaseStores and searches embeddings
ChunkA small piece of a document
GroundingAnswering from provided sources