The Shift from Code to System Architecture

Building agentic systems requires moving up a layer of abstraction. Rather than focusing on individual prompts, engineers should treat agents as components within a larger system. The core engineering disciplines—systems thinking, workflow design, and modularity—remain the same, even if the building blocks have shifted from functions to LLM-driven agents.

Core Engineering Disciplines for Agents

  • Decomposition vs. Bloated Prompts: Avoid the "giant prompt" anti-pattern. Just as you would decompose a monolithic function, break agent tasks into distinct jobs (e.g., data normalization, commute calculation, neighborhood research). This makes the system easier to reason about, test, and modify.
  • Separation of Concerns: Use the right tool for the job. Deterministic tasks (like calculating commute times or deduplicating data) should be handled by standard code, while tasks requiring judgment, ambiguity, or fuzzy reasoning are best suited for LLMs.
  • State Management and Contracts: Treat agent outputs as system inputs by enforcing structured schemas (e.g., JSON). This allows downstream processes to query agent memory reliably. Without structured state, data becomes trapped in ephemeral session contexts, making the system brittle.
  • Designing for Idempotency: In real-world environments, retries are inevitable. Design agent workflows to be idempotent so that re-running a task does not cause side effects (like sending duplicate emails). Agents should check the system state before executing actions to ensure they only complete what is missing.

Maintainability and Safety

  • Blast Radius Reduction: Treat all external data (e.g., web listings, user reviews) as untrusted input. Use security engineering principles like least privilege and human-in-the-loop gates for high-stakes actions (e.g., booking tours or submitting offers) to minimize risk.
  • Self-Documenting Systems: To ensure maintainability, include clear documentation within the system architecture. Every agentic system should have a clear explanation of its workflow, policies, and memory structure. If an agent cannot "cold start" or orient itself in a fresh context, the system is likely too complex or poorly decomposed.
  • The Maintainability Test: If you cannot easily update an agent to perform a new task, it is a signal that the system's architecture—not the AI's capability—is the bottleneck. Well-designed systems are modular, allowing for the reuse of skills and sub-agents across different workflows.