Skip to content
PathGuided

An Agent Won't Look Up a Mistake It Doesn't Know It's Making

Putting UX guidance behind semantic search fails because coding agents query for what they plan to build, never for the blind spots they are about to introduce.

3 min read
Email

Once a team's design guidance grows too large for a system prompt, the standard architectural move is to place it in a knowledge base and give the coding agent a search tool. We initially planned to do exactly that for our UX guidance. After testing how agents actually build screens, we concluded that search is the wrong retrieval mechanism for this class of knowledge.

Agents Search for What They Intend to Build

Consider an agent tasked with displaying eight records. It plans to build a table, so it searches the knowledge base for "table" or "list." Retrieval works as advertised and returns guidance on column alignment, headers, and row actions.

The guidance the agent actually needed was something else entirely: "a list this short should not have a filter bar," or "the user is choosing between candidates, so this should be a side-by-side comparison rather than a list." The agent will never query for either rule. It does not realize it is about to add an unnecessary filter bar or pick the wrong container. From the inside, the mistake is invisible—which is precisely why it happens.

Search is designed to answer questions. The most expensive UX errors are the ones nobody thought to ask about.

Semantic Search Trips Over Exclusions

There is a second mechanical flaw. Useful design guidance always specifies when it does not apply. For example: "Prefer undo over a confirmation dialog. Not for irreversible actions such as payments or permanent deletion."

That exclusion sentence contains the terms "payments" and "permanent deletion." To an embedding-based search engine matching on semantic similarity, the card now scores highly for payment workflows. An agent building a checkout screen can retrieve the exact card that explicitly forbids its use there. You can engineer around this by indexing exclusions separately and filtering results afterward, but at that point you are building retrieval infrastructure to approximate what a reader understands simply by reading the sentence.

Small Libraries Favor Reading Over Retrieval

A curated library of UX strategies does not need vector search. Forty strategies, summarized at one line each for their trigger and exclusion, fit on a page or two. Even three hundred strategies total only a few thousand words—well within what a planning step can read in full.

When a model reads the complete catalogue alongside the screen's job, it handles three things that search engines handle poorly:

  • It spots a relevant strategy even when the brief never mentions its keywords.
  • It interprets "not for irreversible actions" as a boundary rather than a topic match.
  • It weighs two conflicting strategies and selects the one that fits the stakes.

That is judgment, which language models perform well, whereas similarity scoring does not.

Screen brief with user job and stakes Planner reads full strategy catalogue Records selected strategy IDs Builder receives pushed strategies Reviewer verifies each strategy on rendered screen

Choose at Planning, Then Push

The workflow that replaces search has three steps: the planner reads the catalogue and records specific strategy IDs against the screen; the builder receives those strategies automatically at the start of implementation; and the reviewer checks the rendered screen against each strategy's verification question.

Recording the selection also makes failures diagnosable. When a screen comes back wrong, you can trace whether the right strategy was missing from the catalogue, present but unchosen, or chosen and ignored. Each failure has a distinct fix.

Search still belongs in an agent's toolkit for large reference corpora where the agent knows what it is looking for—an API contract, a function location, or a past architectural decision. For design advice an agent does not know it needs, the system has to bring the knowledge to the agent.

Join the PathGuided Closed Beta

Onboard your repositories with local-to-cloud spec execution, split-tier model routing, and commit-bound Work Tours.

Request beta access