<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Farri Mohajerani on Medium]]></title>
        <description><![CDATA[Stories by Farri Mohajerani on Medium]]></description>
        <link>https://medium.com/@Farrimoh?source=rss-d56637191b84------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xOoIgARIT-h8WRGF-p3xGQ.jpeg</url>
            <title>Stories by Farri Mohajerani on Medium</title>
            <link>https://medium.com/@Farrimoh?source=rss-d56637191b84------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:31:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Farrimoh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Agent Reliability: Beyond Component Success]]></title>
            <link>https://medium.com/@Farrimoh/agent-reliability-beyond-component-success-f26074f21708?source=rss-d56637191b84------2</link>
            <guid isPermaLink="false">https://medium.com/p/f26074f21708</guid>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[production-ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Farri Mohajerani]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 02:46:05 GMT</pubDate>
            <atom:updated>2026-11-22T22:17:42.783Z</atom:updated>
            <content:encoded><![CDATA[<p>Moving AI agents into production raises questions that cannot be answered by model accuracy or component-level evaluations alone. An agent may perform well on representative tasks, select the correct tools, and produce valid outputs, yet fail because of interactions with the systems in which it operates.</p><p>Consider an agent retrieving patient information from several EHR services. Each retrieval tool performs well in isolation, but during execution one service times out after others have returned results. The workflow must preserve completed work, identify what remains unresolved, and recover without presenting an incomplete response as complete.</p><p>Such failures are familiar in distributed systems. For agentic applications, they require examining how model decisions, tool execution, and application state interact over the course of a workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYjPH12B9QchkXNh9LDY5w.png" /><figcaption><em>Figure 1. Component-level evaluations may miss failures arising from interactions between otherwise correctly functioning components.</em></figcaption></figure><h3>Accuracy Alone Does Not Establish Reliability</h3><p>Accuracy measures correctness under a defined evaluation procedure. Reliability concerns whether a system consistently performs its intended function under specified operating conditions over a defined period [3]. Two agents with similar average success rates may therefore exhibit substantially different failure patterns.</p><p>An agent whose failures are dispersed across requests behaves differently from one whose failures are concentrated in particular scenarios. Aggregate scores may conceal systematic errors associated with incomplete information, ambiguous requests, or changes in application state. Repeated executions of the same task can also produce different outcomes as model sampling, retrieved information, or external state varies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaifKPoSvuqE-KVB6Sq4bg.png" /><figcaption><strong>Figure 2:</strong> Illustrative failure distributions with identical aggregate success rates.</figcaption></figure><p>In Towards a Science of AI Agent Reliability, Rabanser et al. (2026) examine reliability through four dimensions: <strong>consistency, robustness, predictability, and safety</strong> [1]. This framework extends evaluation beyond average task success to characterize how agents perform, degrade, and fail.</p><p>Reliability and safety are closely related but distinct concerns. For clinical agents, failing to retrieve a nonessential document and returning information from the wrong patient record should not carry equal weight simply because both count as unsuccessful tasks. Assessing operational risk therefore requires characterizing not only the frequency and distribution of failures but also the severity of their potential consequences.</p><h3>The Limits of Component-Level Evaluation</h3><p>Component-level evaluations help isolate errors, compare implementations, and monitor performance. Routing accuracy, retrieval quality, and tool execution success are useful measurements, but interpreting them as evidence of end-to-end reliability requires assumptions about how components interact.</p><p>Even in a simple sequential workflow, component outcomes may be dependent. Under an independence assumption, multiplying their marginal success probabilities gives the probability that all components succeed. Treating this result as the probability of workflow success further assumes that success of every component is both necessary and sufficient for correct end-to-end behavior.</p><p>In practice, failures may be correlated through shared dependencies, common inputs, or application state. Successful component execution also does not guarantee correct interaction between components. Nancy Leveson’s A New Accident Model for Engineering Safer Systems (2004) provides a foundation for this distinction: unsafe outcomes can arise from interactions among correctly functioning components, without an individual component failure [2].</p><p>For agentic systems, this is a question of evaluation boundaries. A routing benchmark measures tool selection under specified conditions; a retrieval benchmark measures the relevance or correctness of retrieved information. Neither necessarily tests the assumptions governing their interaction, including data validity, state synchronization, and downstream interpretation.</p><p>End-to-end evaluations provide broader coverage, but their conclusions remain conditional on the scenarios represented in testing. Static test cases, for example, may not exercise failures associated with concurrent updates or changing dependencies.</p><h3>Complexity, Dependencies, and Recovery</h3><p>Production agents often depend on services maintained by different teams, each with its own deployment cycle, operational constraints, and failure-handling mechanisms. Unlike workflows with predefined execution paths, agentic workflows may determine their sequence of operations, information requirements, and recovery actions dynamically during execution. This expands the range of interaction paths that evaluation must cover.</p><p>Consider a workflow interrupted after an external service has processed a request but before the agent receives confirmation. Retrying may be appropriate for a read-only operation, but repeating an action that modifies persistent records can introduce duplicate or conflicting changes. Recovery requires establishing what actually occurred; a missing confirmation does not establish that the action failed.</p><p>Distributed systems engineering has long addressed such problems through idempotency, durable state, and explicit failure-handling protocols. Applying these mechanisms to agentic workflows requires coordination across services that may not share execution state or operational ownership. An execution trace may show where the agent stopped without establishing whether a downstream action was committed or how the workflow should resume.</p><p>Additional safeguards can reduce particular risks while introducing new dependencies and failure paths. Their effectiveness depends on how they interact with the rest of the system, including whether they contain failures or propagate them.</p><p>Recoverability should therefore be evaluated as an operational property: whether the system can reconcile an interrupted action with authoritative service state, prevent unintended repetition, and either resume safely or halt for review when the outcome remains uncertain.</p><h3>What Evidence Supports Reliability Claims?</h3><p>Reliability evaluation should examine behavior under concurrent updates, unavailable dependencies, delayed responses, and interruptions during multi-step execution. Fault injection can test responses to controlled disruptions, while repeated execution can characterize variability under fixed or deliberately varied conditions.</p><p>Recovery requires explicit measurement, including failure detection rates, accuracy in identifying partially executed actions, and the proportion of interrupted workflows that resume without unintended state changes. Where recovery is not possible, evaluations should assess whether the system preserves a valid state and communicates the unresolved outcome.</p><p>Not every failure can be anticipated or reproduced before deployment. Production monitoring and incident analysis must therefore inform subsequent evaluations, extending coverage to conditions and interactions missed during testing.</p><p>Reliability claims should specify the operating conditions tested, the failure behavior observed, and the limits of recovery. Component scores and workflow success rates contribute to this evidence, but neither alone establishes how an agent will behave when execution is disrupted.</p><p>---</p><p>References</p><p>1. Rabanser, S., et al. (2026). Towards a Science of AI Agent Reliability. ICML 2026. &quot;arXiv:2602.16666&quot; (https://arxiv.org/abs/2602.16666).<br>2. Leveson, N. (2004). A New Accident Model for Engineering Safer Systems. Safety Science, 42(4), 237–270. &quot;doi:10.1016/j.ssci.2003.09.004&quot; (https://doi.org/10.1016/j.ssci.2003.09.004).<br>3. National Institute of Standards and Technology. (2023). Artificial Intelligence Risk Management Framework (AI RMF 1.0). &quot;doi:10.6028/NIST.AI.100-1&quot; (https://doi.org/10.6028/NIST.AI.100-1).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f26074f21708" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agent Architecture: What Are We Optimizing For?]]></title>
            <link>https://medium.com/@Farrimoh/agent-architecture-what-are-we-optimizing-for-05bda0c80aab?source=rss-d56637191b84------2</link>
            <guid isPermaLink="false">https://medium.com/p/05bda0c80aab</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent-architecture]]></category>
            <dc:creator><![CDATA[Farri Mohajerani]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 18:38:47 GMT</pubDate>
            <atom:updated>2026-11-11T18:49:11.411Z</atom:updated>
            <content:encoded><![CDATA[<p>Coding agents such as Codex and Claude Code have become prominent examples in tutorials and discussions of agent development. Their ability to plan, use tools, delegate tasks, and iteratively refine results demonstrates what modern agent systems can accomplish.</p><p>But there is a distinction that often gets overlooked: <strong>these are agents designed for a particular class of problems, with particular execution constraints.</strong></p><p>The architectural patterns that make them effective are not necessarily the ones that make a customer service agent or clinical assistant effective.</p><p><em>But how do we determine which architecture fits the problem at hand?</em></p><h3><strong>Different Workloads, Different Constraints</strong></h3><p>Consider an agent investigating a scientific problem. It might search the literature, formulate hypotheses, run simulations, analyze results, and revise its approach based on new evidence. The execution path may be unknown at the outset, and the investigation could extend over hours, days, or longer.</p><p>Coding agents and exploratory travel-planning agents share some of these characteristics. Their tasks may require multiple rounds of investigation, with each discovery influencing what happens next.</p><p>For such workloads, dynamic planning and iterative execution can be essential.</p><p>Now consider a customer service agent responding to a request, or a clinical assistant registering a patient, retrieving information, or assisting with documentation.</p><p>These applications are typically interactive. Users expect timely responses, and many operations follow established procedures. The system must interpret the request, retrieve relevant context, and execute the appropriate operations reliably.</p><p>The difference is not simply the complexity of the task. It is also the <strong>uncertainty of the execution path and the time available to complete it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mHrmNWmsD94vP0CgHTOUqw.png" /><figcaption><em>Figure 1: Agent workloads mapped by execution-path uncertainty and available execution time. Positions are illustrative and vary by task and implementation.</em></figcaption></figure><p>These two dimensions are not necessarily correlated. A batch-processing workflow may run for hours while following a predefined sequence of operations. Conversely, an interactive request may involve substantial uncertainty while still requiring a response within seconds.</p><p>Understanding these differences is a starting point for choosing an appropriate agent architecture.</p><h3><strong>Architecture and Harness Should Follow the Workload</strong></h3><p>Agent architecture determines how work is organized: where decisions are made, how tasks are delegated, and how execution steps are coordinated.</p><p>The agent harness provides the execution mechanisms, including tool access, context and state management, permissions, error recovery, and runtime controls.</p><p>An exploratory agent may benefit from dynamic task decomposition, persistent working context, iterative tool execution, and checkpoints that allow it to recover or revise its approach.</p><p>A latency-sensitive operational assistant may instead prioritize selective context retrieval, efficient tool routing, controlled state transitions, and bounded retries.</p><p>Many underlying capabilities are reusable across these systems. The difference lies in how they are organized and which capabilities the execution model emphasizes.</p><p>For example, introducing a general-purpose planning loop into a straightforward operational request can add sequential model calls and context overhead without improving the result. At the other extreme, forcing an exploratory problem into a rigid workflow may prevent the agent from adapting to unexpected findings.</p><p><strong>The architecture and harness should follow the workload, not the other way around.</strong></p><h3><strong>Where Does the System Actually Need to Be Dynamic?</strong></h3><p>Different execution requirements do not necessarily mean building separate agent systems. A single system can support multiple execution modes, selecting the appropriate one based on the request.</p><p>Consider a travel assistant.</p><p>If a user asks when their flight arrives, the system may simply retrieve the flight information and respond.</p><p>If the flight is delayed and the user needs to adjust airport transfers and hotel arrangements, the system may need to coordinate several established workflows, handle dependencies, and obtain the necessary confirmations.</p><p>But if the user wants to plan a two-week trip without a fixed itinerary, the assistant may need to investigate destinations, compare alternatives, incorporate preferences, and iteratively refine its recommendations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ZMJhAvCph3pdDUZHABWAg.png" /><figcaption>Figure 2. One travel assistant supporting three execution modes: direct workflow, coordinated workflow, and dynamic planning.</figcaption></figure><p>The same system can support all three requests without applying the same orchestration strategy to each.</p><p>More importantly, <strong>dynamic decision-making does not have to occur at every step</strong>. In some cases, the agent only needs to determine which established workflow to execute. In others, it must discover and revise the execution path itself.</p><p>This shifts the design question from selecting a single orchestration pattern to deciding where flexibility is genuinely needed.</p><h3><strong>Agent Architecture as an Optimization Problem</strong></h3><p>Every architectural choice introduces trade-offs.</p><p>Dynamic planning offers flexibility, but it can also introduce additional model calls, coordination overhead, and new failure points. Predefined workflows can provide more predictable execution, but they may struggle with unexpected requests.</p><p>The appropriate balance depends on task uncertainty, latency requirements, reliability, quality, and cost.</p><p>In practice, the effectiveness of an architecture should be evaluated at the workload level: how often tasks are completed successfully, how consistently the system responds within acceptable time limits, how it handles failures, and what resources it consumes.</p><p>A more elaborate orchestration strategy is only valuable when its benefits justify the additional complexity and overhead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wR1AOrlvWMOtjwYqN4K-jg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05bda0c80aab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agent Middleware: Moving Control Out of the Reasoning Loop]]></title>
            <link>https://medium.com/@Farrimoh/agent-middleware-moving-control-out-of-the-reasoning-loop-0ddffb1ca290?source=rss-d56637191b84------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ddffb1ca290</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai-architecture]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Farri Mohajerani]]></dc:creator>
            <pubDate>Sun, 24 May 2026 22:04:26 GMT</pubDate>
            <atom:updated>2026-05-28T12:11:09.820Z</atom:updated>
            <content:encoded><![CDATA[<p>Agent systems are increasingly moving toward a simple shape: a model in a loop. The model receives a request, reasons about what to do next, may call a tool, observes the result, and then reasons again. It continues until it can return an answer.</p><pre>User request<br>  → Model reasons<br>  → Model may call a tool<br>  → Tool returns result<br>  → Model reasons again<br>  → Output</pre><p>Agent loops are powerful because the system does not need to hardcode every path. The model can adapt as it goes: search again, inspect a result, choose another tool, revise its plan, or stop.</p><p>This became practical as models improved at instruction following, tool use, and multi-step reasoning. The model is no longer only producing the final answer. It can also help decide the next step. But that flexibility changes where control lives.</p><p>In workflow-style systems, the developer decided the path: classify, retrieve, summarize, validate, output. In an agent loop, more of that control moves into the model’s reasoning. The model may decide which tool to call, what arguments to pass, whether the result is enough, and when to stop.</p><p><strong>Skills</strong> help organize this loop by packaging instructions, tools, and context into reusable capabilities. They are especially useful when requirements are still changing, capabilities are user-defined, or the workflow is still being discovered.</p><p>I wrote about that tradeoff in the <a href="https://medium.com/@snowcoader/why-structuring-capabilities-in-modern-agents-improves-modularity-but-shifts-work-into-the-5275c77174f2">previous post</a>: skills improve modularity and capability reuse, but they can also move more orchestration into inference-time reasoning.</p><p>But as the system matures, a different question appears:</p><blockquote><em>Which parts of this behavior should still depend on reasoning?</em></blockquote><p>Some requirements are useful as skill instructions while the workflow is being discovered. But once they become stable, repeated, or safety-critical, they often stop being reasoning guidance and start becoming <strong>execution controls.</strong></p><blockquote><em>That is where middleware becomes useful.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VtFiy0Q-7bI8ZeYqw6XlwQ.png" /></figure><h3>What middleware means here</h3><p>Middleware is a <strong>control layer</strong> around agent execution.</p><p>It does not replace the agent. It does not replace skills. It does not need to become a full framework. In this context, middleware means the system can intercept model and tool execution and decide whether to continue, modify, block, or retry.</p><p>The model may propose an action. Middleware decides whether that action is allowed. This distinction matters because not every decision in an agent system should be treated as a reasoning problem. Some decisions are execution controls.</p><h3>A simple policy example</h3><p>Consider a user asking:</p><pre>Send this customer data to an external summarization tool.</pre><p>From the model’s perspective, the request may look straightforward. An external summarizer is a useful tool for the task.</p><pre>Model<br>  → external_summarizer seems useful</pre><p>But useful is not the same as allowed.</p><p>If the data is restricted, the system should not rely only on the model remembering a policy instruction. It should enforce the rule before the action happens.</p><pre>Middleware<br>  → detects restricted_data=True<br>  → blocks the tool call<br>  → returns a policy result</pre><p>The model can then explain that the action was blocked.</p><p>The point is<strong> not to remind the model about the policy</strong>. The point is to <strong>enforce it before execution</strong>.</p><blockquote>A policy that must always apply should not depend on the model remembering it.</blockquote><h3>Skills are a good first home for requirements</h3><p>This does not make skills unnecessary.</p><p>Skills are useful because they give emerging capabilities a place to live. Instead of putting every instruction into one large prompt, a skill can package a narrower capability: what the model should do, which tools are relevant, what context matters, and how the task should be approached.</p><p>For example, a research skill might say:</p><pre>Search for multiple perspectives.<br>Prefer reliable sources.<br>Avoid duplicate sources.<br>Include uncertainty.<br>Structure the answer with arguments for, arguments against, and sources.</pre><p>That is a useful abstraction.</p><p>The model gets scoped guidance. The capability becomes easier to reuse. Requirements that might otherwise be scattered across prompts, tool descriptions, and examples now have a place to live.</p><p>For early development, this is often exactly what you want. When the task is still being shaped, keeping behavior in a skill makes iteration easier. You can adjust instructions, add examples, refine tool guidance, and test different versions of the workflow.</p><blockquote>Skills are a good working surface for discovering behavior.</blockquote><p>But the goal changes as the system matures. In a <strong>prototype</strong>, the question is often:</p><blockquote>Can we make the agent do the task?</blockquote><p>In <strong>production</strong>, that is not enough. The goal is not just to make the behavior <strong>possible</strong>, but to make it <strong>reliable</strong>,<strong> repeatable</strong>,<strong> observable</strong>, and <strong>constrained</strong>. That shifts the design question:</p><blockquote>Which parts of this task should still depend on model reasoning?</blockquote><p>Some parts should remain in the reasoning loop. The model should interpret intent, handle ambiguity, decide how to explore, and synthesize information.</p><p>But many requirements are control problems.</p><pre>Which tools are allowed?<br>Which arguments are required?<br>Should this action be blocked?<br>Should this tool result be filtered?<br>Does the final output match the required structure? <br>Should this step be logged?</pre><p>These requirements can start as skill instructions. That is often the easiest way to discover the behavior. But once they become stable and enforceable, they may no longer belong only inside the model’s reasoning process.</p><p>This is the transition from skill instruction to system control.</p><h3>Middleware as lifecycle hooks</h3><p>One practical way to implement middleware is through lifecycle hooks around the agent loop. For example:</p><pre>before_model_call<br>after_model_call<br>before_tool_call<br>after_tool_call<br>before_final_output</pre><p>Each lifecycle point gives the system a place to apply control. A hook before the model call can shape context. A hook before a tool call can enforce policies or required arguments. A hook after a tool call can filter results. A hook before final output can validate structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PEbdDl_E6xXWBRVX1ySoNg.png" /></figure><p>This keeps the abstraction small.</p><p>Business rules, validation, routing, source filtering, and logging do not need to be separate core primitives. They can be expressed as hook behaviors at different lifecycle stages.</p><p>The question becomes:</p><blockquote>At which point in the loop should this control be applied?</blockquote><h3>Turning hooks into control points</h3><p>Hooks are common in software systems. But in agent systems, a hook should do more than observe execution.</p><p>It should be able to return a decision.</p><p>For example:</p><pre>ControlAction = Literal[<br>    &quot;continue&quot;,<br>    &quot;replace&quot;,<br>    &quot;block&quot;,<br>    &quot;retry&quot;,<br>]</pre><p>Each action has a clear meaning:</p><pre>continue → proceed normally<br>replace  → modify the value and continue<br>block    → deny the action and record a policy result<br>retry    → provide feedback and call the model again</pre><p>This turns hooks from callbacks into execution control points.</p><p>With this contract, hooks can shape context, block tool calls, request retries, or simply observe execution.</p><p>The goal is to keep the agent flexible while making control decisions explicit.</p><h3>A research agent example</h3><p>Research is a useful example because the task is flexible, but the standards should not be completely flexible.</p><p>Suppose a user asks:</p><pre>Find arguments for and against middleware patterns in LLM agents.</pre><p>A skill-first version might instruct the model:</p><pre>Search both sides.<br>Prefer reliable sources.<br>Avoid duplicate claims.<br>Include uncertainty.<br>Return sources.</pre><p>This is a good starting point. The skill teaches the model what kind of research behavior we want. But in a more robust system, some of those requirements can move into middleware.</p><pre>before_model_call<br>  → inject compact research protocol</pre><pre>before_tool_call<br>  → restrict approved retrieval tools</pre><pre>after_tool_call<br>  → filter duplicate or low-quality sources</pre><pre>before_final_output<br>  → validate:<br>     arguments_for<br>     arguments_against<br>     uncertainty<br>     sources</pre><p>The model can still decide how to explore the topic. It can choose queries, inspect results, synthesize arguments, and decide whether more information is needed.</p><p>But the system enforces the standards around that exploration. The skill teaches the model the research behavior. Middleware enforces the research contract.</p><blockquote><em>The model owns exploration. Middleware owns standards.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBi_FyJiupVmxWcUD_F05w.png" /></figure><h3>What stays in skills, and what moves to middleware?</h3><p>This is not a choice between skills and middleware. The more useful question is where each requirement belongs.</p><p>Skills are often the right place to prototype behavior. Middleware becomes useful when that behavior needs to be stable, enforceable, observable, or reusable across workflows.</p><p>That migration is natural: guidance can begin in a skill and later become a hook, validator, or blocking rule.</p><blockquote><em>Prototype in skills. Harden in middleware.</em></blockquote><p>To make the pattern more concrete, I put together a small reference repo:</p><p><a href="https://github.com/farrimoh/agent-middleware-patterns">agent-middleware-patterns</a></p><p>It demonstrates lifecycle hooks around model and tool execution, along with a small control contract for modifying, blocking, retrying, or tracing execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UmfaUo5V9awMQs_RPIwlGg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ddffb1ca290" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agent Skills Are Powerful, But They Come at a Cost]]></title>
            <link>https://medium.com/@Farrimoh/why-structuring-capabilities-in-modern-agents-improves-modularity-but-shifts-work-into-the-5275c77174f2?source=rss-d56637191b84------2</link>
            <guid isPermaLink="false">https://medium.com/p/5275c77174f2</guid>
            <category><![CDATA[agent-loop]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agent-skills]]></category>
            <category><![CDATA[agentic-architecture]]></category>
            <dc:creator><![CDATA[Farri Mohajerani]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 01:02:20 GMT</pubDate>
            <atom:updated>2026-05-17T01:03:10.527Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why structuring capabilities in modern agents improves modularity, but shifts work into the reasoning loop and increases latency.</em></p><p><a href="https://agentskills.io/home">Skills</a> are becoming a standard abstraction in modern agent systems.</p><p>Popularized in coding agents, particularly by <a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview">Anthropic</a>, they package instructions, tools, and context into reusable units. Instead of treating prompts as static input, skills introduce a structured layer around capability definition.</p><p>This pattern is now showing up across systems, from <a href="https://claude.com/product/claude-code">Claude Code</a> to <a href="https://chatgpt.com/codex">Codex</a> and libraries like <a href="https://docs.langchain.com/oss/python/deepagents/skills">LangChain DeepAgents</a>.</p><p>At a glance, they solve a real problem: how to structure access to capabilities as systems grow. But they also reflect a deeper shift in how agent systems are designed.</p><h3><strong>The Shift in Architecture</strong></h3><p>Early agent systems relied on a simple pattern: a single model paired with direct tool calls. As complexity grew, this evolved into multi-agent architectures, where responsibilities were decomposed across specialized agents and coordinated through routing. While this improved modularity, it also introduced coordination overhead and made control flow harder to reason about.</p><p>More recent systems are moving back toward a simpler structure: a single agent, with a central model responsible for both reasoning and tool use.</p><p>This shift follows from a simple change: <strong>models became sufficiently capable.</strong></p><p>As models became more reliable at tool use and instruction following, the need for explicit coordination between agents started to diminish. Instead of distributing reasoning across multiple components, a single model could take on the role of orchestrator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atyOuA_tAFwsnmcaOeFU7Q.png" /></figure><p>In this setting, the challenge shifts from routing between agents toward structuring access to capabilities within a single reasoning loop.</p><p>This simplifies orchestration, but it introduces a different problem.</p><p>As capabilities accumulate, the single-agent setup tends to grow into a large, overloaded prompt, containing instructions, tool descriptions, schemas, and contextual logic all in one place. Over time, this makes the system harder to reason about, harder to maintain, and less predictable in behavior.</p><h3>Skills as Structure</h3><p>What was gained in simplicity at the architectural level begins to reappear as complexity inside the prompt.</p><p><strong>Skills emerge as one way to address this</strong>.</p><p>Instead of keeping all instructions and capabilities in a single prompt, they package them into scoped units that combine instructions, tools, and relevant context. Each skill defines a constrained environment within which the model can operate, rather than exposing the full system at once.</p><p>This shifts the system from a flat prompt to a structured set of capabilities that can be invoked as needed, and it provides clear benefits.</p><p>By scoping capabilities, skills reduce ambiguity in tool selection and keep the reasoning space more manageable. They also enable modularity: capabilities can be defined, extended, and reused without modifying the entire system. As systems grow, this makes behavior easier to organize and evolve.</p><p>However, this structure is not free. A capability is no longer executed as a direct mapping from input to tool call. Instead, execution involves selecting a capability, expanding its context, and then reasoning within that scope before and after tool interaction.</p><h3>Cost of Structure</h3><p><strong>Part of this overhead comes from progressive exposure.</strong></p><p>When a tool is wrapped inside a skill, the model first decides which capability to invoke, and only then gains access to its contents. In practice, this introduces an additional model step compared to direct tool invocation, where selection and execution happen together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5vm6a7YIEm0Bt0aHn23yw.png" /></figure><p>This overhead is often acceptable, in systems prioritizing extensibility and reusable capability composition.</p><p><strong>Another part comes from how work is organized.</strong></p><p>In more explicit agentic flows, steps such as retrieval or preprocessing are orchestrated outside the model, chained in a controlled and scoped manner. With skills, these elements are often bundled into the capability itself. Instead of a sequence of narrowly scoped steps, the system expands the context and lets the model handle the reasoning internally.</p><p>This makes systems easier to compose, but also <strong>shifts more work into each step.</strong></p><p><strong>The result is a different latency profile.</strong></p><p>Tool execution remains part of the critical path, but it is now preceded and followed by additional model inference over expanded context. Since model inference typically dominates latency, these added steps become noticeable, especially when response time matters.</p><p>The implications depend on the <strong>use case.</strong></p><p>For tasks that require coordination across multiple tools or non-trivial decision-making, the constrained reasoning introduced by skills can improve consistency and robustness. In these settings, the additional overhead is often justified.</p><p>For simpler or latency-sensitive tasks, the same abstraction can become unnecessary. When the path from input to action is already well-defined, adding a skill layer introduces extra decisions and context expansion without adding much value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qya3uwQbht5f1N64d7PBg.png" /></figure><p>At the same time, skills fit naturally in settings where capabilities are defined or extended by the user. Coding agents such as Codex or Claude Code benefit from this pattern: packaging workflows as skills allows users to structure their own tools, instructions, and context in a reusable way. In this setting, the abstraction becomes part of the interface, not just the execution model.</p><p>In other cases, some of the structure introduced by skills can be shifted elsewhere in the system; for example into orchestration layers or middleware, where execution and context can be controlled more tightly. This can lead to more predictable latency and clearer control flow, especially when parts of the pipeline can be made deterministic.</p><p>The broader point is that <strong>agent system design is no longer about choosing a single pattern</strong>.</p><p>Skills, direct tool calls, middleware, and multi-agent paths each place structure in different parts of the system. The right choice depends on the task itself, how much reasoning it requires, how predictable the workflow is, and how sensitive the system is to latency.</p><p>While the single-agent loop simplifies many aspects, it is not a complete solution. Effective systems rely on combining these patterns deliberately.</p><p><strong>There is no single abstraction that fits all cases. Harness design matters.</strong></p><p><em>Much of this tradeoff shifts once middleware enters the picture.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5275c77174f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>