Podcast Summary: Building AI Agents on the Frontend with Sam Bhagwat and Abhi Iyer
Software Engineering Daily | October 30, 2025
Overview
This episode features a deep-dive into frontend AI engineering with Sam Bhagwat (CEO, Mastra) and Abhi Iyer (CTO, Mastra), as interviewed by host Nick Nisi. The central theme explores why building AI agents in JavaScript/TypeScript on the frontend matters, the motivations and design of the open-source framework Mastra, key technical concepts (agent primitives, workflows, RAG, MCP integration), and navigating the rapid shifts in AI development.
1. The Motivation Behind Mastra
[02:26–05:04]
-
Insight: Existing AI agent frameworks are mostly Python-based and backend-focused, creating friction for frontend TypeScript/JavaScript developers.
-
Sam and Abhi (and co-founder Shane) founded Mastra out of "frustration" with the state of available JS/TS libraries while building an AI-powered CRM—ultimately pivoting their focus completely.
-
Quote:
"It was born out of frustration...using the TypeScript AI libraries that were available...didn't feel like any of them were up to snuff."
—Sam [02:26] -
They deliberately chose TypeScript due to the founders’ expertise and the frontend developer audience.
-
Abhi:
"We're devtool snobs a little bit, but we gave things a fair shot...there was a point where you think: I'm just going to go fetch from OpenAI directly and just do this myself."
[03:53]
2. What Is Mastra?
[05:04–06:58]
- Mastra is an open-source TypeScript framework for building AI agents. It includes primitives for:
- Agent (core intelligent entity)
- Tools (functionalities the agent can use)
- Workflows (structured, deterministic process flows)
- RAG (Retrieval-Augmented Generation)
- Eval/tracing/memory (for development and debugging)
- Use cases: Agentic features in SaaS, internal automation, vertical agents for specific industries, creation of LLM-powered applications (e.g., personal email manager, anime writers, scientific diagram generation).
- Quote:
"We may have started Master with like two primitives...and then we learned that a lot of people were learning AI engineering through Mastra's primitives."
—Abhi [05:56]
3. What is an AI Agent, Really?
[06:35–09:48]
-
The definition of "agent" is loaded and on a spectrum, from simple LLM prompt completion to complex, autonomous, multi-step, multi-agent systems.
-
Abhi:
"We're trying to reflect the human intelligence through our primitives...an agent can speak, it can execute workflows...you have memories as humans, so do agents."
[06:58] -
The more autonomous, interactive, and capable of chaining tasks and reasoning, the "more agentic" a system is.
-
Sam:
"If you're doing code execution...and sending the feedback and error states back...that’s like higher on the agency spectrum."
[09:48]
4. The Power of Composability: Agents, Tools, Workflows
[10:05–13:15]
- Mastra's core design revolves around composable primitives:
- Agents can invoke tools or workflows; workflows can invoke agents or tools.
- Hierarchies and delegation (e.g., agent handoff between tasks).
- Workflows exist to impart determinism amid LLM non-determinism and are deeply integrated for observability (tracing, debugging).
- Initial skepticism about workflows evolved as demand for structure became obvious.
- Sam:
"In AI engineering, having this kind of workflow parameter that has tracing built in...is relatively more important because you're wrapping these non-deterministic agents."
[13:15]
5. Real-World Use Cases & Vertical Agents
[14:28–18:40]
-
Examples:
- Aerospace: Generate CAD diagrams by extracting context from lengthy PDFs.
- Veterinary SaaS: Transcribe doctor-patient interactions, auto-generate structured action items.
- General pattern: "Vertical agents"—domain-specific, task-oriented AI.
-
Definition:
"You're making agents that can...autonomously create complete tasks...or assist humans...it's kind of doing work for people..."
—Sam [17:47] -
Vertical agents target both low- and high-skill tasks in different industries (finance, manufacturing, sales, etc.).
6. Onboarding & Developer Education
[21:41–24:21]
- Mastra's documentation is treated as a "second product."
- Innovations:
- MCP Docs Server: Bring interactive documentation and Q&A into the developer’s IDE.
- Mastra 101 Course: Step-by-step agent-building tutorial, delivered via MCP, supports multilingual learning via LLMs.
- Abhi:
"Docs have to be super good...but then, even with the docs, they don’t teach you architecture...we created the Master 101 course...within your IDE."
[22:07]
7. Integration with MCP (Model Context Protocol)
[24:46–29:17]
-
MCP enables external agents or LLMs (e.g., Claude, VSCode Copilots) to discover/exploit tools via REST endpoints—Mastra supports both building and consuming MCP servers/clients.
-
MCP acts as a decentralized integration hub ("a better NPM") for agent functionalities, broadening agents’ cross-language access to new tools.
-
Abhi:
"The low key benefit...the MCP server doesn't have to be written in JavaScript. You could use tools from all over the communities..."
[28:41] -
The "MCP Registry Registry" started as a meta-joke, became a real feature for tool discovery.
-
Sam:
"Everybody was releasing MCP registries and we were like, what if we...released an MCP Registry Registry...it was like a joke that became a feature."
[25:22]
8. Marketing, Community, and Open Source Strategy
[31:32–35:43]
- Open source and community advocacy are vital for tool adoption, technical education, and surfacing in LLM responses (i.e., "LLM SEO").
- The team wrote the book Principles of Building AI Agents to help developers grok agent concepts. Book is freely available and widely cited as clarifying.
- Community-driven content (including international tutorials) feeds discoverability both for humans and the LLMs scanning the web.
- Sam:
"If you build a great developer tool that people love using, everyone feels is the right thing...the models will kind of surface that to people who are coming in, asking them."
[35:43]
9. Lessons Learned & Developer Experience Philosophy
[36:35–48:25]
- Not all early bets paid off. For example, prompt builder utilities were killed after negative community feedback.
- Some architectural missteps required major rewrites (e.g., workflow engine, model routing API integration).
- Mastra’s celebrated developer experience (DX) draws from Gatsby’s legacy—powerful "playground" UI and easy CLI onboarding.
- Abhi:
"If you're a dev tools builder, anyone says 'that's cool' actually means go F yourself...So I'm just all distraught...I think we have to rebuild everything. And we did."
[43:51] - The playground is now read-only, code-first, and offers live agent chat, tool trace visualization, and workflow diagrams, helping developers see and iterate fast.
10. Roadmap & Future Directions
[49:13–52:49]
- Ongoing work on:
- Eval infrastructure: Building robust, built-in scoring and evaluation methods.
- Templates & Starters: One-command setup for common use cases (e.g., docs chatbots).
- Agent learning/feedback loops (synthetic evals, agent improvement from trace logs)
- Advanced agent primitives: authentication, security guardrails, multi-agent networks, multimodal support (voice, image, video.)
- Fast-moving external landscape (model capabilities, provider sandboxes, frontends) informs priorities.
- Sam:
"The core primitives are what our roadmap looks like right now...some of it is interoperability, some of it is integration with providers, but a lot is driven by ecosystem needs."
[49:13]
11. Closing Thoughts and Advice
[53:01–56:48]
-
Learning agent engineering takes immersion; don’t get discouraged by the complexity or jargon.
- Sam:
"We've now watched probably a dozen folks go through this transition and it's just a little bit of time and immersion...Just use Master...immerse yourself for a month or two."
[53:01]
- Sam:
-
Community events, workshops, livestreams, and support are central to Mastra's mission.
- Abhi:
"We're really dedicated to education...every Thursday there's a master workshop...We also do a live stream agent's hour where we talk...just the things."
[54:08]
- Abhi:
-
Contact & Next Steps:
- npm:
npm create mastra@latest - Discord, X/Twitter: @mastraai, @abhiiyer, @calcsam
- Free book: mastra.ai/book
- npm:
Notable Quotes and Moments
-
On building for TypeScript:
"It has to be in TypeScript because...the whole point of what we were trying to do in the first place."
—Abhi [03:53] -
On agent complexity:
"Agentic is a spectrum...It could start as LLM calls, it could progress into structured workflows...then you get the AGI thing..."
—Abhi [08:13] -
On learning curve:
"At Monster, we think docs is our second product. It's as important as anything we built."
—Abhi [22:07] -
On adopting MCP:
"We got so lucky on the MCP hype...it was like January or November, actually, and we just took a bet and then it was good..."
—Abhi [24:58] -
On fast-moving AI:
"AI time is sort of like two to three or four times as fast as normal time...it's like singularity, black hole, something. Time dilation."
—Sam [39:36] -
On developer community:
"If you build a great developer tool...the models will kind of surface that to people who are coming in, asking..."
—Sam [35:43] -
On the inner loop:
"The playground is kind of a visual chat tool...it lets you see the traces. So it kind of gives you like a tool playground..."
—Sam [45:05]
Timestamps for Key Segments
- [01:23] Introductions
- [02:26] How Mastra was founded
- [05:04] What is Mastra?
- [06:35] What is an agent?
- [10:05] Composability: agents, tools, workflows
- [14:28] Real-world use cases and vertical agents
- [21:41] Getting started and educational tooling
- [24:46] MCP integration and Registry Registry story
- [31:32] Marketing a dev tool in an LLM-first world
- [36:35] Product pivots and developer experience philosophy
- [43:51] Origins and evolution of the Playground UI
- [49:13] Roadmap, new features, and the future
- [53:01] Advice and closing thoughts
Takeaways
- Mastra fills a real gap for frontend / TypeScript developers wanting to build agentic AI features without backend or Python friction.
- Composable primitives, strong developer experience, and deep educational support are at the foundation of its adoption.
- Community-led content, open source, and modern distribution (via LLM SEO) prove increasingly vital in a fast-evolving software landscape.
- The agent engineering field is young, jargon-heavy, and rapidly innovating—but with the right tools and education, it's accessible and exciting for new developers.
