← Learning

Naive RAG

A linear, one-concept-per-lesson path through Naive RAG, the baseline retrieval-augmented generation architecture, built from scratch with no framework, from your first embedding to a complete FastAPI RAG service backed by ChromaDB. 26 lessons · 3 tiers.

Prerequisites: Comfortable writing basic Python (functions, imports, running a script). No LangChain or vector-database experience needed - this course builds naive RAG from raw API calls and a plain Python list, deliberately without a framework. This site's RAG Fundamentals course is a useful (not required) primer: it maps where naive RAG sits among the nine retrieval architectures, of which this course covers only the first.

Lessons use Google's Gemini free tier (gemini-embedding-001 for embeddings, gemini-3.5-flash-lite for chat), the same models as this site's other courses. No Docker and no database for most of the course - the vector store starts as a plain Python list; Lesson 20 onward swaps that for a local ChromaDB instance, still no server or account required.

Built on ChromaDB, the open-source vector database this course graduates to in the Advanced tier.

Course source

Every lesson's README and lesson.py for this course live in the ai-agent-engineering repo.

View on GitHub →
Naive RAG

Beginner

Hand-rolled RAG, one piece at a time: chunk, embed, retrieve, generate.

  1. 01What Is Naive RAGGitHub
  2. 02Your First EmbeddingGitHub
  3. 03Cosine Similarity by HandGitHub
  4. 04Chunking a DocumentGitHub
  5. 05An In-Memory Vector StoreGitHub
  6. 06Retrieval Top-kGitHub
  7. 07Generation: Stuffing the PromptGitHub
  8. 08End-to-End Single-Document QAGitHub
  9. 09Checkpoint: CLI Q&A AssistantGitHub

Intermediate

Where naive RAG breaks, and the fixes that keep it naive.

  1. 10Chunk Size and OverlapGitHub
  2. 11Structure-Aware ChunkingGitHub
  3. 12Multiple Documents and MetadataGitHub
  4. 13Persisting the Vector StoreGitHub
  5. 14Choosing k and ThresholdsGitHub
  6. 15Prompting for Grounded AnswersGitHub
  7. 16Failure Modes by HandGitHub
  8. 17Minimal Evaluation: Precision at kGitHub
  9. 18Checkpoint: Notes Search Assistant with CitationsGitHub

Advanced

Graduating the hand-rolled store to ChromaDB, and a capstone.

  1. 19Where Linear Scan Breaks DownGitHub
  2. 20Introducing ChromaDBGitHub
  3. 21Repointing Retrieval at ChromaDBGitHub
  4. 22Metadata Filtering with ChromaDBGitHub
  5. 23Refactoring Into ingest() and ask()GitHub
  6. 24Wrapping It as a ServiceGitHub
  7. 25Capstone: A Complete Naive RAG ServiceGitHub
  8. 26Where Naive RAG Hits a WallGitHub
Start at Lesson 1

Contact

Book a Call