Building Reliable Agents

Eno Reyes, Factory.ai24:45 · Dec 2024 · 553 views
Thumbnail for Building Reliable Agents Watch on YouTube
TL;DR
  1. 1

    Reliable agentic systems need planning, decision-making, and environmental grounding that work together.

  2. 2

    Agents become more dependable when plans have explicit success criteria, decisions use suitable consensus or simulation methods, and tools expose the right level of abstraction.

  3. 3

    Human interaction remains part of reliable agent design because even a system that fails on 10% or 20% of tasks creates a large problem at scale.

Summary

Eno Reyes explains how Factory.ai approaches reliability for systems that automate software engineering work. He defines agentic systems through planning, decision-making, and environmental grounding. Plans can drift, so agents need intermediate context, task decomposition, adaptive replanning, and explicit success criteria. Decision quality can improve through consensus methods, structured reasoning, fine-tuning, or simulated decision paths, though each adds costs or limits. Environmental grounding depends on carefully designed tools, processed feedback, bounded exploration, and human guidance. Reyes argues that interfaces to external computer systems are one of the strongest ways to differentiate an agent product because model providers already supply capable planning and reasoning. The talk is practical and candid about tradeoffs: more flexibility can reduce accuracy, simulation is difficult to debug, and open-ended systems are hard to constrain. He also argues that human intervention should remain part of the product design rather than being treated as a temporary substitute for reliability.

Key ideas
02:57

An agentic system plans, decides, and acts through an environment

Reyes describes three characteristics of an agentic system. It makes plans that determine future actions, from one action to a multi-state plan involving several actors. It makes decisions by evaluating data and selecting an action or state. It is grounded in an environment by reading and writing external information in pursuit of a goal. These boundaries are difficult to define precisely, but the three characteristics give teams a useful way to reason about what they are building.

05:02

Intermediate context and replanning help prevent plan drift

Long plans often drift away from the original responsibility, especially when a task contains many substeps. Reyes says Factory.ai drew on Kalman filters from robotics and control theory to pass intermediate context through a plan and keep it focused. Subtask decomposition gives teams finer control, although each smaller task can introduce a misleading step. Model predictive control treats the plan as dynamic and reevaluates the next action using real-time feedback. This improves adaptation while increasing the risk of leaving the original trajectory.

08:09

Explicit success criteria give an agent a target to converge on

The structure and success criteria of a plan affect how well the agent performs. Reyes mentions instruction prompting, few-shot examples, and static type checking as possible ways to define those criteria. An agent should not have to invent the task definition from scratch on every run. The difficulty is that teams must create and maintain several explicit criteria, which becomes harder in open-ended problem spaces where the same goal can appear in different forms.

09:29

Decision quality improves when systems compare possible outputs or reasoning paths

Because an LLM's later output is influenced by its earlier tokens, Reyes recommends sampling multiple outputs when a decision matters. Prompt ensembles, cluster sampling, and self-consistency can compare different answers and improve accuracy at higher inference cost. Explicit reasoning methods such as Chain of Thought, checklists, chain of density, and tree of thought can make the process more consistent. Reyes warns that consistency does not guarantee accuracy, and a poor forced reasoning strategy can reduce an agent's ability to solve a problem.

12:38

Fine-tuning and simulation are useful only for certain decision problems

Fine-tuning can improve a known task distribution, such as classification or tool use, but it is expensive and locks in quality. Reyes says base models can sometimes perform better across broad task distributions. Simulation offers another route: sample several decision paths, run them forward, and choose according to a reward criterion. In software development, tests and compilation can provide concrete signals. The approach can improve quality, but it is slow, expensive, and difficult to model and debug.

15:41

Tool interfaces determine how much control and accuracy an agent has

Reyes says agents need dedicated tools and that teams must choose the right abstraction layer. A calculator gives narrow, reliable capabilities. A custom API wrapper can make an agent fluent in selected platform actions. A sandboxed Python environment provides much broader power, but that breadth can reduce accuracy. Teams must decide where the agent should act independently and where interfaces should be explicitly defined. The tools also need ongoing maintenance because agent-specific or LLM-specific interfaces are difficult to design well.

17:16

Feedback processing turns noisy environment data into useful signals

Coding agents may receive hundreds of thousands of lines of standard output, debug logs, and other data. Humans can take in large amounts of sensory information while focusing on what matters, but agents need that signal processing defined explicitly. Reyes argues that preprocessing logs and other feedback is therefore a core part of the system. Giving the agent the important information instead of the full noisy environment can improve its ability to solve problems.

18:18

Reliable agents need bounded exploration and deliberate human interaction

General agents need room to gather context and learn more about a problem instead of charging ahead after one initial retrieval step. Exploration can improve understanding, but retrieval can overload the context or pull the system away from the main path. Reyes also argues that human guidance should remain part of the design. If an agent fails on 10% or 20% of tasks, that failure rate becomes significant at scale, so the product needs carefully designed points for human intervention.

"Agentic systems read and write information to an external environment and this enables them to achieve goals within that environment."04:43
Who should watch
  • You are building a coding agent or another system that must complete multi-step work in a changing environment.
  • Your agent produces inconsistent plans and you need concrete ways to constrain decisions, tools, feedback, and exploration.
  • You are deciding whether to rely on model improvements, custom interfaces, simulation, or human review to raise reliability.