Building Effective Agents with Anthropic
The AI Engineer Summit wrapped up a few weeks ago in New York. If you missed it, don’t worry- I’m here to share key insights on AI agents!
Barry Zhang from Anthropic gave a short talk on how to build effective agents. One of the best examples of AI agents is Claude Code, so we probably have quite a bit to learn from Barry! Here are his three learnings:
1. Don't build agents for everything
In Barry's opinion, a use case that is suitable to be solved by agents need to meet the following criteria:
- Complex
- Valuable
- Low cost of error
If your use case does not meet one of these criteria, then you may be better off with using agentic workflows- clearly defined routines where you use LLMs.
As a side note, this is why I am much more bullish about agentic workflows than mainstream media. While it is fascinating to dream about AI agents that can 'freestyle' many tasks, most jobs to be done today have best practices. Agentic workflows allow us to adhere to those best practices.
2. Keep it simple
Your agent should have 3 components:
- Environment
- Tools
- Prompt
For example, a research agent will have the internet as their environment, search and website access as their tools, and "you are a helpful research agent" as their prompt.
Once you have identified the details of these 3 components, you can then optimise them. In other words, building an agent can be much simpler than you imagine.
3. Think like an agent
When an AI agent fails, we may get frustrated as the error will be obvious to us. However, it is important that we think like an agent. More concretely, we need to understand that the agent's knowledge is often constrained by its context window. For example, solving a CAPTCHA may be second nature for us. However, an AI agent may not know that.
Thankfully, LLMs can express themselves to a certain degree. Thus, we can interact with them to find out what they are struggling with.
We can check for:
- ambiguity: does the agent understand the task?
- trajectory: what was the reasoning process that led the agent to execute a certain action?
- tool use: does the agent know how to use a certain tool?
As you can see, building an agent is much simpler in principle. Of course, the devil lies in the details, where we have to debug and optimise our agent.
However, most enterprises have workflows that can benefit from agentic workflows or AI agents. Don't let the appearance of complexity deter you from trying them out.
What are some use cases that you will like to implement AI agents for? Comment below! 👇
Member discussion