AI Agents and Workflows

7 lessons

Module Progress...
AI Agents and Workflows

Plan and Execute Agent

Build a financial research agent that plans multi-step analysis upfront, executes each step through a tool registry, and replans when findings change.

A ReAct agent thinks one step ahead - call a tool, observe, decide what to do next. That works for simple lookups, but falls apart when a task needs coordinated research across multiple steps. The plan and execute pattern fixes this by creating an upfront plan, executing it step by step, and optionally replanning when things change. Most agentic coding tools (e.g. Claude Code, Cursor, Codex) have built-in planning and execution capabilities, which only illustrates the usefulness of this pattern.

We'll build a financial research agent that takes an analysis request, plans which metrics and news articles to fetch, executes each step through a tool registry, and hands the full scratchpad to a report writer that produces a final report.

Tutorial Goals

  • Understand plan and execute vs ReAct and when each pattern fits
  • Build a LangGraph agent with conditional replanning
  • Use Pydantic to output structured plans from different agents
  • Organize tools by node with a ToolRegistry pattern
  • Run multi-query research with tools and replanning

Plan and Execute Architecture

Footnotes

  1. Plan-and-Solve Prompting (Wang et al., 2023)

  2. ToolRegistry: A Protocol-Agnostic Tool Management Library for Function-Calling LLMs