Generative AI

Intermediate LangGraph: Agents with State, Memory and Human Control

Build reliable AI agents with LangGraph 1.2: stateful graphs, routes, parallelism, tools, memory in PostgreSQL, human approval, time travel, RAG and testing. 20 labs with a local model in Docker, based on the official documentation.

Intermediate · 25 hours · 20 lessons · Course language: Spanish and English

Learn to build AI agents that really work, with LangGraph, LangChain's orchestration runtime. Everything runs on your computer: Ollama serves the model in Docker, with no keys and no cost, and memory lives in PostgreSQL with pgvector. You design the state with reducers, decide with conditional edges and structured output, control loops with Command and step limits, and run in parallel with Send. You build an agent by hand and then with create_agent and its middleware: tool errors, cost limits and fallback models. You give it conversation memory with checkpointers, long-term memory with semantic search and context management with summaries. You pause the agent so a person can approve with interrupt() and HumanInTheLoopMiddleware, travel in time through its checkpoints, compose subgraphs, stream for real interfaces, build an agentic RAG that resists a prompt injection and test everything with pytest. You finish with a complete support assistant. Every command is explained and every result is real. The first 3 classes are free and include a video. The lessons, quizzes and videos are in English; the lab code and the local model's answers keep their original Spanish, and every lesson explains the names.

What you will learn

  • Design graphs with typed state, reducers, conditional routes, loops and parallelism
  • Build agents with tools by hand and with create_agent and its middleware
  • Use tools with runtime context, state and direct answers
  • Give agents conversation memory with checkpointers in PostgreSQL and long-term memory with semantic search
  • Manage the context with trimming, deletion and summaries
  • Pause agents for human approval and resume them from another process
  • Debug with time travel, compose subgraphs and stream for interfaces
  • Build a secure agentic RAG and test agents with pytest and fake models

Skills

LangGraph, LangChain, create_agent, Middleware, Ollama, PostgreSQL, pgvector, Human-in-the-loop, RAG, Streaming, pytest, Docker Compose

Program

Module 1: LangGraph fundamentals (free classes)

A local environment, your first graph, state and reducers, a chatbot and streaming.

Project: A chatbot with a local model that answers token by token.

  1. LangGraph and your local environment: uv, Ollama and PostgreSQL in Docker, your first graph and your first AI node.
  2. State, reducers and schemas: How updates are combined, parallel branches, Overwrite, Pydantic and messages.
  3. Chatbot and streaming: MessagesState, multi-turn conversations and real-time tokens.

Module 2: Flow control

Routes with structured output, Command, loops and parallelism with Send.

Project: A ticket router and a map-reduce over reviews.

  1. Conditional routes and structured output: A ticket router with closed categories and a handoff to a human.
  2. Command, loops and step limits: Deciding and updating at once, generating and reviewing, and finishing before the limit.
  3. Parallelism and map-reduce with Send: Fan-out and fan-in, deferred branches, parallel review analysis and concurrency.

Module 3: Agents and tools

The agent cycle by hand, create_agent, middleware and ToolRuntime.

Project: A store agent with limits, controlled errors and user context.

  1. An agent with tools, by hand: bind_tools, ToolNode, tools_condition and tool errors.
  2. create_agent and middleware: The standard agent, structured output, limits, errors and a fallback model.
  3. Tools with context and state: ToolRuntime, identity through context, Command from tools and live progress.

Module 4: Memory

Checkpointers in PostgreSQL, a Store with semantic search and context management.

Project: An assistant that remembers across conversations.

  1. Checkpointers and durable conversations: InMemorySaver and PostgresSaver, threads, history and state inspection.
  2. Long-term memory with Store: Namespaces, semantic search with pgvector and an assistant that learns.
  3. Context management: Trimming, deleting and summarizing the history, with your own node and with middleware.

Module 5: Humans in the loop

interrupt(), tool approval and time travel.

Project: Transfers and emails that wait for a person's sign-off.

  1. Interrupts and human approval: interrupt(), validated answers, durable pauses and parallel approvals.
  2. Tool approval with middleware: HumanInTheLoopMiddleware per call: approve, edit and reject.
  3. Time travel: replay and fork: Checkpoint history, repeating a step and forking with update_state.

Module 6: Composition, quality and final project

Subgraphs, advanced streaming, agentic RAG, testing and the complete assistant.

Project: Tienda Andina's support assistant.

  1. Subgraphs: Shared state, own schemas, inner streaming, pauses and jumps to the parent.
  2. Advanced streaming: Your own progress, tokens by tag, several modes, async and v3 events.
  3. Agentic RAG: Search, grade, rewrite and answer with sources, and defend against an injection.
  4. Testing graphs and agents: pytest, isolated nodes, partial runs, fake models and integration.
  5. Final project: a support assistant: Guardrail, agent as a subgraph, RAG, refund approval, memory and tests.

Prerequisites

  • Intermediate Python: functions, classes, types and virtual environments
  • Having used a language model through an API or with LangChain (for example, the first agents course)
  • Docker Desktop with at least 6 GB of memory, and uv (class 1 explains how to install them)

Next courses

  • Advanced LangGraph: Agents in Production · Advanced · 25 hours
    Take your LangGraph agents to production: the runtime from the inside, durable execution, fault tolerance, multi-agents, custom middleware, guardrails, MCP, v3 streaming, Agent Server, Docker, security, observability and evaluation. 20 labs with a local model in Docker, based on the official documentation.
  • Advanced Generative AI: Short- and Long-Term Memory with RAG and LangGraph · Advanced · 25 hours
    Design, measure and deploy an assistant's memory: the conversation, long-term memory for each customer and the company's knowledge with RAG. 20 labs with a local model, PostgreSQL with pgvector and Redis in Docker Compose, based on the official documentation.

See all courses