Good Architecture Deletes the Signals Your Agent Depends On
Well-structured codebases remove the textual cues retrieval-based agents rely on. That makes similarity search the wrong tool for finding what a change will break.
Well-structured codebases remove the textual cues retrieval-based agents rely on. That makes similarity search the wrong tool for finding what a change will break.
Similarity-based retrieval finds code that looks like your query, not the code that will break when you change something.
Import graphs and repository boundaries also break discoverability: references can point outside an index or collapse into package artifacts that contain no consumer text.
# The problem in one sentence Similarity search answers "what looks like this?" but agents need "what will break if this changes?". Those are different questions and require different signals.
# Why similarity retrieval fails
DORA's 2025 State of AI-assisted Software Development report is cited: developers save time during generation but re-spend it on auditing and verification, and about 30% of developers reported little or no trust in AI-written code. The author isolates one structural cause: tooling expects overlap in vocabulary that architecture intentionally removes.
# Two sets that matter The article separates two sets of files:
These sets overlap less than tooling assumes. For example, a theme file and a button may share no words, yet changing the theme contract breaks the button. Conversely, two validators written at different times may look alike and confuse an agent into reconciling them incorrectly.
# How good architecture hides signals
The author lists real shared artifacts across product scopes: visual primitives, a theme, a build environment, a running widget in another product, and a backend service in a different product. The more valuable and cross-cutting the artifact, the less it resembles its consumers. Those are exactly the things a code-change impact analysis must find, and similarity search performs worst on them.
# Why imports and package boundaries don't solve it Reading imports helps, but it breaks two ways and gets worse as systems become better assembled. Imports may exist but be followable only through build-time artifacts, package resolution, or monorepo boundaries that aren't indexed. Or imports resolve to a published package where consumer text is absent. A change that touches a build environment or runtime service can reach many components, yet none of those consumers contain text resembling the environment files.
# Practical implication
# Bottom line Good architecture removes the textual signals similarity-based agents rely on. If you want agents that change code safely, you must give them tools that find dependency impact rather than similar text.
Most production agent projects do not fail because the model is weak. They fail because one agent was asked to hold too much at once: routing, planning, tool use, memory, and error recovery all inside a single growing prompt. By 2026, this failure mode shows up in nearly every engineering retro, and the fix is usually
Traditional identity mechanisms weren’t built to account for the autonomous and unpredictable nature of AI agents. So enterprises shouldn’t be surprised when they make unpredictable – or even destructive – decisions, like deleting a company’s entire production base. Without the right guardrails in place, these new acto
Nine seconds. That's how long it took an AI coding agent to delete a production database and its backups at PocketOS, a car-rental software vendor, in April 2026. By founder Jer Crane's account, an AI coding agent hit a credential mismatch during a routine staging task, searched the codebase, and found an API token in

Fresh Context Is Not Enough: An Agent Action Needs a Valid Chain Back to Its Decision AI Use Disclosure: I use AI tools to help research, organize, and refine these weekly notes. I review the underlying sources, decide which developments and arguments are worth including, and edit the final piece before publishing. Thi
Agent design patterns every data engineer must know The post How to Design Architectural Guardrails Around AI Agents appeared first on Towards Data Science .
When an agent’s inference bill spikes, the first instinct is almost always the same: swap to a cheaper model. Continue reading on Level Up Coding »
Loading more related stories...
Open the app view to save this story, compare related coverage, and continue from the same source.