examples/canvas/mastra-pm/README.md
A comprehensive workshop demonstrating AG-UI (Agent User Interaction) protocol with Mastra integration. This workshop shows how to build sophisticated AI applications with shared state, multiple client interfaces, and rich user interactions.
AG-UI is a protocol for communicating between AI Agents and Users, enabling:
Learn more: @ag-ui/mastra on npm
This workshop is organized into 3 progressive steps, each building on the previous to demonstrate different aspects of AG-UI:
Branch: git checkout step-1
Link: https://github.com/CopilotKit/CopilotKit/tree/main/examples/canvas/mastra-pm
Focus: Core concepts and simple state management
Branch: git checkout step-2
Link: https://github.com/CopilotKit/CopilotKit/tree/main/examples/canvas/mastra-pm
Focus: Structured data and agent personas
Branch: git checkout step-3
Link: https://github.com/CopilotKit/CopilotKit/tree/main/examples/canvas/mastra-pm
Focus: Full-featured project management interface
By completing this workshop, you'll understand:
git clone <repository-url>
cd mastra-pm-canvas
pnpm install
echo "OPENAI_API_KEY=your-key-here" >> .env
# Start from the beginning
git checkout step-1
# Or jump to a specific step
git checkout step-2
git checkout step-3
Each step provides two different client interfaces for the same agent:
pnpm dev
# Opens http://localhost:3000
pnpm cli
# Interactive chat in your terminal
Key Point: Both interfaces connect to the same agent and share the same state. This demonstrates AG-UI's power in enabling multiple client types.
git checkout step-1 # Basic concepts
# Work through step-1, then:
git checkout step-2 # Enhanced state management
# Work through step-2, then:
git checkout step-3 # Full application
# See what changed between steps
git diff step-1 step-2 --name-only
git diff step-2 step-3 --name-only
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā Web Client ā ā Mastra Agent ā ā CLI Client ā
ā (CopilotKit) āāāāāŗā + AG-UI āāāāāŗā (Terminal) ā
ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāā
ā Shared-State ā
ā + Memory ā
āāāāāāāāāāāāāāāā
After completing this workshop:
Happy Building! š