Today, we are pleased to announce our partnership: CopilotKit 🤝 Mastra.
Mastra, The TypeScript Agent Framework
Mastra is an open-source agent framework for building reliable, production-grade AI agents.
It gives developers the building blocks to go from simple LLM calls to full agent workflows. Some of the core capabilities include:
- Multi-LLM support: Easily switch between providers like OpenAI, Anthropic, Gemini, and local models. Stream responses with type-safe APIs.
- Agents with tools: Extend agents with typed functions and external API integrations. Agents can reason, then call into your systems to get work done.
- Workflows: Durable, graph-based workflows with branching, looping, and error handling. Workflows persist state across steps and can even pause for human input.
- RAG support: Out-of-the-box chunking, embedding, and vector search for retrieval-augmented generation.
- Observability: Built-in OpenTelemetry tracing for debugging and monitoring agents in production.
- Evaluations: Automated evals (model-graded, rule-based, statistical) so you can test and trust your agent outputs.
This makes Mastra a strong foundation for reasoning, execution, and orchestration at scale.
But reasoning is only half the story. For agents to feel useful to end users, they need a way to collaborate in real time, inside the product itself.
The UI Layer-Where CopilotKit Comes In
CopilotKit provides the AG-UI (Agent–User Interaction protocol)- a standard way to bring backend agents into the front end.
Instead of showing Mastra’s outputs in a static chat bubble, CopilotKit renders them as interactive React components: editable, clickable, and collaborative. Users can guide, correct, and co-create with the agent, all inside the app.
Getting Started in Under 2 Minutes
The fastest way to try Mastra + CopilotKit together is with our starter template.
Just run:‍
npx create-ag-ui-app@latest --mastra
‍
This scaffolds a full example app- Mastra agents on the backend, CopilotKit + AG-UI on the frontend in less than two minutes.
You’ll have an interactive agent running locally with no extra setup.
Developers can now pair Mastra’s robust agent framework with CopilotKit’s interaction layer to ship agents that feel natural to work with.
Check out the AG-UI Canvas with CopilotKit + Mastra: https://go.copilotkit.ai/ag-ui-canvas-mastra
Watch the full video walkthrough: https://go.copilotkit.ai/ag-ui-canvas-mastra-video
Start building your first interactive Mastra-powered agentic app.
‍
Get notified of the latest news and updates.
