Agents vs Workflows: Why Not Both? — Sam Bhagwat, Mastra.ai

Introduction and Debate Context 00:00

  • The talk addresses the debate between using agents versus workflows in AI, asking why not use both.
  • References a recent debate in the AI community, especially on Twitter and in blog posts from Anthropic and OpenAI.
  • Controversy arose around OpenAI's stance that seemed dismissive of workflow approaches, stirring responses in the community.
  • Highlights the influential role of large model providers in shaping discourse due to their elevated position.

Critiques on Existing Approaches and APIs 02:07

  • Warns against "that guy" mentality, where some believe there is only one right way to develop systems, especially when coming from dominant companies.
  • Notes historical parallels from past web development debates, especially with technologies pushed by major companies.
  • Criticizes “graph node and edge” terminal APIs in workflow and agent frameworks, arguing they reduce readability and accessibility for teams.
  • Advocates for more intuitive, readable, and linear workflow syntax over graph-based representations, favoring patterns that don't require understanding graph theory.

Design Patterns and Definitions 06:12

  • Draws from architectural design pattern literature, noting its influence on software engineering.
  • Points out there is still a lack of standardized language and patterns for composing agents and workflows in AI systems.
  • Defines agents as interactive, turn-based components (like turn-based games), while workflows are sequences of dependent steps (like tech tree progression in strategy games).
  • Emphasizes that tracking dependencies and handling non-determinism are especially important in AI systems.

Trade-offs and Practical Patterns 10:06

  • Discusses trade-offs between power and control in system design—sometimes you need more control (workflows), sometimes more power (agents).
  • Suggests breaking down complex or unreliable processes into more structured, manageable workflow steps to increase reliability.
  • Recommends diagramming and explaining architectures to peers as a way to uncover better, more creative solutions.

Composing Agents and Workflows 11:49

  • Explains that agents and workflows can be composed in multiple ways: agents can use other agents as tools, agents can be workflow steps, workflows can function as tools for agents, etc.
  • Describes the agent supervisor model where a supervising agent orchestrates other agents performing specialized tasks.
  • Notes that the real benefits come from combining these patterns creatively.

Practical Considerations and Community Advice 13:23

  • Dynamic tool injection is discussed: limit the number of tools an agent accesses simultaneously to improve performance.
  • Recommends thoughtful assignment of tools to agents, especially as tasks get more complex.
  • Encourages community members to share practical experiences and adapt theory based on what works in practice, as the field is evolving quickly.
  • Asserts that effective solutions may be ahead of formal theoretical understanding in this rapidly developing area.

Q&A and Closing 14:20

  • Responds to a question about agents using many tools: if it works in practice, continue with that approach even if theory suggests otherwise.
  • Emphasizes that practice is evolving faster than theory in the field of agentic workflows.
  • Provides information for connecting after the talk and encourages attendees to pick up a copy of the speaker’s book.