Lesson 1 of 6 in Agents in Production · 9m

Anatomy of an agent

ReAct showed that interleaving reasoning with actions, so the model thinks, calls a tool, reads the result and thinks again, beats reasoning or acting alone on question answering and interactive tasks [1]. Toolformer showed models can learn when an API call will help [2], and Reflexion showed agents can improve across attempts by writing verbal feedback on their own failures into memory [3]. Those three ideas, a loop, tools and feedback, are the anatomy of every agent shipped today.

Workflows versus agents

Anthropic draws a useful line: workflows orchestrate models and tools through predefined code paths, while agents direct their own process and tool use. Their advice is to find the simplest solution that works and add complexity only when it measurably helps [4].

  • Prompt chaining: fixed steps, each feeding the next.

  • Routing: classify the input, then send it to a specialised handler.

  • Parallelisation: run independent subtasks or votes at once.

  • Orchestrator–workers: a lead model splits work and delegates it.

  • Evaluator–optimiser: one model drafts, another critiques, and they loop [4].

Key takeaways

  • An agent is a model, tools and a loop.
  • Prefer a workflow when the steps are known.
  • Add autonomy only when evaluation shows it helps.
Sources
  • Yao, S. et al. (2022). ReAct: Synergizing Reasoning and Acting in Language Models. ICLR 2023 · arXiv:2210.03629.
  • Schick, T. et al. (2023). Toolformer: Language Models Can Teach Themselves to Use Tools. NeurIPS 2023 · arXiv:2302.04761.
  • Shinn, N. et al. (2023). Reflexion: Language Agents with Verbal Reinforcement Learning. NeurIPS 2023 · arXiv:2303.11366.
  • Anthropic (2024). Building effective agents. Anthropic Engineering.

Keep going with Agents in Production

This is one of 6 lessons in the course. Enroll to get the rest of the course, with an AI tutor that knows the material, flashcards and a certificate when you finish.

Enroll for free

Next free lesson: Context engineering

More free lessons from this course