Overview
The hard part of building agents (or any LLM application) is making them reliable enough. While they may work for a prototype, they often fail in real-world use cases.Why do agents fail?
When agents fail, it’s usually because the LLM call inside the agent took the wrong action / didn’t do what we expected. LLMs fail for one of two reasons:- The underlying LLM is not capable enough
- The “right” context was not passed to the LLM
The agent loop
A typical agent loop consists of two main steps:- Model call - calls the LLM with a prompt and available tools, returns either a response or a request to execute tools
- Tool execution - executes the tools that the LLM requested, returns tool results