Library · concept

Retrieval-augmented generation (RAG)

Ground language model answers in your own documents, with citations, and measure whether retrieval actually finds the right text.

RAG appeared in 44% of the Forward Deployed Engineer and 30% of the AI/ML Engineer postings we read. It is the most common way companies connect models to their own knowledge.

The examples index ten pages of the Kubernetes documentation (CC BY 4.0), retrieve with open embeddings and BM25, and answer with the Claude API. Retrieval runs fully offline; the API call needs a key.

  1. 1A RAG system from scratchA RAG system from scratch, with citations5 min read

Retrieval-augmented generation (RAG) lessons

Loading lessons…