Agent Design Patterns
Workflow vs Agent: Know What You Need First
A counterintuitive insight: the most successful AI implementations are rarely the most complex ones. Before you start building an Agent framework, make sure you truly understand what you need.
Core Insight
"The most successful implementations weren't using complex frameworks or specialized libraries. Instead, they were building with simple, composable patterns."
Every AI product manager should commit this to memory. The industry is flooded with Agent frameworks (LangChain, AutoGen, CrewAI...), but production environments have repeatedly proven: the systems that work best use the simplest composable patterns.
Two Core Concepts
Workflow
LLMs and tools are orchestrated through predefined code paths. The developer decides the execution order at code-write time: do A, then B, then C.
Keywords: determinism, predictability, developer-controlled flow
Agent
The LLM dynamically determines its own execution flow and tool usage. At every step, the model autonomously decides what to do next, whether to call a tool, and when to stop.
Keywords: autonomy, dynamic decision-making, model-controlled flow
Flow Comparison
Workflow: Code-determined flow
Input
Step A
Step B
Output
Agent: Model-determined flow
Input
LLM Decision
Tool / Think / Re-decide
Output
Side-by-Side Comparison
| Dimension | Workflow | Agent |
|---|---|---|
| Control | Developer (fixed code path) | Model (dynamic at each step) |
| Predictability | High — same input, same execution path | Low — same input may yield different paths |
| Best fit | Well-defined tasks, fixed steps | Open-ended tasks, flexible decisions needed |
| Cost | Predictable (fixed number of calls) | Uncertain (loop count unknown) |
| Debug difficulty | Low (deterministic path, easy to reproduce) | High (non-deterministic, hard to reproduce) |
| Typical examples | Copywriting pipelines, data-cleaning pipelines | Cursor, Claude Code, Devin |
When NOT to Use an Agent
In most cases, you don't need an Agent
Practice shows: for most use cases, optimizing a single LLM call with Retrieval-Augmented Generation (RAG) is sufficient. Only when simpler solutions clearly cannot meet requirements should you consider introducing the complexity of Workflow or Agent.
A common over-engineering mistake: using an Agent framework to solve a problem that could be handled with one Prompt plus one search. The latency, cost, and non-determinism a framework introduces far outweigh its benefits.
A common over-engineering mistake: using an Agent framework to solve a problem that could be handled with one Prompt plus one search. The latency, cost, and non-determinism a framework introduces far outweigh its benefits.
Core Principle: The Complexity Ladder
Start with the simplest solution — add complexity only when it demonstrably improves outcomes
- 1 Try a single LLM call first: optimize your Prompt, add Few-shot examples, tune Temperature
- 2 Not enough? Add Retrieval-Augmented Generation (RAG): give the LLM access to external knowledge
- 3 Still not enough? Use a Workflow: break the task into multiple steps and control the flow with code
- 4 Genuinely need flexible decision-making? Only then reach for an Agent: let the model plan and execute autonomously
Not every problem needs an Agent — a Workflow often suffices, and sometimes a well-tuned Prompt is all you need. Complexity is a cost, not a feature. Only add complexity when it demonstrably delivers value.