Generative AI

Generative AI Patterns: Agent Architectures, Protocols and LLMOps

The patterns for building generative AI systems, from workflows to multi-agent systems, with MCP, A2A, human in the loop, agentic RAG, evaluation, guardrails and security. 24 labs in Docker with a local model, based on the original papers and the official documentation, and a video in every lesson.

Advanced · 30 hours · 24 lessons · Course language: Spanish and English

An advanced course on generative AI design patterns, built and measured one by one on the same case: an online store's assistant. You start with the augmented LLM and workflows (chaining with gates, routing, parallelization by sectioning and by voting, orchestrator and workers) and continue with the single-agent architectures that come from the papers: evaluator-optimizer, ReAct, plan and execute, Reflexion and tree of thoughts. You build multi-agent systems (a supervisor with subagents, agents in sequence, handoffs, debate and group chat), design tools the model uses well, publish an MCP server and two A2A agents in containers, and run the agent's code in a Docker sandbox. You add human approvals that survive restarts and agentic RAG with document grading, and compare the same agent in seven frameworks: LangGraph, Pydantic AI, OpenAI Agents SDK, Google ADK, Strands, Microsoft Agent Framework and CrewAI. You finish with LLMOps and security: traces with OpenTelemetry and Arize Phoenix, evaluation with business metrics and a quality gate, measured guardrails, defenses against prompt injection and a production service with a fallback model and shadow mode. Everything runs on your computer with Docker, with no API keys. Every result is real and every lesson has its video. The lessons, quizzes and videos are in English; the lab project keeps its original Spanish names and Spanish sample data, and every lesson explains them.

What you will learn

  • Choose between a workflow and an agent, and measure what each pattern costs
  • Build the classic workflows: chaining, routing, parallelization and orchestrator-workers
  • Implement ReAct, plan and execute, Reflexion, tree of thoughts and evaluator-optimizer from the papers
  • Design multi-agent systems with a supervisor, handoffs, debate and group chat
  • Publish tools with MCP, connect agents from different frameworks with A2A and run code in a sandbox
  • Add persistent human approvals and agentic RAG with grading and correction
  • Observe, evaluate and protect agents: traces, metrics, guardrails and defenses against prompt injection
  • Take an agent to production with limits, a fallback model, streaming and shadow mode

Skills

Agent patterns, LLM workflows, ReAct, Multi-agent systems, LangGraph, MCP, A2A, Human in the loop, Agentic RAG, Observability, Agent evaluation, Guardrails, Agent security, Docker Compose

Program

Module 1: Foundations and workflows (free lessons)

The augmented LLM, workflow or agent, chaining, routing, parallelization and orchestrator-workers.

Project: A measured router and a report with an orchestrator and workers.

  1. The augmented LLM: workflow or agent: Your environment, structured output, tools and the same task as a workflow and as an agent.
  2. Chaining and routing: Chains with code gates and a router measured against real cases.
  3. Parallelization and orchestrator-workers: Sectioning and voting, Send, and why parallelism depends on the server.

Module 2: Single-agent architectures

Evaluator-optimizer, ReAct, plan and execute, Reflexion and tree of thoughts.

Project: An agent that fixes its code with real tests.

  1. Evaluator and optimizer: A generator and an evaluator in a loop, with measurable criteria and a round cap.
  2. ReAct: reasoning and acting: The paper's loop in text, with native tools, as a graph and with create_agent.
  3. Plan and execute: A planner, an executor and a replanner, compared with ReAct.
  4. Reflexion: learning from mistakes: Code evaluated with real tests and lessons the agent keeps between attempts.
  5. Tree of thoughts: Proposing, rating and exploring breadth-first, with the code validating each step.

Module 3: Multi-agent systems

A supervisor with subagents, agents in sequence, handoffs, debate and group chat.

Project: A team of sales and support agents that hand the conversation to each other.

  1. Supervisor and agents in sequence: Subagents as tools, a clean context and a chain of agents.
  2. Handoffs between agents: Handoffs with Command, the active agent in the state and multi-turn conversations.
  3. Debate and group chat: Agents that correct each other and a moderator that picks who speaks.

Module 4: Tools and protocols

Tool design, MCP, A2A and a code sandbox in Docker.

Project: An MCP server and two A2A agents in containers.

  1. Tools the model uses well: Measured names and descriptions, context the model doesn't control, parallel calls and errors.
  2. Model Context Protocol (MCP): An MCP server in Docker with PostgreSQL, the protocol from the inside and an agent that uses it.
  3. Agent2Agent (A2A): Two agents from different frameworks in containers, their cards and an orchestrator.
  4. Code sandbox: Docker with no network and no writable disk, measured limits and a data analyst agent.

Module 5: Human in the loop, agentic RAG and frameworks

Approvals that survive restarts, corrective RAG and the same agent in seven frameworks.

Project: Refunds with human approval and a RAG that knows how to say "I don't know".

  1. Human in the loop: Conditional approvals, editing and rejecting, interrupt and resuming across processes.
  2. Agentic RAG: Query routing, document grading, query rewriting and grounded answers.
  3. The same agent in seven frameworks: LangGraph, Pydantic AI, OpenAI Agents SDK, Google ADK, Strands, Agent Framework and CrewAI.

Module 6: LLMOps and security

Observability, evaluation, guardrails, prompt injection and production.

Project: A service with traces, a quality gate, defenses and shadow mode.

  1. Observability with OpenTelemetry and Phoenix: Traces of a multi-agent system, your own spans, tokens and latency per step.
  2. Evaluating agents: Task success, tool accuracy, cost per task, a validated judge and a quality gate.
  3. Guardrails: Measured input guards, hidden personal data and an output guard.
  4. Security: prompt injection: A real indirect attack and the design patterns that stop it, with auditing.
  5. Agents in production: A service with memory, limits, a fallback model, streaming, metrics and shadow mode.

Module 7: Final project

Andimarket's complete assistant, in Docker Compose.

Project: An assistant with a guard, a router, MCP, agentic RAG, human approvals, traces and evaluation.

  1. Final project: Andimarket's assistant: A guard, a router, MCP, agentic RAG, approvals, traces and a quality gate in Docker Compose.

Prerequisites

  • Python with functions, classes and virtual environments
  • Having completed Intermediate LangGraph or knowing StateGraph, create_agent and tools
  • Docker Desktop with at least 8 GB of memory (10 GB is better) and uv (lesson 1 sets up the environment)

Next courses

See all courses