[{"data":1,"prerenderedAt":466},["ShallowReactive",2],{"mdc-o54qn4-key":3},{"data":4,"body":5},{},{"type":6,"children":7},"root",[8,17,33,37,44,49,57,70,73,79,84,119,122,128,133,177,186,189,195,202,228,234,245,261,264,270,276,281,287,292,298,303,306,312,320,353,361,406,409,415,420,428,461],{"type":9,"tag":10,"props":11,"children":13},"element","h2",{"id":12},"mastra-complete-guide",[14],{"type":15,"value":16},"text","Mastra — Complete Guide",{"type":9,"tag":18,"props":19,"children":20},"blockquote",{},[21],{"type":9,"tag":22,"props":23,"children":24},"p",{},[25,31],{"type":9,"tag":26,"props":27,"children":28},"strong",{},[29],{"type":15,"value":30},"Agents • Workflows • Memory • Production",{"type":15,"value":32},"\nBuild Production Ready AI Agents, Workflows & Applications.",{"type":9,"tag":34,"props":35,"children":36},"hr",{},[],{"type":9,"tag":38,"props":39,"children":41},"h3",{"id":40},"what-is-mastra",[42],{"type":15,"value":43},"What is Mastra?",{"type":9,"tag":22,"props":45,"children":46},{},[47],{"type":15,"value":48},"Mastra is an open source TypeScript framework built for creating AI powered applications, workflows, and agents with production grade developer experience. Instead of wiring together dozens of libraries manually, Mastra provides a structured way to build AI systems that can reason, execute tools, and maintain memory.",{"type":9,"tag":22,"props":50,"children":51},{},[52],{"type":9,"tag":26,"props":53,"children":54},{},[55],{"type":15,"value":56},"The Workflow:",{"type":9,"tag":58,"props":59,"children":64},"pre",{"className":60,"code":62,"language":15,"meta":63},[61],"language-text","Developer → Mastra → Agents → Tools → Execution\n","",[65],{"type":9,"tag":66,"props":67,"children":68},"code",{"__ignoreMap":63},[69],{"type":15,"value":62},{"type":9,"tag":34,"props":71,"children":72},{},[],{"type":9,"tag":38,"props":74,"children":76},{"id":75},"why-mastra-matters",[77],{"type":15,"value":78},"Why Mastra Matters",{"type":9,"tag":22,"props":80,"children":81},{},[82],{"type":15,"value":83},"Building AI apps traditionally involves managing disjointed layers (Model, API, Memory, Storage). Mastra abstracts these concerns into a unified architecture.",{"type":9,"tag":85,"props":86,"children":87},"ul",{},[88,99,109],{"type":9,"tag":89,"props":90,"children":91},"li",{},[92,97],{"type":9,"tag":26,"props":93,"children":94},{},[95],{"type":15,"value":96},"Productivity:",{"type":15,"value":98}," Organize LLMs, prompts, and tool calling into a single framework.",{"type":9,"tag":89,"props":100,"children":101},{},[102,107],{"type":9,"tag":26,"props":103,"children":104},{},[105],{"type":15,"value":106},"Scalability:",{"type":15,"value":108}," Modular design makes large AI applications easier to maintain.",{"type":9,"tag":89,"props":110,"children":111},{},[112,117],{"type":9,"tag":26,"props":113,"children":114},{},[115],{"type":15,"value":116},"Production Ready:",{"type":15,"value":118}," Built in support for monitoring, memory, and structured workflows.",{"type":9,"tag":34,"props":120,"children":121},{},[],{"type":9,"tag":38,"props":123,"children":125},{"id":124},"core-architecture",[126],{"type":15,"value":127},"Core Architecture",{"type":9,"tag":22,"props":129,"children":130},{},[131],{"type":15,"value":132},"Mastra follows a 4 layer modular AI architecture:",{"type":9,"tag":134,"props":135,"children":136},"ol",{},[137,147,157,167],{"type":9,"tag":89,"props":138,"children":139},{},[140,145],{"type":9,"tag":26,"props":141,"children":142},{},[143],{"type":15,"value":144},"Layer 1 — Agent:",{"type":15,"value":146}," The decision maker (Reasoning, Tool Selection, Planning).",{"type":9,"tag":89,"props":148,"children":149},{},[150,155],{"type":9,"tag":26,"props":151,"children":152},{},[153],{"type":15,"value":154},"Layer 2 — Workflow:",{"type":15,"value":156}," Controls multi step execution and validation.",{"type":9,"tag":89,"props":158,"children":159},{},[160,165],{"type":9,"tag":26,"props":161,"children":162},{},[163],{"type":15,"value":164},"Layer 3 — Tools:",{"type":15,"value":166}," Modular extensions (Search, Email, Database, API).",{"type":9,"tag":89,"props":168,"children":169},{},[170,175],{"type":9,"tag":26,"props":171,"children":172},{},[173],{"type":15,"value":174},"Layer 4 — Memory:",{"type":15,"value":176}," Stores history, context, sessions, and preferences.",{"type":9,"tag":58,"props":178,"children":181},{"className":179,"code":180,"language":15,"meta":63},[61],"USER ↔ APPLICATION ↔ AGENT ↔ WORKFLOW ↔ TOOLS ↔ MEMORY\n",[182],{"type":9,"tag":66,"props":183,"children":184},{"__ignoreMap":63},[185],{"type":15,"value":180},{"type":9,"tag":34,"props":187,"children":188},{},[],{"type":9,"tag":38,"props":190,"children":192},{"id":191},"quick-start-installation",[193],{"type":15,"value":194},"Quick Start Installation",{"type":9,"tag":196,"props":197,"children":199},"h4",{"id":198},"requirements",[200],{"type":15,"value":201},"Requirements",{"type":9,"tag":85,"props":203,"children":204},{},[205,213],{"type":9,"tag":89,"props":206,"children":207},{},[208],{"type":9,"tag":26,"props":209,"children":210},{},[211],{"type":15,"value":212},"Node.js 20+",{"type":9,"tag":89,"props":214,"children":215},{},[216,221,223],{"type":9,"tag":26,"props":217,"children":218},{},[219],{"type":15,"value":220},"pnpm",{"type":15,"value":222}," & ",{"type":9,"tag":26,"props":224,"children":225},{},[226],{"type":15,"value":227},"TypeScript",{"type":9,"tag":196,"props":229,"children":231},{"id":230},"setup-project",[232],{"type":15,"value":233},"Setup Project",{"type":9,"tag":58,"props":235,"children":240},{"className":236,"code":237,"language":238,"meta":63,"style":239},"language-bash","npm create mastra@latest\ncd my-mastra-app\nnpm install\nnpm run dev\n","bash","undefined",[241],{"type":9,"tag":66,"props":242,"children":243},{"__ignoreMap":63},[244],{"type":15,"value":237},{"type":9,"tag":22,"props":246,"children":247},{},[248,250,259],{"type":15,"value":249},"Open ",{"type":9,"tag":251,"props":252,"children":256},"a",{"href":253,"rel":254},"http:\u002F\u002Flocalhost:3000",[255],"nofollow",[257],{"type":15,"value":258},"localhost:3000",{"type":15,"value":260}," to see your environment.",{"type":9,"tag":34,"props":262,"children":263},{},[],{"type":9,"tag":38,"props":265,"children":267},{"id":266},"real-world-use-cases",[268],{"type":15,"value":269},"Real World Use Cases",{"type":9,"tag":196,"props":271,"children":273},{"id":272},"_1-ai-customer-support",[274],{"type":15,"value":275},"1. AI Customer Support",{"type":9,"tag":22,"props":277,"children":278},{},[279],{"type":15,"value":280},"An agent driven system that uses internal knowledge bases to provide context aware responses and execute support actions.",{"type":9,"tag":196,"props":282,"children":284},{"id":283},"_2-internal-operations-assistant",[285],{"type":15,"value":286},"2. Internal Operations Assistant",{"type":9,"tag":22,"props":288,"children":289},{},[290],{"type":15,"value":291},"Automate document search, summarization, and internal Q&A with deep integration into company files.",{"type":9,"tag":196,"props":293,"children":295},{"id":294},"_3-ai-operations-dashboard",[296],{"type":15,"value":297},"3. AI Operations Dashboard",{"type":9,"tag":22,"props":299,"children":300},{},[301],{"type":15,"value":302},"Connect monitoring tools directly to agents that can analyze alerts and take automated remediation actions.",{"type":9,"tag":34,"props":304,"children":305},{},[],{"type":9,"tag":38,"props":307,"children":309},{"id":308},"production-deployment-security",[310],{"type":15,"value":311},"Production Deployment & Security",{"type":9,"tag":22,"props":313,"children":314},{},[315],{"type":9,"tag":26,"props":316,"children":317},{},[318],{"type":15,"value":319},"Recommended Stack:",{"type":9,"tag":85,"props":321,"children":322},{},[323,333,343],{"type":9,"tag":89,"props":324,"children":325},{},[326,331],{"type":9,"tag":26,"props":327,"children":328},{},[329],{"type":15,"value":330},"Runtime:",{"type":15,"value":332}," Mastra + Docker",{"type":9,"tag":89,"props":334,"children":335},{},[336,341],{"type":9,"tag":26,"props":337,"children":338},{},[339],{"type":15,"value":340},"Database:",{"type":15,"value":342}," Postgres + Redis",{"type":9,"tag":89,"props":344,"children":345},{},[346,351],{"type":9,"tag":26,"props":347,"children":348},{},[349],{"type":15,"value":350},"Deployment:",{"type":15,"value":352}," Vercel \u002F Cloud",{"type":9,"tag":22,"props":354,"children":355},{},[356],{"type":9,"tag":26,"props":357,"children":358},{},[359],{"type":15,"value":360},"Security Checklist:",{"type":9,"tag":85,"props":362,"children":365},{"className":363},[364],"contains-task-list",[366,379,388,397],{"type":9,"tag":89,"props":367,"children":370},{"className":368},[369],"task-list-item",[371,377],{"type":9,"tag":372,"props":373,"children":376},"input",{"disabled":374,"type":375},true,"checkbox",[],{"type":15,"value":378}," Limit tool access to minimum required scopes.",{"type":9,"tag":89,"props":380,"children":382},{"className":381},[369],[383,386],{"type":9,"tag":372,"props":384,"children":385},{"disabled":374,"type":375},[],{"type":15,"value":387}," Always protect API keys with secrets management.",{"type":9,"tag":89,"props":389,"children":391},{"className":390},[369],[392,395],{"type":9,"tag":372,"props":393,"children":394},{"disabled":374,"type":375},[],{"type":15,"value":396}," Implement input validation and audit logging.",{"type":9,"tag":89,"props":398,"children":400},{"className":399},[369],[401,404],{"type":9,"tag":372,"props":402,"children":403},{"disabled":374,"type":375},[],{"type":15,"value":405}," Monitor LLM usage and token costs in real time.",{"type":9,"tag":34,"props":407,"children":408},{},[],{"type":9,"tag":38,"props":410,"children":412},{"id":411},"conclusion-beyond-simple-prompts",[413],{"type":15,"value":414},"Conclusion: Beyond Simple Prompts",{"type":9,"tag":22,"props":416,"children":417},{},[418],{"type":15,"value":419},"Mastra is about creating structured AI systems that behave predictably in production. As AI applications evolve, frameworks that combine agents, workflows, and memory become essential infrastructure.",{"type":9,"tag":22,"props":421,"children":422},{},[423],{"type":9,"tag":26,"props":424,"children":425},{},[426],{"type":15,"value":427},"Resources:",{"type":9,"tag":85,"props":429,"children":430},{},[431,441,451],{"type":9,"tag":89,"props":432,"children":433},{},[434],{"type":9,"tag":251,"props":435,"children":438},{"href":436,"rel":437},"https:\u002F\u002Fmastra.ai",[255],[439],{"type":15,"value":440},"Official Website",{"type":9,"tag":89,"props":442,"children":443},{},[444],{"type":9,"tag":251,"props":445,"children":448},{"href":446,"rel":447},"https:\u002F\u002Fmastra.ai\u002Fdocs",[255],[449],{"type":15,"value":450},"Documentation",{"type":9,"tag":89,"props":452,"children":453},{},[454],{"type":9,"tag":251,"props":455,"children":458},{"href":456,"rel":457},"https:\u002F\u002Fgithub.com\u002Fmastra-ai\u002Fmastra",[255],[459],{"type":15,"value":460},"GitHub Repository",{"type":9,"tag":462,"props":463,"children":464},"style",{},[465],{"type":15,"value":63},1781719506734]