Not every agent interaction is a chat. Sometimes the agent is executing a multi-step plan, and the best way to show progress is a todo list that updates in real time. The deep agent todo list pattern reads aDocumentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-cbuipl-1779916257-33d1bcf.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
todos array
directly from the agent’s state, rendering each item with its current status as
the agent works through its plan. It’s a progress dashboard built on the same
useStream hook you use for chat. It shows that agent state can power any UI,
not just message bubbles.
How it works
Deep agents include a built-intodos state that tracks task progress as
the agent works through its plan. As the agent executes, it updates each
todo’s status from "pending" to "in_progress" to "completed". The
useStream hook exposes this state via stream.values.todos, and your UI
renders it reactively.
The flow looks like this:
- User submits a request
- Agent creates a plan and populates
todosin its state - Agent begins executing each todo transitions through
pending→in_progress→completed stream.values.todosupdates in real time as the agent progresses- Your UI re-renders the todo list with current statuses
Setting up useStream
No special configuration is needed. Point useStream at your agent and
read the todos from stream.values.
The code examples use
useStream<typeof myAgent> for type-safe stream state. See Type inference for Python or JavaScript backends.Building the TodoList component
The todo list renders each item with a status icon, color coding, and visual styling that reflects the current state:Progress bar
A visual progress bar gives users an at-a-glance summary of overall completion:Individual todo items
Each item gets a status icon, color-coded text, and strikethrough styling for completed tasks:in_progress icon uses animate-pulse to draw attention to the currently
active task.
Calculating progress
Derive progress metrics directly from the todos array:Combining with chat messages
The todo list works alongside the regular chat interface. A practical layout shows the todo list as a persistent sidebar or header panel, with chat messages below:Use cases
The todo list pattern fits any scenario where an agent executes a structured plan:- Project planning: agent breaks a project into tasks and works through them sequentially
- Research workflows: each research question becomes a todo that the agent investigates and completes
- Data processing: steps like ingestion, validation, transformation, and export each get their own todo
- Onboarding flows: agent walks through setup steps, checking off each one as it configures services
- Report generation: sections of a report become todos: gather data, analyze trends, write summary, format output
Handling empty and loading states
Handle the initial state before the agent has created its plan:Best practices
- Show the todo list prominently. It’s the primary progress indicator for plan-based agents. Don’t bury it below the fold.
- Animate status transitions. Smooth transitions make the agent feel more responsive. Use CSS transitions on background color, text decoration, and opacity.
- Only highlight one
in_progressitem. Agents typically work on one task at a time. If multiple items show asin_progress, the UI gets noisy. Consider only pulsing the first one. - Collapse or dim completed items. As the list grows, completed items become less relevant. Reduce their visual weight so users focus on what’s still happening.
- Show the progress percentage. A single number like “67% complete” is immediately understandable, even from across the room.
- Keep the todo list in sync. Because
stream.valuesupdates reactively, the todo list stays current automatically. Don’t add manual polling or refresh logic.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

