← AI Tools
WorkflowBeginner

Mastra

Open-source TypeScript AI agent framework — developed by the founder of Gatsby.

Mastra is an open-source TypeScript AI agent framework developed by Mastra Inc., which was founded in late 2024 by Sam Bhagwat, the co-founder of Gatsby. Similar to how React builds web interfaces by combining UI components, Mastra builds AI agent applications by combining four core primitives: Agent, Workflow, Memory, and Tool. It features a Model Router that connects over 90 LLM providers (including OpenAI, Anthropic, and Google Gemini) through a single interface, requiring only one line of code to be modified when switching providers. In April 2026, it secured a $22 million Series A investment led by Spark Capital (totaling $35 million), and has established itself as a leading AI agent framework in the TypeScript ecosystem, with 25.2k stars on GitHub and over 300,000 weekly downloads on npm.

The existing AI agent framework market has been dominated by Python-based tools such as LangChain, CrewAI, and AutoGen. For web full-stack developers to build agents, they had to set up a separate Python environment or bear the cost of language conversion, and there was also the issue of type safety being broken between the front-end, back-end, and agent. Mastra directly addresses this gap. Its graph-based workflow engine allows complex multi-step pipelines to be declaratively constructed using method chaining such as .then(), .branch(), and .parallel(), and it also incorporates human-in-the-loop pausing and resuming, state persistence, and time-travel debugging, providing a one-stop infrastructure for production-level agent operation. It also natively supports the creation of MCP (Model Context Protocol) servers, allowing agents and tools to be exposed externally using a standardized protocol.

From a practical application perspective, Mastra demonstrates strengths in three main scenarios. First, it can be used to embed AI agents into existing SaaS products, with companies like Replit, Sanity, and MongoDB integrating Mastra agents into their platforms to implement natural language-based data retrieval and workflow automation. Second, it can be used to build internal workflow automation copilots, allowing for the creation of long-term conversational assistants using a Memory Gateway in domains such as HR, sales, DevOps, and clinical research. Third, it can be used as a data analysis agent, where connecting Mastra agents to TypeScript-based research data portals or dashboards allows for database queries, report generation, and analysis pipeline triggering to be handled within a single conversational interface. Through Mastra Studio (localhost:4111), agent behavior can be visually monitored, and agent quality can be quantitatively measured using the built-in scorer and evaluation tools, allowing the entire lifecycle from prototyping to production deployment to be managed within a single framework.

💻 System Requirements

🧠RAM

Not required (LLM uses an external API call method; if using a local LLM, follow the requirements of that model)

💾Storage

Framework ~200MB (including node_modules), additional storage per project

⚡ Installation

4-1. Quick Start

npm create mastra@latest

Or, using a package manager:

pnpm create mastra
yarn create mastra
bunx create-mastra

4-2. Detailed Installation and Basic Usage

# Create a project (interactive setup)
npm create mastra@latest my-agent-app --default --llm openai

# Run the development server + Mastra Studio
cd my-agent-app
npx mastra dev
# → Mastra Studio: http://localhost:4111

Example agent definition:

import { Agent } from '@mastra/core/agent'

export const myAgent = new Agent({
  id: 'my-agent',
  name: 'Research Assistant',
  instructions: 'You are a helpful research assistant.',
  model: 'openai/gpt-4o',
})

// Usage
const result = await myAgent.generate('Summarize recent findings on CRISPR delivery.')
console.log(result.text)

🧬 Bio Use Cases

🔬

SaaS Embedded Agent

Add a natural language interface to your web application, allowing users to query data, modify settings, and trigger automations through conversation. This is a pattern adopted by companies like Replit, Sanity, and Brex, and can be implemented by connecting Mastra Agent with existing REST API tools.

🧬

Multi-Step Data Analysis Pipeline

Automate the process of collecting data from multiple sources, cleaning it, analyzing it, and generating reports using the .branch() and .parallel() functions of the Workflow engine. Human-in-the-loop validation steps can be inserted for intermediate verification.

💊

Internal Task Copilot

Build a domain-specific assistant that connects to 251 MCP tools, including Slack, Notion, and GitHub, while maintaining conversational context with the Memory Gateway. This can be used for onboarding new employees, automatically summarizing code reviews, and triaging issues.

FAQ

What is Mastra?

