Course outline▾
Week 1 · The Foundations
- Day 1Demystifying AI — From Buzzword to Business Logic
- Day 2How Machines Actually Learn — Supervised, Unsupervised and Reinforcement Learning
- Day 3Inside Neural Networks — The Engine of Modern Deep Learning
- Day 4The AI Project Lifecycle — From Raw Data to Production Deployment
- Day 5The Math Behind the Magic — Why Linear Algebra and Probability Matter
- Day 6Data Preprocessing — Cleaning the Messy Reality of Enterprise Data
- Day 7Measuring Success — Understanding Accuracy, Precision, Recall and F1 Scores
Week 2 · Applied AI & APIs
- Day 8Introduction to LLMs & The Modern AI API Landscape
- Day 9Advanced Prompt Engineering — Few-Shot, Chain-of-Thought and Structured JSON
- Day 10Tokenization, Context Windows and Cost Optimization
- Day 11Embeddings and Vector Representations — How Machines Map Meaning
- Day 12Vector Databases — Storing and Searching Enterprise Knowledge
- Day 13Retrieval-Augmented Generation (RAG) — Chatting with Proprietary Documents
- Day 14RAG Evaluation and Hallucination Guardrails
Week 3 · Infrastructure & Hosting
- Day 15Introduction to AI Infrastructure — Hardware, Runtimes and Compute
- Day 16Local Model Execution — Running Open-Weight LLMs Securely with Ollama and vLLM
- Day 17Containerizing AI Workloads — Production Dockerfiles for Python APIs
- Day 18Docker Compose for Multi-Container AI Stacks
- Day 19Kubernetes for AI 101 — Pods, Deployments and Services for Model Serving
- Day 20Persistent Storage in Kubernetes — Managing State, Weights and Vector Indices
- Day 21High-Performance Networking — Ingress and Egress for AI Clusters
Week 4 · Enterprise Workflows
- Day 22Autonomous Agents — From Passive LLMs to Goal-Driven Execution
- Day 23Tool Use and Function Calling — Connecting LLMs to APIs, Databases and Shells
- Day 24Multi-Agent Orchestration — Supervisor, Worker and Evaluator Patterns
- Day 25Automated CI/CD — Automating the Software Lifecycle for AI Models
- Day 26Zero-Trust Security for AI — Sandboxing Ephemeral Execution and Model Egress
- Day 27Observability and Tracing for Agentic Systems — Telemetry, Logs and Metrics
- Day 28Human-in-the-Loop Architecture — Machine Second, Human First in Practice
- Day 29Managing Technical Debt, Drift and Model Governance in Enterprise IT
- Day 30The 10-Year Horizon — Architecting IT Strategy for the AI-Native Enterprise
Day 13: Retrieval-Augmented Generation (RAG) — Chatting with Proprietary Documents
2026-10-13 · 7 min read
Watch the video lesson, or subscribe on YouTube for a new lesson every day.
A language model only knows what it was trained on, and that stopped at a fixed date. It has never read your internal wiki, your tickets or this morning's incident report. Retrieval-Augmented Generation (RAG) is the architecture that lets it answer questions about your own, up-to-date documents, without retraining the model.
In plain terms: An open-book exam. Instead of making the student memorise the whole library, you let them look up the right pages first, then write the answer from those pages.
RAG chains together the two previous lessons: embeddings give every paragraph a position by meaning, and a vector database finds the closest ones fast. Then the LLM does what it is best at, which is writing a clear answer.
Step 1: Ingestion
Ahead of time, your private documents are split into chunks (paragraph-sized pieces), each chunk is converted into an embedding, and the vectors are stored in a vector database. Chunk size is a real design decision. Chunks that are too big blur the meaning, and chunks that are too small lose the surrounding context.
Step 2: Retrieval
When a user asks a question, that question is embedded as well. The vector database runs a similarity search and returns the top few most relevant paragraphs. Three is a common starting point, and you tune it for your documents.
Step 3: Augmented generation
The retrieved paragraphs are injected into the LLM's prompt, together with an instruction: "Answer the user's question using ONLY the following retrieved context." The model writes its answer from the supplied facts instead of from memory.
Here is the whole loop in Python. The embed, search and llm functions stand in for your embedding model, your vector database and your LLM API, so you can plug in the ones you use.
def answer(question: str) -> str:
# 2. Retrieval: embed the question and fetch the 3 closest chunks
query_vector = embed(question)
chunks = search(query_vector, top_k=3)
# 3. Augmented generation: put the chunks in the prompt
context = "\n".join(f"- {c}" for c in chunks)
prompt = (
"Answer the question using ONLY the context below. "
"If the context does not contain the answer, say you don't know.\n\n"
f"Context:\n{context}\n\nQuestion: {question}"
)
return llm(prompt)
# 1. Ingestion (run ahead of time, and again whenever documents change)
for chunk in split_into_chunks(load_documents()):
store(embed(chunk), chunk)
Notice the "say you don't know" rule. It gives the model a safe way out when retrieval finds nothing useful. Tomorrow's lesson covers what happens when retrieval goes wrong, and how to measure it.
Coming Up Next
Day 14: RAG evaluation and hallucination guardrails.
#RAG #GenerativeAI #EnterpriseAI #SoftwareEngineering #AIImplementation