WhoBuilt

How We Build Effective Agents

Apr 4, 2025· 15 min· 568K views·Watch on YouTube

Speaker

Barry Zhang of Anthropic explains how to build effective agents at the AI Engineer Summit, drawing on his work with Eric on Anthropic’s “Building Effective Agents” post.

Choose agent tasks carefully

Zhang recommends agents for complex, ambiguous tasks where exploration can create enough value to justify the added tokens, cost, and latency. If the decision tree is easy to map or each task has a tight budget, a workflow can be more predictable and cost-effective. He suggests checking that critical capabilities work and considering how costly errors are and how easily they can be found. Coding is a strong example because it is complex and valuable, and unit tests and CI help verify results.

Start with a simple agent loop

Zhang describes an agent as a model using tools in a loop, guided by an environment and a system prompt that sets goals and constraints. He says to begin by refining those components, since extra complexity slows iteration. Once behavior is working, teams can add optimizations such as caching trajectories to reduce cost, parallelizing search calls to reduce latency, and showing progress to build user trust.

Debug from the agent’s context

Zhang advises examining the limited context the model receives at each step, rather than assuming it sees the full situation as a person would. For computer use, the agent gets a screenshot and tool descriptions, then may wait several seconds for a result without knowing what happened in between. Trying a task from that perspective can reveal missing details, such as screen resolution or guidance on safe actions. Claude can also help identify ambiguous prompts, unclear tool descriptions, and reasons for decisions in a trajectory.

Questions for agent systems

Zhang raises three areas for further work: giving agents budgets for time, money, and tokens; letting models adapt or improve their tools; and supporting more multi-agent collaboration. He sees subagents as a way to parallelize work and preserve the main agent’s context. He also asks how agents should communicate asynchronously, since many systems are built around synchronous user-assistant turns.

Three principles to apply

Zhang closes with three practical reminders: reserve agents for suitable use cases, keep their design simple while establishing behavior, and iterate from the agent’s point of view. He connects that practical focus to his own path into AI engineering, which began while building an AI product at Meta in 2023.

Takeaways

  • Use explicit workflows when the task is easy to map or the per-task budget is tight.
  • Before expanding an agent’s autonomy, verify its key capabilities and make errors discoverable.
  • Build the environment, tools, and prompt first; optimize only after the behavior works.
  • Review the context available at each step to diagnose confusing agent decisions.
  • Plan budgets for time, money, and tokens as part of production agent design.

Mentioned in this talk

Search inside this talk

What was claimed 6

  • previously at
    Barry Zhang previously at Meta
    “I was building an AI product at Meta”
    YouTube
    Verified2 sources· Talk, Web· archived
  • feature
    agentic search: Can decide their own trajectory based on environmental feedback
    “agents can decide their own trajectory and operate almost independently based on environmental feedback”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Used for coding
    “we already use Claude for coding”
    YouTube
    Unverified1 source· Talk
  • uses
    “many of us already use Claude for coding”
    YouTube
    Unverified1 source· Talk
  • metric
    Barry Zhang: Agents operate within 10,000 to 20,000 tokens of context at each step
    “Everything the model knows about the current state of the world is explained in those 10,000 to 20,000 tokens”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Can be asked to assess instruction ambiguity, tool descriptions, and agent decisions
    “throw the entire agent's trajectory into Claude and just ask it”
    YouTube
    Unverified1 source· Talk

Related talks