chapter one

1 When and why to use agent design patterns

 

This chapter covers

  • Why we need agents and agent design patterns
  • Improving the reliability of foundational models with agents
  • Simplifying and standardizing agent design and agent quality
  • Solving common design challenges, including capability, reliability, and robustness, with agent design patterns

You have just written a detailed prompt explaining to the language model what to do with your data. You double-check the wording, reminders, and data formatting before sending your request. When the model responds, it greets you, summarizes the task, and begins to reason through some steps while crunching your data. Soon, however, the results begin to look confusing. The model claims to have followed one of your instructions, only for you to find that the output is unaffected by it. The model skips a step. “That’s OK,” you think, “it was probably obvious.” But the more you read, the more you realize the model has disregarded your instructions, gone on a tangent, and done only half of its job. Its response seems like a taunt: “Would you like me to explain any of the above steps, or do you need help with anything else?”

At this point, you need to decide how to fix the half-done job. “Should I try my prompt again? Should I ask the model to review its outputs and retry? Can I switch to a more powerful model? Or would copying the outputs and fixing the mistakes manually be fastest?”

1.1 Why build agents?

1.1.1 What is an agent?

1.1.2 Why do we design agents?

1.2 AI’s problems already have solutions

1.2.1 What can we do with ADPs?

1.2.2 Using ADPs can pay off in multiple ways

1.3 Summary