Agent harness

Welcome to your new Mastra project! We're excited to see what you build.

This starter provides you with a general-purpose Mastra agent that can research current information, manage multi-step tasks, work with local files, run approved shell commands, and create recurring schedules.

Features

  • A project-level workspace/ for files and command execution
  • Approval gates for file changes, deletions, and shell commands
  • Conversation memory, generated thread titles, and task tracking
  • Built-in web search and direct web page fetching
  • Recurring schedules that persist across restarts
  • Local libSQL storage and DuckDB observability, with optional Turso storage
  • A bundled Mastra skill that helps coding agents use current Mastra APIs

Get started

Set your OPENAI_API_KEY in .env or in your environment, then run:

npm run dev

Open http://localhost:4111 in your browser to access Mastra Studio.

Select Agent in Mastra Studio and try one of these prompts:

  • Get the weather forecast for Austin this weekend.
  • Create a landing page for a Japanese sakura festival.
  • Check the SPCX stock price now, then check it every minute.

The agent asks for approval before it changes files or runs commands. When it creates a schedule, it returns an ID that you can use to pause the schedule.

Workspace safety

The local filesystem tools stay inside the project-level workspace/ directory. Shell commands start in that directory, but LocalSandbox does not provide operating-system isolation by default. Review command approvals carefully, and do not expose this template through an unauthenticated public server.

Storage

The default file:./mastra.db database stores agent memory, tasks, and schedules locally. To use Turso, set TURSO_DATABASE_URL and TURSO_AUTH_TOKEN in .env.

Recurring schedules continue to use model tokens until you pause them. Ask the agent to pause a schedule with the ID returned by start_schedule.

Making it yours

  • Edit src/mastra/agents/agent.ts to change the model, instructions, memory, workspace, or approval policy.
  • Edit src/mastra/tools/ to customize scheduling.
  • Edit src/mastra/index.ts to change storage and observability.
  • Add files or reusable skills under workspace/ for the agent to use.

Learn more

To learn more about Mastra, visit our documentation. If you're new to AI agents, check out our course and YouTube videos. You can also join our Discord community to get help and share your projects.

Deploy to the Mastra platform

The Mastra platform provides two products for deploying and managing AI applications built with the Mastra framework. Learn more in the Mastra platform documentation.