Mastra is an open-source TypeScript AI agent framework developed by Mastra Inc., which was founded in late 2024 by Sam Bhagwat, the co-founder of Gatsby. Similar to how React builds web interfaces by combining UI components, Mastra builds AI agent applications by combining four core primitives: Agent, Workflow, Memory, and Tool. It features a Model Router that connects over 90 LLM providers (including OpenAI, Anthropic, and Google Gemini) through a single interface, requiring only one line of code to be modified when switching providers. In April 2026, it secured a $22 million Series A investment led by Spark Capital (totaling $35 million), and has established itself as a leading AI agent framework in the TypeScript ecosystem, with 25.2k stars on GitHub and over 300,000 weekly downloads on npm. The existing AI agent framework market has been dominated by Python-based tools such as LangChain, CrewAI, and AutoGen. For web full-stack developers to build agents, they had to set up a separate Python environment or bear the cost of language conversion, and there was also the issue of type safety being broken between the front-end, back-end, and agent. Mastra directly addresses this gap. Its graph-based workflow engine allows complex multi-step pipelines to be declaratively constructed using method chaining such as .then(), .branch(), and .parallel(), and it also incorporates human-in-the-loop pausing and resuming, state persistence, and time-travel debugging, providing a one-stop infrastructure for production-level agent operation. It also natively supports the creation of MCP (Model Context Protocol) servers, allowing agents and tools to be exposed externally using a standardized protocol. From a practical application perspective, Mastra demonstrates strengths in three main scenarios. First, it can be used to embed AI agents into existing SaaS products, with companies like Replit, Sanity, and MongoDB integrating Mastra agents into their platforms to implement natural language-based data retrieval and workflow automation. Second, it can be used to build internal workflow automation copilots, allowing for the creation of long-term conversational assistants using a Memory Gateway in domains such as HR, sales, DevOps, and clinical research. Third, it can be used as a data analysis agent, where connecting Mastra agents to TypeScript-based research data portals or dashboards allows for database queries, report generation, and analysis pipeline triggering to be handled within a single conversational interface. Through Mastra Studio (localhost:4111), agent behavior can be visually monitored, and agent quality can be quantitatively measured using the built-in scorer and evaluation tools, allowing the entire lifecycle from prototyping to production deployment to be managed within a single framework.

When should I use Mastra?

Open-source TypeScript AI agent framework — developed by the founder of Gatsby.

What is a biomedical use case for Mastra?

SaaS Embedded Agent: Add a natural language interface to your web application, allowing users to query data, modify settings, and trigger automations through conversation. This is a pattern adopted by companies like Replit, Sanity, and Brex, and can be implemented by connecting Mastra Agent with existing REST API tools.

📄 Official Docs🐙 GitHub

