Workflow Support in @mastra/react
I just noticed there's a special version of
useChat in @mastra/react (discovered it through this Github Issue).
I'm glad I found that because that's something I was missing and I already started building a similar hook.
I've got some questions regarding the package:
1. Afaik the package is currently not documented. The code is pretty straightforward, but I'd like to know when an official release is planned.
2. Agents are explicitly supported through useChat, is something similar planned for Workflows (or open to contributions to achieve official support)?
3. The package also includes an AI Elements integration. Will this be an integral part of the package or could this be split into a second package? I noticed a import './ui/index.css'; in the top-level index.ts and wasn't sure whether or not that might cause side effects. For projects not using Tailwind or AI Elements that want to use the hooks it might be reassuring if these were isolated.
Anyway, thanks for that integration and keep up the great work!GitHub
mastra-ai/mastra
The TypeScript AI agent framework. ā” Assistants, RAG, observability. Supports any LLM: GPT-4, Claude, Gemini, Llama. - mastra-ai/mastra
5 Replies
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10334
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @Sebastian for helping us improve Mastra!
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10335
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @Sebastian for helping us improve Mastra!
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10336
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @Sebastian for helping us improve Mastra!
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10337
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @Sebastian for helping us improve Mastra!
š Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10338
š If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
š Thank you @Sebastian for helping us improve Mastra!
Hey @Sebastian ! Thanks for the question!
You found our secret stuff! JK
@mastra/react right is being used internally in the playground, mainly for the useMastraClient and the transforms. We added UI there too as an experiment, i think its reasonable to decouple UI from it.
Open for contributions of course!
Thanks for the quick reply @Abhi Aiyer!
For now I'll stick to the standard
useChat until I've worked out a nice API for dealing with workflows and patterns to organize the UI components.
I previously tried CopilotKit and their headless API for rendering additional UI was pretty slick.
AG-UI seemed a bit limited for what I'm trying to do, but that might change when they start supporting workflows.
I have not finally settled on one lib, but I'm also having a call with one of their maintainers next week.
Ideally the @mastra/react package would be agnostic to UI libraries other than React, but using the same ecosystem as the backend (no additional conversions into other formats and same domains in terms of naming and structures).
That's pretty much what I was missing out of the box in order to build everything just with Mastra.
That would also steepen the learning curve for newcomers quite a bit (the different libraries and formats caused a lot of confusion for me at the beginning).Yeah MastraClient is the foundation for any UI lib flavor, we use react internally so are experimenting there!
We've been making progress in standard useChat with workflows,agents,networks etc. So sticking with that is a good option!
Going to close this issue out, thanks for being active here!
Sure, thanks for the insights!
I'll keep an eye on updates to the package and share my progress.