3 Perception: What your agent sees determines what it does
The chapter argues that an agent’s failures often begin before reasoning starts: in perception, where the system decides what information enters the context window and what stays out. A useful way to think about context is not as a database but as a spotlight with uneven attention, where relevant evidence can be buried in the middle and become hard to use. The central lesson is that more context is not automatically better; in fact, too much irrelevant information can crowd out the signals the model needs, producing confident but wrong behavior.
To manage this, the chapter presents perception engineering as a core architectural discipline shaped by trade-offs in token budget, attention quality, and cost. It introduces three main ideas: selecting the right evidence up front, compressing accumulated history without losing decision-critical details, and exploring unfamiliar environments step by step. These concerns are framed with operational metrics such as re-read ratio, token spend per successful outcome, and whether important items consistently land in high-attention positions.
The chapter then develops four practical patterns that work together: context triage to rank and load information by priority, semantic compaction to shrink long sessions while preserving failure evidence, progressive discovery to forage broadly and then deepen only where the evidence leads, and multi-modal fusion to preserve the representation that best captures the needed relationships. Across all of them, the goal is the same: maximize signal, minimize waste, and keep the agent near the point where context is rich enough to reason well but not so bloated that it loses focus. The Argus example shows how these patterns transform a blind reviewer into a context-aware analyst that can find real bugs by choosing the right evidence at the right time.
Perception quality as a function of context fill: quality rises with information, peaks, then degrades as attention dilutes. The curve illustrates the concept; the peak’s position varies by task and model.
Context Triage priority tiers. Information flows downward from most critical to most deferrable. Percentages show an example budget and require workload calibration.
Semantic compaction at three levels. Each level preserves more recent turns and compresses everything before them.
Progressive discovery's three-phase strategy applied to a debugging task.
Multi-modal fusion decision flow. Text and structured data are converted to compact text representations.
The perception pipeline.
Summary
- Perception is a core architectural discipline of agent engineering. A well-chosen context can allow a capable model to outperform a stronger model whose evidence is buried in noise.
- Context Triage (Perception × Route) classifies information into four priority tiers (P0 through P3) and fills the window from highest priority down. The key design decision is what can be deferred safely, who sets that policy, and when the agent may promote an item for retrieval.
- Semantic Compaction (Perception × Chain) compresses accumulated context at three levels (tool clearing, conversation summarization, progressive summarization). Preserve decision-critical evidence until the relevant decision is resolved; losing failure evidence can cause the agent to repeat mistakes.
- Progressive Discovery (Perception × Loop) builds context through a forage-focus-deepen cycle. Place exploration cost deliberately in per-task search, session setup, or maintenance of a persistent index.
- Multi-Modal Fusion (Perception × Parallel) chooses a token-efficient representation for each input. Keep images when spatial information is the signal; convert symbolic or nonspatial evidence to compact text when the decision does not require the original form.
- The four patterns can compose into a perception pipeline that shifts from acquisition (early cycles, dominated by Progressive Discovery) to management (late cycles, dominated by Semantic Compaction). A system selects only the stages its evidence and task require.
- Three metrics help measure perception quality: repeated retrieval, token spend per successful outcome, and reliable use of critical evidence. Establish workload and model baselines, then calibrate thresholds against them.
- The underlying principle is to aim the context window at decision-relevant evidence.
FAQ
```htmlWhat is perception in an AI agent?
Perception is the process of selecting, prioritizing, and assembling information into the context window before the model reasons. It determines what the agent sees, and therefore what it can think about and do.
Why is perception considered a primary bottleneck in agent performance?
Because if the agent sees the wrong information, too much noise, or the right evidence in the wrong position, reasoning quality drops. In many agent systems, improving perception matters more than making the model faster.
Why can adding more context make an agent worse?
More context can dilute attention, bury important evidence in the middle of the window, increase token cost, and introduce irrelevant information that hurts reasoning. This is called iatrogenic context when the added information degrades performance.
What is Context Triage?
Context Triage is a perception pattern that classifies available information into priority tiers and loads the most important evidence first. It helps the agent fit the most useful context into a limited budget.
What are the four priority tiers in Context Triage?
P0 is critical and always included, P1 is important and included if space allows, P2 is supporting and usually summarized, and P3 is deferrable and not loaded initially. P3 items remain available as handles for later retrieval.
What is Semantic Compaction?
Semantic Compaction compresses accumulated conversation or tool history while preserving the details needed for the next decision. It is used when a long session becomes too costly or unreliable to keep everything verbatim.
What evidence should survive semantic compaction?
Decision-critical evidence should survive, especially traces that explain why something failed, succeeded, or was blocked. Examples include error traces, declined-action reasons, safety-gate results, or exact values needed to reverse an action.
What is Progressive Discovery?
Progressive Discovery is a pattern for exploring unfamiliar environments by starting at the task boundary, then following evidence-bearing links outward only as needed. It typically moves from broad foraging to focused reading to deeper dependency following.
When should an agent use Multi-Modal Fusion?
Use Multi-Modal Fusion when evidence comes in different forms, such as text, images, or structured data. The agent should choose the representation that preserves the relationships needed for the next decision.
How can perception quality be measured in production agents?
Three useful signals are re-read ratio, token spend per successful outcome, and attention-zone coverage. These metrics help show whether the perception pipeline is selecting the right evidence without wasting budget or hiding important information.
Designing AI Agents ebook for free