Skip to main content
Lesson 4 of 18·5 min

Create an Agent

In this lesson, you'll add a brand-new Theme Park Agent to your Mastra project and get it showing up in Mastra Studio. This is a "keep it simple" step—no tools or workflows yet—so you can focus on getting a clean baseline you can run, tweak, and debug.

You'll create the agent file, write a tight instructions block that controls tone and behavior, and then wire the agent into the app so it becomes available in Studio. After that, you'll run a quick test prompt to confirm the agent responds the way you intended.

This matters because the instructions are the foundation for everything you'll add later—tools, workflows, and external data only help if the agent's default behavior is already solid. You'll also use Studio's observability view to verify what the model actually saw and produced, and you'll see how enabling memory changes follow-ups from "stateless" to consistent, ongoing conversations.

"Start simple—lock in the agent's behavior and output format first. Then add capabilities like tools once you know the baseline is working."

— Guil Hernandez

Mentioned in the Lesson
Direct link to Mentioned in the Lesson

Code:

Relevant Mastra docs:

Join the Community
Direct link to Join the Community

Ask questions:

Follow Mastra:

  • X — follow Mastra for updates
  • YouTube — watch more tutorials
  • LinkedIn — follow for updates

Don’t miss the next Mastra lessons

Be notified the moment new lessons release and stay ahead of every update. We’ll email you about course improvements, new Mastra features, and upcoming live workshops. Unsubscribe anytime.