mastra  by mastra-ai

TypeScript framework for AI agent development

created 1 year ago
15,401 stars

Top 3.2% on sourcepulse

GitHubView on GitHub
Project Summary

Mastra is an opinionated TypeScript framework for building AI applications, offering primitives for agents, workflows, RAG, and evaluations. It targets developers seeking to rapidly develop and deploy AI-powered features, supporting any LLM provider through a unified interface.

How It Works

Mastra leverages the Vercel AI SDK for LLM interoperability, enabling seamless integration with providers like OpenAI, Anthropic, and Google Gemini. Its core components include: Agents that orchestrate LLM actions using tools and workflows; Tools as typed, executable functions with schema validation and integration access; Workflows as durable, graph-based state machines supporting complex logic like loops and error handling; RAG for building knowledge bases via ETL pipelines; and Integrations for auto-generated, type-safe API clients.

Quick Start & Requirements

  • Install via npx create-mastra@latest.
  • Run with npm run dev.
  • Requires Node.js (v20.0+).
  • LLM provider API keys (OpenAI, Anthropic, Google Gemini, Groq, Cerebras) are necessary.
  • Environment variables ANTHROPIC_API_KEY or GOOGLE_GENERATIVE_AI_API_KEY may be required.
  • Official docs: https://docs.mastra.ai/

Highlighted Details

  • Unified interface for any LLM provider via Vercel AI SDK.
  • Agents can call custom functions, third-party APIs, and access knowledge bases.
  • Workflows feature built-in OpenTelemetry tracing.
  • Evals provide automated, model-graded testing for LLM outputs.

Maintenance & Community

Licensing & Compatibility

  • License: MIT.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The framework is opinionated, which may require adaptation for highly custom architectures. Contribution guidelines suggest discussing code contributions via issues before submitting pull requests.

Health Check
Last commit

17 hours ago

Responsiveness

1 day

Pull Requests (30d)
585
Issues (30d)
290
Star History
2,969 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Taranjeet Singh Taranjeet Singh(Cofounder of Mem0), and
1 more.

fragments by e2b-dev

0.6%
6k
Next.js template for AI-generated apps
created 1 year ago
updated 1 week ago
Starred by Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
3 more.

composio by ComposioHQ

0.2%
26k
Toolset for AI agent integrations via function calling
created 1 year ago
updated 18 hours ago
Feedback? Help us improve.