mastra

Build TypeScript AI agents with memory, tools, workflows, and RAG.

1.6k|123|Updated Jul 15, 2019
One-click install
npx skills add https://github.com/hashintel/hash --skill mastra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mastra
Source: https://github.com/hashintel/hash/tree/main/.codex/skills/mastra
Command: npx skills add https://github.com/hashintel/hash --skill mastra

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mastra provides a TypeScript framework for building AI agents with memory, tools, workflows, and retrieval-augmented generation (RAG).

Core Features & Use Cases

  • Memory management with working memory and conversation history
  • Tools integration and deterministic workflows
  • RAG capabilities with vector stores and embeddings
  • MVP API references and runtime context for agents

Quick Start

Install Mastra and follow the Getting Started guide at mastra.ai/docs/v1/getting-started/installation.

Frequently Asked Questions about mastra

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build AI agents with memory and tool integration?

Build AI agents using Mastra, a TypeScript framework providing memory management for conversation history, deterministic tool orchestration, and workflow coordination. Install Mastra packages and define structured tools with inputSchema, outputSchema, and execute functions to create memory-enabled agents.

What memory adapters and vector stores does Mastra support?

Mastra supports memory adapters including LibSQL, MongoDB, Postgres, and Upstash, plus vector stores like pgvector, Pinecone, Qdrant, and MongoDB. Choose based on your infrastructure to enable persistent agent memory and semantic search across your RAG workflows.

How do I implement retrieval-augmented generation with Mastra?

Implement RAG by processing and chunking documents, configuring vector embeddings, and performing cost-aware vector search through Mastra's RAG capabilities. Mastra handles document ingestion, embedding integration, and vector store coordination end-to-end.

Can I build multi-step workflows with Mastra agents?

Yes, Mastra supports deterministic multi-step workflows using .then() and .commit() methods. Chain tool calls, streaming, and generation modes together to create complex agent reasoning pipelines with explicit control flow.

Does Mastra integrate with MCP clients and servers?

Mastra includes MCP client and server integration, enabling your agents to communicate with external tools and services through the Model Context Protocol. This extends tool availability and interoperability beyond native Mastra tools.

What's the difference between streaming and generation modes in Mastra workflows?

Streaming mode outputs results progressively as they're generated, while generation mode waits for complete results before returning. Select based on latency requirements and whether real-time feedback or final outputs matter for your agent workflow.