Hello! Welcome back.
In our last lesson, we explored the classic "build vs. buy" trade-off, weighing the control of a custom-built agent against the speed of an Agent Development Kit (ADK). We concluded that for many projects, especially during prototyping and scaling, an ADK is the right choice.
This brings us to a critical follow-up question: if you decide to use an ADK, which one is right for you? The answer isn't about features alone; it's about the core design philosophy of the framework. Different ADKs are built on fundamentally different ideas about how an agent's logic should be orchestrated.
In this lesson, you will compare the primary design philosophies of ADKs, focusing on the distinction between code-first frameworks and graph-based orchestration. As a software engineer, understanding these architectural paradigms will enable you to look past the marketing and evaluate tools based on how they align with your technical needs and mental models for building complex systems.
The Spectrum of Abstraction: Script, Map, or Conversation
When you build an agent, you're essentially defining a workflow: a series of steps involving reasoning, tool use, and decision-making. ADKs provide different ways to define that workflow, which generally fall into three main philosophies:
- Code-First / Programmatic Control: This approach treats agent orchestration like writing a standard program. You use classes, functions, and familiar control flow patterns to define the agent's behavior. The mental model is "writing a script."
- Graph-Based / State Machine Orchestration: This approach models the agent's logic as a state machine. You explicitly define states (nodes) and transitions (edges) in a graph. The mental model is "drawing a flowchart" or a system diagram.
- Conversational / Actor-Based: This approach models the system as a team of specialized agents who collaborate by sending messages to each other. The workflow emerges from their dialogue. The mental model is "directing a team meeting."
Let's dive into each of these to understand their structure, strengths, and weaknesses.
1. Code-First Frameworks: "Writing a Script"
The code-first philosophy is designed to feel natural to software engineers. It leverages familiar object-oriented and procedural programming concepts to construct agentic workflows. Instead of learning a new declarative syntax or graph paradigm, you build agents by instantiating classes and calling methods.
Google's Agent Development Kit (ADK) is a prime example of this philosophy.
Google ADK vs LangGraph: Which One Develops and ...
This article from ZenML, 'Google ADK vs LangGraph', provides an excellent, code-level comparison of the two main orchestration models. We'll start with its description of the code-first approach.
Please read the section titled 'Feature 1. Orchestration Model'. Focus specifically on the subsection for 'Google ADK'. Pay close attention to the two ways it allows you to compose agents and the conceptual code example provided. This will feel very familiar to your programming experience.
As the article explains, the code-first approach gives you two primary methods of control:
- Pre-built Workflow Agents: You can enforce a deterministic structure using classes like
SequentialAgentorParallelAgent. This is analogous to writing a script that executes a series of functions in a fixed order or concurrently. - Dynamic LLM-based Routing: You can use a primary
LlmAgentas an intelligent router. This parent agent is given a set of sub-agents (specialists) and uses its reasoning ability to decide which one to delegate a task to based on the current context. This is like having a main function that calls different subroutines based on conditional logic.

