Mastra

Package

TypeScript framework for AI agents, workflows, memory and RAG

Price
Free, open source; paid cloud plans
Access
LLM provider API key

About

Mastra is an Apache-2.0 TypeScript framework for agents, graph workflows, memory, RAG and evals, with a model router for 40+ providers. It runs in Node.js, React or Next.js apps; the hosted Mastra platform adds observability and deployment.

What you can do with it

  • Build a TypeScript agent with tools and memory in a Node.js app
  • Chain LLM steps into workflows with branching, suspend and resume
  • Expose your agents and tools as an MCP server

Get started

  1. Install @mastra/core and zod, or run npm create mastra@latest
  2. Set your model provider's API key, e.g. OPENAI_API_KEY

Example

import { Agent } from "@mastra/core/agent";

const agent = new Agent({
  id: "assistant",
  name: "Assistant",
  instructions: "You are a helpful assistant.",
  model: "openai/gpt-5.6-sol",
});
const response = await agent.generate("Help me organize my day");
console.log(response.text);

Details

Hosting
Hosted service, Runs locally
Available in
Worldwide
Official SDKs
JavaScript/TypeScript
MCP server
None

Tasks

Alternatives

Other tools for the same tasks.

Last checked on .