Interactive course
AI Engineering & Production RAG
Bridge foundation models and production software: master embeddings, hybrid search, RAG architectures, deterministic tool calling, ReAct agentic workflows, and the RAG Triad evaluation framework.
From prompt engineering to autonomous production systems.
01 · LLM Architecture, Tokenomics & Sampling Control
Understand how large language models process text, token economics, context window mechanics, and sampling parameters.
- 1.1How LLMs Process Text: The Tokenizer Deep DiveByte-Pair Encoding, token vs character ratios, byte fallbacks, and the economics of token counting.~15 min
- 1.2Context Windows, Attention & KV-CacheAttention memory complexity, KV-Cache memory footprint, TTFT (Time to First Token) vs inter-token latency.~15 min
- 1.3Sampling Control: Temperature, Top-P, Top-K & Min-PLogits, softmax temperature scaling, nucleus sampling, reproducibility, and seed determinism.~15 min
- 1.4Structured Outputs: JSON Schema & Constrained DecodingEnforcing strict JSON formats, logit masking, Pydantic validation, and recovering from truncated tokens.~20 min
02 · Embeddings, Vector Semantics & Chunking Strategies
Transform unstructured text into semantic vectors and master document chunking strategies.
- 2.1Dense Embeddings & Vector Space GeometryHigh-dimensional semantic spaces, cosine similarity, dot product, and normalized Euclidean distance in numpy.~15 min
- 2.2Bi-Encoders vs Cross-Encoders: Speed vs AccuracyAsymmetric retrieval architectures, dual encoder latency, and cross-attention score calibration.~15 min
- 2.3Document Chunking: Fixed, Recursive & Sentence-AwareThe chunking trade-off: chunk size vs overlap, boundary preservation, and recursive splitting algorithms.~20 min
- 2.4Semantic & Hierarchical ChunkingDetecting topic boundaries with cosine distances between sentence embeddings, and parent-child hierarchies.~20 min
03 · Retrieval & Vector Indexing
Index and search millions of vector embeddings with millisecond latency using modern ANN and hybrid search algorithms.
- 3.1Vector Indexing: Flat vs HNSW GraphsExhaustive exact search vs Approximate Nearest Neighbors (ANN); navigating multi-layer HNSW graphs.~20 min
- 3.2Lexical Search & BM25 ScoringWhy semantic search fails on exact IDs and codes; implementing Okapi BM25 with term frequency saturation.~20 min
- 3.3Hybrid Search: Combining Dense + Sparse with RRFFusing dense vector embeddings and sparse BM25 scores using Reciprocal Rank Fusion (RRF).~20 min
- 3.4Metadata Filtering & Pre/Post-FilteringHard constraints, multi-tenant security isolation, boolean expressions, and pre-filtering vs post-filtering.~15 min
04 · Advanced RAG Patterns & Context Optimization
Overcome Naive RAG limitations: query reformulation, neural reranking, and context window packing.
- 4.1Query Transformation: HyDE & Multi-Query ExpansionHypothetical Document Embeddings (HyDE), query rewriting, step-back prompting, and sub-query routing.~20 min
- 4.2Context Reranking with Cross-EncodersTwo-stage retrieval pipeline: retrieve broad candidates, then rerank top-K with cross-attention precision.~20 min
- 4.3The Lost-in-the-Middle Effect & Prompt Context PackingMitigating attention decay across long prompts, optimal chunk ordering, and token budget deduplication.~15 min
- 4.4Contextual Retrieval & Parent-Document RetrievalSmall-to-big retrieval: search on compact child chunks, return expanded parent context to the model.~20 min
05 · Tool Calling & Function Execution
Connect foundation models to external APIs, databases, and code execution environments safely.
- 5.1The Tool Calling Protocol & JSON SchemasStandardized tool declarations, parameter types, required fields, and the model invocation payload.~15 min
- 5.2Building a Deterministic Tool Execution LoopDispatching calls, validating arguments, exception containment, and sending informative errors for self-correction.~20 min
- 5.3Parallel & Multi-Tool ExecutionConcurrent tool execution in a single model turn, state aggregation, and dependency resolution.~20 min
- 5.4Tool Security: Permissions, Sandboxing & InjectionsPreventing indirect injection through tool outputs, human-in-the-loop approvals, and least-privilege scoping.~20 min
06 · Agent Architectures & Cognitive Patterns
Build autonomous agents that plan, reason, remember context, and correct their own errors.
- 6.1The ReAct Pattern: Reasoning + Acting + ObservingThe cognitive thought-action-observation loop, stopping conditions, and preventing infinite execution cycles.~20 min
- 6.2Plan-and-Solve & Dynamic Task DecompositionDecomposing complex high-level goals into directed acyclic graphs (DAG) of actionable sub-tasks.~20 min
- 6.3Agent Memory Architectures: Short, Buffer & SemanticWorking context memory, sliding window buffers, summarization memory, and episodic vector recall.~20 min
- 6.4Self-Correction, Reflection & Critic LoopsGenerator-Critic-Refiner pattern: inspecting intermediate outputs against formal constraints before delivery.~20 min
07 · Evaluation, Observability & Guardrails
Quantify retrieval precision, faithfulness, hallucination rates, and safeguard production workflows.
- 7.1The RAG Triad: Context Relevance, Groundedness & Answer RelevanceDecoupling retrieval evaluation from generation evaluation, detecting hallucinated claims, and scoring faithfulness.~20 min
- 7.2Synthetic Evaluation Datasets & LLM-as-a-JudgeGenerating realistic QA benchmarks from unstructured corpora, rubric design, and scoring calibration.~20 min
- 7.3Security Guardrails & Prompt Injection DefenseIsolating user inputs from system instructions, structured delimiter boundaries, and output safety assertion checks.~20 min
- 7.4Token Cost, Latency & Semantic CachingPrompt caching prefixes, vector semantic caching for frequent queries, and tiered model routing.~20 min
08 · Production AI Systems & Capstone Project
Assemble end-to-end architectures from real-time streaming interfaces to multi-step research agents.
- 8.1Streaming & Real-Time UX with Server-Sent EventsServer-Sent Events (SSE), partial tool-call parsing, token streaming, and optimising time-to-first-token.~15 min
- 8.2Capstone: Production RAG Knowledge Assistant with CitationsEnd-to-end knowledge assistant: ingestion, hybrid search, cross-encoder reranking, and citation-grounded answers.~30 min
- 8.3Capstone: Autonomous Multi-Step Research AgentMulti-step autonomous agent: iterative query planning, multi-source ingestion, evidence synthesis, and report generation.~30 min
- 8.4The Production AI Readiness & Deployment ChecklistRate limiting with exponential backoff, fallback provider routing, tracing, and automated regression benchmarks.~20 min
09 · Reasoning Models, Test-Time Compute & Verification
Master the inference-time compute revolution: thinking token budgets, Process Reward Models (PRMs), MCTS tree search, and code-based formal verification.
- 9.1Test-Time Compute & Thinking Token BudgetsWhy thinking tokens unlock complex multi-step reasoning; the trade-off between inference cost, latency, and accuracy.~20 min
- 9.2Process Reward Models (PRMs) vs Outcome Reward Models (ORMs)Step-level credit assignment, detecting intermediate logical errors, and Best-of-N trajectory scoring.~20 min
- 9.3Monte Carlo Tree Search (MCTS) for Reasoning GenerationTree exploration, UCB1 exploitation-exploration balance, and branch pruning for complex problem solving.~20 min
- 9.4Program-Aided Verification & Code-as-a-JudgeAST security inspection, sandboxed unit test assertions, and eliminating LLM judge sycophancy.~20 min
10 · GraphRAG & Knowledge Graphs
Overcome vector search blindness on global corpus questions with semantic triples, Leiden community detection, and hierarchical summaries.
- 10.1The Failure of Vector Search on Holistic QueriesWhy top-k similarity search fails on macro-thematic corpus prompts; the needle vs haystack paradigm.~15 min
- 10.2Entity & Relationship Extraction with Structured SchemasExtracting (Subject, Predicate, Object) triples, entity canonicalization, and degree centrality.~20 min
- 10.3Hierarchical Leiden Community Detection & SummariesClustering knowledge graphs into well-connected communities and pre-computing hierarchical corpus summaries.~20 min
- 10.4Global vs Local Graph Retrieval & Hybrid FusionNeighborhood graph traversals for specific queries vs community summary map-reduce for global corpus synthesis.~20 min
11 · Multi-Agent Swarms & Stateful Graph Workflows
Scale beyond single-agent loops with stateful StateGraphs, supervisor-worker orchestration, adversarial debate, and deadlock prevention.
- 11.1Stateful Agent Graphs & Cyclical WorkflowsRepresenting multi-agent systems as directed graphs with state schemas, functional reducers, and cyclical refinement loops.~20 min
- 11.2Supervisor-Worker & Hierarchical SwarmsCentralized orchestration, task decomposition, round-robin worker dispatching, and report synthesis.~20 min
- 11.3Multi-Agent Consensus & Adversarial DebateEmploying multi-agent cross-examination to eliminate hallucinations; Jaccard consensus indexes and arbitrator voting.~20 min
- 11.4Deadlock Prevention, TTL & Swarm SafetyGuarding against infinite agent chatter, cycle detection in message histories, and emergency circuit breakers.~20 min
12 · Local Serving, Quantization & Speculative Decoding
Deploy, optimize, and serve private enterprise models: vLLM serving stacks, PagedAttention vRAM management, AWQ, and speculative decoding.
- 12.1Local Inference Stacks: vLLM, Ollama & llama.cppArchitecture of modern inference engines, compute-bound prefill vs memory-bound decode, and continuous batching.~20 min
- 12.2PagedAttention & Virtual Memory KV-CacheEliminating memory fragmentation in GPU inference by allocating non-contiguous 16-token physical blocks.~20 min
- 12.3Weight Quantization: GGUF, AWQ & FP8Compressing model weights from FP16 to FP8 and INT4; preserving salient activation channels with AWQ.~20 min
- 12.4Speculative Decoding with Small Draft ModelsAccelerating large model generation by 2x–3x using fast draft models verified in parallel via rejection sampling.~20 min
Paths featuring AI Engineering & Production RAG
Recommended next courses
AI Engineering & Production RAG FAQ
How many lessons and hands-on exercises are in AI Engineering & Production RAG?
AI Engineering & Production RAG covers 12 modules, 48 interactive lessons, and 144 practical exercises (~16 hours total) with instant automated validation.
Do I need local setup or IDE installation for AI Engineering & Production RAG?
No installation required: every exercise and the interactive AI Engineering & Production RAG playground execute right in your browser via WASM and isolated sandboxes, with instant feedback.
Is Module 1 of AI Engineering & Production RAG free without creating an account?
Yes. Module 1 (“Module 1 — LLM Architecture, Tokenomics & Sampling Control”), the live playground, and the printable cheatsheet are permanently free without signup, saving your progress locally in your browser.
Which career learning paths include AI Engineering & Production RAG?
AI Engineering & Production RAG is a core building block of AI Engineering & Machine Learning, targeting roles such as AI Engineer · ML Engineer · LLM Systems Engineer.