The bottom line for Code-First:
- Strengths: Highly intuitive for developers, lower initial learning curve, and provides a good balance between predictable, structured workflows and dynamic, LLM-driven flexibility.
- Weaknesses: For highly complex, cyclical, or non-linear workflows (e.g., an agent that needs to try something, fail, reflect, and try a different approach), managing the state and control flow purely in code can become cumbersome and hard to visualize.
2. Graph-Based Frameworks: "Drawing a Map"
The graph-based philosophy argues that complex agent behavior, with its potential for loops, branches, and retries, is best modeled as a state machine. This approach forces you to be explicit about every possible state and transition, providing unparalleled control and observability.
LangGraph, an extension of LangChain, is the leading example of this design. It was created specifically to address the limitations of simpler, linear chains for building sophisticated agents.
Let's start with a video that clearly contrasts the earlier "chain" model with the newer "graph" model.
LangChain vs LangGraph: A Tale of Two Frameworks
This IBM Technology video, 'LangChain vs LangGraph', does a fantastic job of visually explaining the shift from linear sequences to stateful graphs.
Please watch the following segments: Introducing LangGraph (03:08 - 05:33): Notice how the workflow is defined as a graph of nodes (actions) and edges (transitions), with a central 'state' component that maintains context. Direct Comparison (05:33 - 08:24): This is the key part. Pay close attention to the structural difference between a DAG (Directed Acyclic Graph) used in LangChain and a graph with loops in LangGraph. This ability to loop and revisit states is what enables complex agentic behaviors like self-correction.
The video introduces the core concepts, which are formalized in the LangGraph framework:
- State: A central data object (e.g., a Python dictionary or Pydantic model) that is passed to every node. It acts as the agent's memory for a given run.
- Nodes: Python functions that represent a single step or computation (e.g., call an LLM, run a tool, ask for human input). Each node receives the current state and can return updates to it.
- Edges: Connections that define the path of execution from one node to the next. Critically, these can be conditional edges, which act as routers to dynamically direct the flow based on the current state.
This structure allows you to explicitly "draw" your agent's logic. You can easily create loops for retries, branches for different tool choices, and entry points for human-in-the-loop validation.
The bottom line for Graph-Based:
- Strengths: Unparalleled, granular control over the workflow. Excellent for complex, non-linear, and cyclical tasks. The explicit nature makes the agent's logic highly observable and easier to debug.
- Weaknesses: A steeper learning curve, as it requires thinking in terms of states and transitions. It can be more verbose for simple, linear tasks where a code-first approach would be more direct.
The contrast between these two philosophies is so fundamental that it's often described as the difference between writing a script and drawing a map.
The Architect's Guide to Deep Research Agents
The article 'The Architect's Guide to Deep Research Agents' provides a high-level, strategic view of these differences.
Please read the following three short sections: 'LangGraph: Granular Control with Stateful, Graph-Based Workflows' 'Orchestration & Control: The Spectrum from Script to State Machine' 'Developer Experience & Abstraction: Writing a Script vs. Drawing a Map' These sections perfectly summarize the philosophical differences and how they impact you as a developer.
3. Conversational & Actor-Based Frameworks: "Directing a Team"
A third emerging philosophy treats orchestration as a collaborative conversation. Instead of a single agent following a script or a map, you define a "crew" of autonomous agents, each with a specific role and set of tools. The workflow is not explicitly coded; it emerges from the dialogue between these agents as they work together to solve a problem.
Microsoft's Autogen and CrewAI are prominent examples of this approach.
Which Agentic AI Framework to Pick? LangGraph vs. CrewAI vs. AutoGen
To understand this third philosophy, let's watch selections from 'Which Agentic AI Framework to Pick?'. This video introduces the core concepts of Autogen and CrewAI.
Please watch these two clips: Autogen's Actor Framework (01:33 - 02:43): This explains how Autogen is based on the 'actor framework,' where each agent is an actor that communicates via messages. CrewAI's 'Crew' Abstraction (15:57 - 16:46): This shows how CrewAI formalizes this concept with 'crews' of agents assigned specific roles and tasks. Focus on the core idea: you define the specialists and the task, and the framework manages their interaction.
The bottom line for Conversational/Actor-Based:
- Strengths: A powerful, high-level abstraction for problems that can be decomposed into a team effort (e.g., "write a blog post" could involve a researcher agent, a writer agent, and an editor agent). Can be very fast to set up for these types of tasks.
- Weaknesses: The emergent nature of the workflow can make it less predictable and much harder to debug and control with precision compared to code-first or graph-based systems. You have less granular control over the exact sequence of steps.
Test your understanding!
Imagine you need to build an agent for two different use cases. For each, which design philosophy (Code-First, Graph-Based, or Conversational/Actor-Based) would be the most natural starting point, and why?
-
Use Case A: An automated system that processes insurance claims. The workflow is complex and requires multiple steps:
- Check the claim against a fraud detection model.
- If the fraud score is high, it must be flagged for human review.
- If the score is low, extract details and call an external pricing API.
- If the API call fails, retry up to 3 times with exponential backoff.
- If it still fails, flag for human review.
- If successful, submit the payment.
-
Use Case B: A marketing assistant that generates a social media campaign for a new product. The task involves:
- Researching the target audience and competitors.
- Writing several distinct pieces of copy (e.g., a tweet, a LinkedIn post, an ad slogan).
- Creating a relevant image for the campaign.
- Reviewing all assets together for brand consistency before presenting the final campaign.
Show answer
-
Use Case A: Graph-Based.
- Why: This workflow is full of conditional logic (if/else), loops (retries), and explicit state transitions (e.g., "pending_review," "payment_submitted"). A graph-based framework is perfect for modeling this kind of explicit, high-stakes state machine. It provides the required control and observability to ensure the process is reliable and auditable.
-
Use Case B: Conversational/Actor-Based.
- Why: This task naturally decomposes into a collaboration between different specialists: a "Research Analyst" agent, a "Copywriter" agent, a "Graphic Designer" agent, and a "Marketing Manager" agent to perform the final review. A conversational framework like CrewAI or Autogen is designed for exactly this kind of multi-agent collaboration, where each agent contributes its specialized skill to a larger project.
Conclusion
You've now surveyed the three primary design philosophies that shape modern Agent Development Kits. There is no single "best" approach; the right choice depends entirely on your specific problem and your desired trade-off between ease of use, control, and predictability.
Key Takeaways:
- Code-First Frameworks (e.g., Google ADK) are like writing a script. They are intuitive for software engineers and excel at workflows with clear, programmatic logic and dynamic routing.
- Graph-Based Frameworks (e.g., LangGraph) are like drawing a map or flowchart. They offer maximum control and observability, making them ideal for complex, stateful, and cyclical agent logic where reliability is paramount.
- Conversational/Actor-Based Frameworks (e.g., Autogen, CrewAI) are like directing a team meeting. They provide high-level abstractions for simulating collaboration between specialized agents, best suited for tasks that can be decomposed into distinct roles.
In the next lesson, we will build directly on this foundation. We will position popular tools like LangChain/LangGraph, Google ADK, and Autogen within these design philosophies, discuss their industry adoption, and analyze their ecosystems. This will equip you to make a practical, informed decision when selecting an ADK for your next project.