The RAG Book — Retrieval, Agents & Multi-Agent Systems

The Field Manual for Forward Deployed AI Engineers

The RAG Book

Retrieval, Agents & Multi-Agent Systems

From First Principles to Production Code

646 Pages 17 Modules 3 Appendices All Runnable Code

Ten Days. Zero to Production.

A structured 10-day path from “what is RAG?” to deploying multi-agent systems with guardrails.

Days 1–4

RAG Foundations

Why RAG exists, how it fails, and how to build it right. Chunking, embeddings, vector search, query enhancement.

  • Day 1: RAG Foundations
  • Day 2: RAG Pipeline & Vector Databases
  • Day 3: Chunking Strategy (7 methods)
  • Day 4: Embeddings, Query Enhancement + Lab
Days 5–8

Advanced RAG

Multi-query retrieval, hybrid search, reranking, GraphRAG, multimodal RAG, structured RAG, and evaluation.

  • Day 5: Multi-Query & Hybrid Search
  • Day 6: Reranking & GraphRAG
  • Day 7: Multimodal & Structured RAG
  • Day 8: Evaluation & Observability + Lab
Days 9–10

Agents & Production

Agent foundations, multi-agent orchestration with LangGraph, agentic RAG, security, and a capstone project.

  • Day 9: Agent Foundations & Orchestration
  • Day 10: Agentic RAG, Security + Capstone

The RAG Book is Free

The only cost is your time. Download the complete 646-page book, all 17 modules, 3 hands-on labs, and the multi-agent capstone.

I wrote this to help people break into AI Engineering and build a career that changes their life. If it helps you, that’s the whole point. Pass it on.

17 Modules. Every Concept You Need.

Days 1–4 — Foundations

01 RAG Foundations
02 RAG Pipeline
03 Vector Databases
04 Chunking Strategy
05 Embeddings
06 Query Enhancement
Lab Build a RAG system

Days 5–8 — Advanced RAG

07 Multi-Query Retrieval
08 Hybrid Search
09 Reranking & Filtering
10 GraphRAG
11 Multimodal RAG
12 Structured RAG
13 Evaluation & Observability
Lab Advanced RAG pipeline

Days 9–10 — Agents

14 Agent Foundations
15 Multi-Agent Orchestration
16 Agentic RAG
17 Security & Guardrails
Lab 3-agent pipeline
Cap Multi-agent RFP generator

Two Tracks. One Book.

Every module has dedicated sections for both audiences. Read what matters to you.

For Product Leaders

  • Decision frameworks and cost tables
  • “What to tell your engineer” checklists
  • Business impact and red flags
  • How to evaluate AI system output
  • No code required

For Engineers

  • Complete runnable Python scripts
  • 2–3 experiments per module
  • Production considerations and failure modes
  • Architecture patterns and trade-offs
  • pip install and go

Prefer to Skim First?

Full Table of Contents + complete Module 01 + previews of Modules 04 and 10. No email required.

Read the Sample

About the Author

Prithvi Datla with his dog

Prithvi Datla is the founder of Dinealog (dinealog.com) — a voice agent that answers the phone for restaurants. It takes takeout orders, manages reservations, and gives owners real-time visibility into their floor without adding a single hire. He also hosts Inside The Foundry, a podcast on the foundational moments and hard-won lessons of people who actually run things.

He’s also the founder of Kilobyte Collective, an AI lab made up of a small group of AI engineers.

Previously, he spent thirteen years in product, ecommerce, and digital operations — an edtech startup first, then two Fortune 25 companies. He left to build in hospitality: boutique hotels including a Tulum project later acquired by private equity, and Velvet House, which became Mexico’s best Indian restaurant. He closed it at its peak, on his own terms, rather than let its standard get negotiated away.

He holds bachelor’s and master’s degrees in Computer Science and Engineering and an MBA from Cornell.

This book is what was left after the deployments that didn’t work — every real-world RAG failure stripped down until only the part that actually moved the system remained.

Outside work, he’s a published photographer, golfer, surfer, diver, and dog dad.

Questions, Answered.

Who is this book for?

Forward-Deployed AI Engineers shipping production systems, plus product leaders, founders, and team leads evaluating or building with RAG and agents. Every module has dedicated “For Product Leaders” sections (no code required) and “For Engineers” sections (runnable Python).

Do I need to know Python?

Only for the engineer track. The product-leader sections need no code — PMs, founders, and team leads can extract full value without running anything. Engineers need working Python familiarity (virtual envs, pip, type hints) but no prior ML experience.

Is all the code runnable?

Yes. Every module is pip installpython script.py. The free code download includes 3 labs, the capstone, a verify-setup script, and fixtures (sample RFP, sample past proposals, .env templates).

What happens when models or APIs change?

Code uses claude-sonnet-4-6-20250514 as a concrete pinned example throughout. Appendix B covers version-pinning strategy and migration patterns — so when you swap to a newer model, you know what to check. The book is a first-edition snapshot (April 2026); the architectural patterns persist across model versions even as specific model IDs and SDK surfaces evolve.

How do I get it?

Enter your email and you can download the full PDF and the code right there on the page — nothing to wait for, no inbox to check. The PDF is optimized for screen and print.

Why is it free?

Because I’m thankful I’ve been able to learn this stuff, and I want to give back. There’s a lot of noise out there, and a lot of expensive options to learn. Getting the book is not the gate — finishing it is. There’s good stuff beyond.

Stop reading tutorials.
Build production AI systems.

17 modules. 646 pages. Runnable Python code in every module. 3 production appendices.

Free