Agents, learnings from Anthropic
Agents, Agentic Workflows and Workflow Patterns
What’s an Agent?
Agents function like workflows, but with AI deciding what process or tool to use next.
Most agents are just LLMs using external tools—taking in data, making decisions, and acting accordingly. They are LLMs with enhancements like retrieval, tool integration, and memory.
There’s a trade-off: higher costs, more compute, and sometimes slower execution. But in return, you gain flexibility—fewer hardcoded conditions and more dynamic problem-solving.
Agentic Workflows
Different patterns shape how agentic workflows operate. A few examples:
Prompt Chaining: Breaks tasks into steps for better results.
Example: Generate marketing copy → Translate → Format.Routing: Directs tasks to the right process.
Example: FAQ bot for general queries, automation for refunds, AI for tech support.Sectioning: Splits work across multiple models.
Example: One model generates responses, another moderates content.Voting: Runs multiple times for accuracy, enabling models to challenge each other.
Example: Content moderation using three models to balance false positives.Orchestrator-Workers: A central LLM assigns tasks to worker models—similar to map-reduce for LLMs.
Example: Separate research workers doing the research, which gets aggregated later.Evaluator-Optimizer: One LLM generates, another evaluates and refines, creating a self-improvement loop.
Example: Preparing the feedback and improving it execution-by-execution.
Agentic workflows have best practices, design patterns, and bad smells—just like coding.
Sources:
https://www.anthropic.com/research/building-effective-agents