📝 Update Notes

  1. v@mastra/core@1.80.010/31/2026

    이번 업데이트에서는 연구원 개별 계정의 OAuth 연결을 안전하게 지원하여, 에이전트가 각자의 실험 데이터나 클라우드 저장소에 보안을 유지하며 접근할 수 있게 되었습니다. 또한, 대규모 데이터 분석 및 워크플로우의 성능과 비용을 한눈에 모니터링할 수 있는 통합 관측성 기능이 강화되었습니다. 특히 오류 분류 체계와 실행 제어 기능이 개선되어, 복잡한 바이오 시뮬레이션이나 자동화된 파이프라인 운영의 안정성과 신뢰도를 높일 수 있습니다.

  2. v@mastra/core@1.79.010/25/2026

    MCP 이벤트 기능이 도입되어, 긴 시간이 소요되는 생물학적 시뮬레이션이나 데이터 처리 과정을 실시간 스트리밍으로 모니터링할 수 있게 되었어요. 에이전트별 비용과 지연 시간을 정밀하게 분석할 수 있는 기능이 강화되어, 대규모 유전체 데이터 분석 시 AI 자원을 더욱 효율적으로 관리할 수 있습니다. 또한, 샌드박스 내 파일 시스템 API가 개선되어 대용량 바이오 데이터 파일을 훨씬 빠르게 읽고 쓸 수 있어 작업 효율이 높아졌습니다. AI 에이전트를 활용해 복잡한 생명공학 워크플로우를 자동화하고 있는 연구원님께 이번 업데이트를 추천드려요.

  3. v@mastra/core@1.78.010/19/2026

    이번 업데이트에서는 에이전트의 'Scope' 기능이 도입되어, 연구 프로젝트나 실험 데이터별로 더욱 안전하고 독립적인 데이터 관리가 가능해졌어요. 또한, AI 워크플로우의 실행 과정을 추적하고 분석하는 기능이 강화되어 복잡한 생물학적 데이터 처리 과정의 오류를 훨씬 빠르고 정확하게 찾아낼 수 있습니다. 데이터 미리보기 기능의 성능도 개선되어 대량의 분석 로그를 훨씬 가볍고 빠르게 확인할 수 있게 되었어요. 특히 장기 실행되는 워크플로우의 안정성이 대폭 개선되어, 시간이 오래 걸리는 유전체 분석이나 단백질 구조 예측 같은 대규모 연산 작업의 신뢰도를 높이는 데 큰 도움이 될 거예요.

  4. v@mastra/core@1.75.010/7/2026

    이번 업데이트에서는 특정 작업의 실패 사례를 개별적으로 조회할 수 있는 기능이 추가되어, 복잡한 생물학적 데이터 처리 파이프라인의 오류를 훨씬 정밀하게 디버깅할 수 있어요. 또한, AI 모델 사용에 따른 토큰 및 비용 분석 기능이 강화되어 대규모 실험 데이터 분석 시 발생하는 비용을 효율적으로 관리할 수 있습니다. 특히 별도의 설정 없이도 벡터 저장소를 활용한 의미론적 검색이 가능해져, 방대한 논문이나 서열 데이터에서 필요한 정보를 찾는 작업이 더욱 간편해질 것으로 기대됩니다.

  5. v@mastra/core@1.72.010/2/2026

    이번 업데이트는 대규모 데이터 처리가 빈번한 생명공학 연구를 위해 작업의 안정성과 복구 능력을 대폭 강화했습니다. 백그라운드 작업의 중복 실행을 방지하고 복잡한 워크플로우 중 오류가 발생해도 안전하게 재개할 수 있는 기능이 추가되어, 긴 시간이 소요되는 시뮬레이션이나 분석 파이프라인의 신뢰도를 높여줍니다. 또한 Microsoft Teams 연동과 실시간 채널 연결 기능이 개선되어, 연구 데이터의 실시간 모니터링과 팀 내 알림 공유가 더욱 원활해질 것으로 기대됩니다.

  6. v@mastra/core@1.71.09/27/2026

    이번 업데이트에서는 도구 실행 방식이 개선되어 복잡한 생물정보학 데이터 처리 및 워크플로우의 대기 시간을 크게 줄일 수 있어요. 특히 MongoDB의 자동 임베딩 기능이 추가되어, 별도의 복잡한 설정 없이도 방대한 생물학 문헌이나 서열 데이터를 훨씬 쉽고 빠르게 의미 기반으로 검색할 수 있답니다. 또한, 관측(Observability) 기능이 강화되어 대규모 실험 데이터나 에이전트의 작업 흐름을 더욱 정밀하게 모니터링하고 추적할 수 있어 연구 데이터의 신뢰성을 높이는 데 큰 도움이 될 거예요.

  7. v@mastra/core@1.67.09/18/2026

    이번 업데이트에서는 워크플로우 빌더 백엔드가 도입되어 복잡한 실험 데이터 분석 파이프라인을 더욱 체계적으로 설계하고 자동화할 수 있습니다. 특히 @mastra/connect를 통해 외부 플랫폼 연동이 에이전트 도구로 통합되어, 보안 걱정 없이 다양한 생물학적 데이터베이스를 안전하게 활용할 수 있게 되었습니다. 또한 대용량 파일 업로드와 샌드박스 성능 개선으로 대규모 유전체 데이터나 고해상도 이미지 처리 작업이 훨씬 빠르고 효율적으로 변했습니다.

  8. v@mastra/core@1.66.09/13/2026

    이번 Mastra 업데이트에서는 실험 데이터의 추적과 관리가 더욱 정교해졌습니다. 특히 '메모리 변환 훅' 기능이 추가되어, 모델에 데이터를 전달하기 전 민감한 생물학적 정보를 자동으로 필터링하거나 재구성할 수 있어 데이터 보안과 전처리가 용이해졌습니다. 또한, 더욱 강력해진 트레이스 쿼리 기능을 통해 복잡한 실험 결과나 모델의 실행 이력을 상세한 조건으로 검색하고 분석할 수 있습니다. 스트리밍 안정성 및 성능 개선을 통해 대규모 바이오 데이터를 처리하는 AI 워크플로우의 신뢰성을 한층 높일 수 있습니다.

  9. v@mastra/core@1.51.07/15/2026

    이번 업데이트에서는 에이전트의 작업 중단 시 자동 복구 기능이 도입되어, 대규모 유전체 데이터 분석과 같이 긴 시간이 소요되는 작업이 서버 재시작 후에도 끊김 없이 이어질 수 있습니다. 또한, 동일한 리소스에 대해 독립적인 여러 세션을 동시에 실행할 수 있어, 하나의 샘플을 다양한 실험 조건으로 병렬 분석할 때 매우 효율적입니다. 새로운 샌드박스 제공 기능은 복잡한 바이오 시뮬레이션 도구를 안전하고 확장 가능한 환경에서 실행할 수 있도록 지원합니다. 이를 통해 더욱 안정적이고 정교한 AI 기반 생명공학 연구 워크플로우를 구축할 수 있습니다.

  10. v@mastra/core@1.50.07/8/2026

    이번 업데이트에서는 LiveKit 기반의 실시간 음성 에이전트 기능이 도입되어, 실험 중 장갑을 착용한 상태에서도 음성으로 AI와 상호작용하며 데이터를 기록하거나 명령을 내릴 수 있어요. 또한, 파일 시스템 기반의 자동 설정 기능 덕분에 복잡한 바이오 워크플로우와 실험 파이프라인을 별도의 복잡한 코드 없이도 훨씬 간결하게 관리할 수 있게 되었답니다. 통합된 스케줄링 API를 통해 실험 주기나 데이터 모니터링 작업을 더욱 안정적으로 자동화할 수 있으니, 실험 자동화 시스템을 구축 중인 연구원님들께 유용한 업데이트가 될 거예요.

  11. v@mastra/core@1.49.07/7/2026

    이번 업데이트에서는 실험 로그와 대규모 데이터를 효율적으로 관리할 수 있는 데이터 보관 정책 및 자동 삭제 기능이 도입되어 저장 공간 관리가 훨씬 용이해졌어요. 프로젝트별 데이터 격리 기능이 강화되어 여러 연구 프로젝트나 협업 그룹 간의 보안을 더욱 안전하게 유지할 수 있습니다. 또한, 복잡한 계층 구조의 서브 에이전트 지원과 기존 데이터를 재실행 없이 평가하는 기능 덕분에 정교한 바이오 데이터 분석 워크플로우를 더욱 효율적으로 자동화할 수 있어요.

  12. v@mastra/core@1.48.07/1/2026

    Mastra 1.48.0에서는 주기적인 스케줄링 기능인 'Heartbeats'가 도입되어, 실험 데이터의 정기적인 모니터링이나 분석 작업을 자동화하기 훨씬 좋아졌어요. 파일 기반의 에이전트 관리 기능 덕분에 복잡한 생물정보학 워크플로우를 구성하는 여러 에이전트를 더욱 체계적으로 운영할 수 있습니다. 특히 연구자의 승인이 필요한 단계에서 시스템이 재시작되더라도 작업 흐름이 유실되지 않도록 안정성이 크게 강화되었습니다. 또한, 업그레이드된 메모리 추출 API를 통해 연구 문헌이나 실험 노트에서 구조화된 데이터를 더욱 정교하게 추출할 수 있게 되었습니다.

  13. v@mastra/core@1.46.06/24/2026

    Highlights

    Multi-session Harness architecture (Session-first APIs)

    Harness is now a pure factory/shared-resource owner: create isolated sessions via harness.createSession() (get-or-create by resourceId), with run control, state, event bus, model/mode switching, permissions, OM, subagent settings, and thread lifecycle all moved onto Session domains (e.g. session.sendMessage(), session.thread.*, session.model.switch(), session.subscribe()), enabling safe concurrent multi-u

  14. v@mastra/core@1.45.06/19/2026

    긴 대화 기록을 훨씬 빠르고 저렴하게 불러올 수 있는 기능이 추가되어, 방대한 실험 로그나 연구 데이터를 다루는 작업이 더욱 쾌적해졌어요. AI 에이전트의 신호 처리 로직이 개선됨에 따라 복잡한 실험 워크플로우를 자동화할 때 발생하던 오류가 줄어들어 더욱 신뢰할 수 있는 결과물을 얻을 수 있습니다. 또한, 시스템 가이드가 명확해지면서 자동화된 태스크 수행 중 발생할 수 있는 프롬프트 혼선을 방지하여 더욱 안정적인 연구 환경을 제공합니다.

  15. v@mastra/core@1.42.06/17/2026

    이번 업데이트에서는 백그라운드 작업의 신뢰성이 향상되어, 대규모 바이오 데이터 분석이나 주기적인 실험 데이터 수집 프로세스를 더욱 안정적으로 자동화할 수 있어요. 특히 AI가 제안한 실험 계획을 연구원이 직접 검토하고 승인하는 '도구 중단 및 재개' 기능이 강화되어, 실험 프로토콜의 정확성을 높이는 Human-in-the-loop 워크플로우 구축이 훨씬 쉬워졌답니다. 또한, VoyageAI 임베딩 지원을 통해 방대한 생명공학 문헌이나 멀티모달 데이터를 더욱 정교하게 검색하고 분석할 수 있는 강력한 기능도 추가되었습니다.

🧪 Related Code of Life

No related Code of Life posts yet.

BioPlayground

Reading, linking, and lawful quotation stay open; high-speed bulk collection and unauthorized redistribution do not.

Unless stated otherwise, content rights belong to BioPlayground or the relevant rights holder.