Combine Mastra’s orchestration with Generative UI from Thesys to move beyond text-only agents. Render agentic UIs that include real-time dashboards, dynamic forms, and interactive workflows - all generated from your agent logic. With lightweight React or TypeScript integration, you can turn multi-agent workflows into production-ready applications that feel natural, adaptive, and user-friendly.Documentation Index
Fetch the complete documentation index at: https://docs.thesys.dev/llms.txt
Use this file to discover all available pages before exploring further.
This guide assumes you have basic knowledge of Mastra and NextJS.
You’ll also need a Thesys API key from the C1 Console.
Create a new Mastra agent
You can follow the Mastra Quickstart to create a new Mastra agent
or just follow along this guide. We’ll set up the example weather agent from the Quickstart but change
the LLM provider to Thesys.
- Setting up the Mastra server
- Building the agent
- Building the tool
src/server/index.ts
Implement the chat endpoint
We will modify the chat endpoint from the template app
to use our newly created Mastra agent and return the response as a SSE stream.
- Modifying the chat endpoint
- Modifying the message store
src/app/api/chat/route.ts
View the code
Find more examples and complete code on our GitHub repository.