Skip to main content

Command Palette

Search for a command to run...

Agents : Architecture and Design

Updated
2 min read
Agents : Architecture and Design

The term “agent” can have multiple interpretations. Some define agents as fully autonomous systems that operate independently over extended periods, leveraging various tools to complete complex tasks. Others use the term to refer to more structured implementations that adhere to predefined workflows.

We categorize all these variations as agentic systems, but we draw an important architectural distinction between workflows and agents:

Workflows are structured systems where LLMs and tools operate through predefined code paths.

Agents, in contrast, dynamically determine their own processes and tool usage, maintaining control over how they accomplish tasks.

Workflows

When complexity increases, workflows offer predictability and consistency for well-defined tasks, whereas agentsexcel when flexibility and model-driven decision-making are needed at scale.

Types of Workflows

Prompt Chaining

A structured sequence of LLM interactions, where each step builds on the previous one.

Routing

When to use it: Best suited for complex tasks that require distinct handling for different categories. This workflow relies on classification—either by an LLM or a traditional model/algorithm—to direct tasks down the appropriate paths.

Parallelization

When to use it: Ideal when subtasks can be executed simultaneously for increased speed or when multiple perspectives or attempts improve accuracy. LLMs tend to perform better when each consideration in a complex task is handled through a separate LLM call.

Orchestrator-Workers

When to use it: This workflow is effective for complex tasks where the necessary subtasks cannot be predicted in advance. Unlike parallelization, where tasks are predefined, an orchestrator determines which subtasks are needed based on input.

Example: Coding tools that modify multiple files dynamically, depending on the nature of the requested changes.

Evaluator-Optimizer

In this iterative workflow, one LLM generates a response while another evaluates and refines it in a feedback loop.

Agents

When to use agents: Agents are ideal for open-ended problems where the number of required steps is unpredictable, and a fixed process cannot be hardcoded. They enable LLMs to operate autonomously over multiple turns, making them well-suited for scaling tasks in trusted environments where decision-making flexibility is essential.

Summary

We often mistake workflows for agents, assuming they operate the same way. However, when I started using Claude Code, I truly understood what an agent actually is. Many times, we’re using workflows but believe there’s an agent working behind the scenes.

Above definitions and diagrams are from Anthropic guidelines towards building effective agents https://www.anthropic.com/engineering/building-effective-agents

AI Agents

Part 1 of 2

This series delves into agentic patterns, architectural frameworks, memory paradigms, and the emerging Model Context Protocol (MCP) to create intelligent, scalable, and adaptable AI systems.

Up next

Agents : Memory

Implementing Long-Term Memory in AI Agents (Semantic, Episodic, Procedural) with LangMem AI agents powered by large language models (LLMs) can appear more intelligent and personalized when they remember information over time. By equipping agents with...