Quickstart
Turn your Mastra Agents into an agent-native application in 10 minutes.
Build agents that get smarter with every use.
Rich Threads keep messages, generative UI, and tool activity available across sessions and devices.
Learning turns real usage into skills that improve your agent.
Build a new agent or bring one you already have. Any frontend, any backend.
Prerequisites#
Before you begin, you'll need the following:
- An OpenAI API key
- Node.js 20+
- Your favorite package manager
Getting started#
Create a free account#
Sign up for a free developer account for CopilotKit Intelligence to get a license key. You'll use it later to enable persistent threads and the inspector.
Choose your starting point#
You can either start fresh with our starter template or integrate CopilotKit into your existing Mastra Agent.
🎉 Start chatting!#
Your AI agent is now ready to use! Try asking it some questions:
What tools do you have access to?What do you think about React?Show me some cool things you can do!Troubleshooting
- If you're having connection issues, try using
0.0.0.0or127.0.0.1instead oflocalhost - Make sure your Mastra agent is running on port 4111, and that
MASTRA_BASE_URLpoints at it curl http://127.0.0.1:4111/api/agentsshould list your agent by name- Check that your OpenAI API key is correctly set in the
.envfile
Open Inspector and confirm setup#
On localhost, click the Inspector button in the corner of the app.
- Open Agents, then Agent. Your agent is listed.
- Send a chat message. Open Agents, then AG-UI Events. Events are moving.
- Open Threads. The list is unlocked (Intelligence is on), or locked with Enable Intelligence (Intelligence is off).
More detail: Inspector.
What's next?#
Now that you have your basic agent setup, explore these advanced features: