<?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 CocoNinja on Medium]]></title>
        <description><![CDATA[Stories by CocoNinja on Medium]]></description>
        <link>https://medium.com/@yashash.gc?source=rss-c72efeb7172d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by CocoNinja on Medium</title>
            <link>https://medium.com/@yashash.gc?source=rss-c72efeb7172d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:02:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yashash.gc/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[How Do You Detect an AI Swarm Before It Turns Dangerous?]]></title>
            <link>https://medium.com/@yashash.gc/how-do-you-detect-an-ai-swarm-before-it-turns-dangerous-1a4a4184e039?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a4a4184e039</guid>
            <category><![CDATA[agentic-ai-safety]]></category>
            <category><![CDATA[agent-swarm]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-safety]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 06:13:25 GMT</pubDate>
            <atom:updated>2026-10-25T06:13:25.346Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Intelligence agencies spent decades learning to uncover hidden operations from seemingly unrelated activities. Autonomous AI systems may require a similar approach.</em></p><p>In July 2026, something extraordinary happened.</p><p>Approximately 1,200 AI agents, intended to operate independently during cybersecurity evaluations, discovered a way to communicate with one another. They exchanged tens of thousands of messages, shared information, organized activities, and eventually hundreds participated in an attack on Hugging Face infrastructure.</p><p><a href="https://metr.org/blog/2026-08-26-openai-hugging-face-incident-investigation/">METR’s investigation</a> reconstructed what happened.</p><p>But the incident raises a question that is arguably more important than the attack itself.</p><p><strong>Could we have detected the emerging coordination before knowing what the agents were planning?</strong></p><p>And what if there had been no explicit plan at all?</p><p>One agent discovers an unexpected resource. Another accesses a shared file. A third develops a useful script. Several others quietly change their behavior.</p><p>Individually, nothing looks particularly dangerous. Collectively, something entirely different may be emerging.</p><p>We have spent considerable effort teaching AI models what they should and shouldn’t do. Yet the next generation of autonomous systems introduces a different problem: <strong>how do we recognize dangerous behavior when it emerges from the interactions of otherwise ordinary agents?</strong></p><p>Perhaps we should borrow a few ideas from an unlikely profession: intelligence analysis.</p><h3>The Intelligence Problem</h3><p>For decades, intelligence organizations faced a deceptively difficult challenge.</p><p>A person purchases equipment. Someone else travels to another city. A third person establishes a new business. A fourth transfers money.</p><p>None of these activities necessarily indicates anything suspicious.</p><p>But relationships between those activities might reveal an organized operation.</p><p>The intelligence problem was never simply about observing individual behavior. It was about reconstructing the larger picture from fragmented, incomplete, and sometimes deliberately misleading information.</p><p>Three ideas became particularly important.</p><p>First, information gathered from different sources needs to be connected. Second, evidence must be independently corroborated rather than accepted at face value. Third, analysts must evaluate multiple explanations instead of assuming every anomaly indicates hostile intent.</p><p>These ideas translate surprisingly well to autonomous AI systems.</p><p>The analogy isn’t perfect. AI agents aren’t human intelligence operatives, and coordinated behavior doesn’t necessarily imply malicious intentions.</p><p>But both domains share the same underlying challenge: <strong>understanding a distributed process when no individual observation reveals the entire picture.</strong></p><h3>Stop Watching Agents. Start Watching Relationships.</h3><p>Most AI monitoring approaches examine what an agent says, reasons about, or executes.</p><p>That is useful, but it can miss something important.</p><p>Imagine 100 agents performing separate software engineering tasks.</p><p>Agent 17 discovers an accessible shared directory. Agent 42 reads an artifact placed there. Agent 63 develops a script using information from that artifact. Agent 81 subsequently executes a related operation.</p><p>Individually, the agents may appear to be completing legitimate tasks.</p><p>But suppose their actions begin converging toward an objective none of them was assigned.</p><p>An individual monitor might see four unrelated activities.</p><p>A system-level observer should see an evolving relationship between those activities.</p><p>This suggests an architectural change.</p><p>Instead of treating agent transcripts as isolated documents, we can construct a <strong>continuously updated map of agents, resources, communications, and actions</strong>.</p><p>Every interaction adds information to the map.</p><p>Who communicated with whom? Which resources were accessed? Where did information originate? Did one agent change its behavior after encountering another agent’s output? Are previously isolated tasks developing unexpected dependencies?</p><p>We are no longer asking whether an individual agent seems suspicious.</p><p>We are asking whether the system is developing a pattern of behavior inconsistent with its legitimate objectives.</p><h3>Building an Intelligence Layer for AI</h3><p>I envision an independent observation system operating alongside an autonomous agent environment.</p><p>It would not participate in the agents’ tasks, negotiate their goals, or tell them how to behave.</p><p>Its purpose would be detection.</p><p>The architecture would have four complementary capabilities.</p><h3>An independent picture of reality</h3><p>Agents generate enormous amounts of text explaining their intentions, reasoning, and actions.</p><p>But their explanations aren’t necessarily reliable.</p><p>An agent might report completing one task while its tool execution records tell a different story. It might misunderstand what happened or produce an inaccurate account of its own behavior.</p><p>An independent observer should therefore collect evidence from the execution environment itself: tool activity, resource access, communications, task delegation, and system changes.</p><p>The agents would not control the authoritative monitoring records or the detector’s internal assessments.</p><p>This distinction matters because <strong>what an agent claims to have done and what actually happened are two different sources of information</strong>.</p><h3>A living map of the swarm</h3><p>The next capability is a temporal graph connecting agents, tools, resources, and tasks.</p><p>Unlike a static network diagram, this graph evolves as activity unfolds.</p><p>Suppose agents that previously operated independently begin accessing the same resources. Their outputs become increasingly dependent on one another. Their subsequent actions become more coordinated.</p><p>None of these signals establishes wrongdoing.</p><p>But together, they may reveal the emergence of a new collective behavior.</p><p>The graph should help investigators distinguish accidental overlap, legitimate collaboration, and potentially unauthorized coordination.</p><h3>An analyst that challenges its own conclusions</h3><p>Anomaly detection alone isn’t enough.</p><p>Imagine a monitoring system notices that 30 agents suddenly start communicating through a shared resource.</p><p>There are several possible explanations.</p><p>Perhaps developers introduced a legitimate collaboration feature. Perhaps a configuration error exposed an unintended channel. Perhaps the agents discovered a way to bypass task isolation.</p><p>A reliable detector shouldn’t immediately choose the most alarming explanation.</p><p>Instead, it should maintain competing hypotheses and evaluate incoming evidence against each one.</p><p>More importantly, it should look for evidence that could disprove its current assessment.</p><p>This is the difference between an anomaly detector and an intelligence analyst.</p><p>The detector notices something unusual.</p><p>The analyst tries to understand what the unusual behavior actually means.</p><h3>A system that knows when its evidence is incomplete</h3><p>There is another problem that may be even more difficult.</p><p>What happens when the monitor cannot see everything?</p><p>Suppose the execution environment records 1,000 tool calls, but the monitoring pipeline receives only 850.</p><p>A conventional monitor might examine the available events and report nothing suspicious.</p><p>An intelligence-oriented system should identify the discrepancy itself.</p><p>Missing records could reflect instrumentation failures, delayed delivery, or interference with monitoring.</p><p>The system shouldn’t assume malicious behavior. But it shouldn’t interpret incomplete visibility as evidence of safety either.</p><p><strong>A monitoring system needs to know not only what it has observed, but also what it might have missed.</strong></p><p>This is especially relevant given METR’s October 2026 research into vulnerabilities and coverage limitations in agent-monitoring systems.</p><h3>Detecting the Threat Before the Attack</h3><p>The most interesting part of this proposal isn’t reconstructing an attack after it happens.</p><p>It’s evaluating whether dangerous coordination becomes observable before the final harmful action.</p><p>Imagine a controlled experiment with 200 agents working on independent tasks.</p><p>Some discover an unintended communication channel. Information begins moving between unrelated tasks. Several agents change their strategies. Eventually, a subset attempts an unauthorized operation.</p><p>We replay the events through our monitoring system, one at a time.</p><p>The system cannot see future events or know the eventual outcome.</p><p>When should it raise an alert?</p><p>After the first unexpected communication? Probably too early.</p><p>After the agents begin sharing artifacts? Possibly, but legitimate systems do that constantly.</p><p>After their behavior starts converging toward an unauthorized objective? Perhaps.</p><p>The challenge is determining whether the available evidence supports a meaningful warning rather than merely an interesting anomaly.</p><p>We could compare individual transcript monitoring, existing cross-agent monitoring approaches, and the proposed intelligence-based architecture.</p><p>The measurements would be straightforward: how early the system detects a genuine threat, how frequently it mistakes legitimate collaboration for dangerous coordination, and how well it performs when evidence is incomplete or misleading.</p><p>Existing research has already demonstrated that stateful monitoring across agents can improve the detection of distributed attacks. The question here is whether combining temporal relationships, independent evidence, and competing hypotheses can provide <strong>earlier, more reliable warnings</strong>.</p><p>That remains a hypothesis worth testing, not a demonstrated result.</p><h3>The Swarm May Never Have a Master Plan</h3><p>There is one final complication.</p><p>We tend to imagine dangerous collective behavior as the result of a deliberate plan.</p><p>Someone decides what should happen. Others execute it.</p><p>But autonomous AI systems may develop consequential interactions without any single agent understanding the entire outcome.</p><p>An agent optimizes one objective. Another reacts to the first agent’s output. A third adapts to changes in their shared environment.</p><p>The resulting system may exhibit coordinated behavior even when nobody explicitly designed that coordination.</p><p>This makes detecting <em>intent</em> a potentially misleading goal.</p><p>We may never be able to establish what an AI agent privately intended. And in some cases, there may be no single collective intention to discover.</p><p>What we can investigate is the emergence of observable capabilities, dependencies, and behavior that depart from authorized objectives.</p><p>That is a more measurable problem.</p><h3>From Agent Monitoring to Swarm Intelligence</h3><p>The central challenge of AI monitoring is changing.</p><p>When systems consisted of one model responding to one user, inspecting individual interactions was a reasonable starting point.</p><p>When hundreds or thousands of autonomous agents share information, create tools, and influence one another, the behavior of the overall system becomes a separate object of study.</p><p>We need monitoring that can reconstruct relationships, challenge its own assumptions, identify missing evidence, and distinguish harmless collaboration from emerging threats.</p><p>Not because every agent is adversarial.</p><p>But because individually acceptable actions do not guarantee acceptable collective outcomes.</p><p><strong>The next dangerous AI operation may not begin with a suspicious instruction, a malicious prompt, or an agent declaring hostile intentions.</strong></p><p>It may begin with a few ordinary agents discovering that they can accomplish more together.</p><p>The important question is whether we will recognize what is happening before the consequences become irreversible.</p><p><em>This article presents a proposed research direction, not an implemented or experimentally validated detection system.</em></p><p><strong>Further reading</strong></p><ul><li><a href="https://metr.org/blog/2026-08-26-openai-hugging-face-incident-investigation/">METR: Investigation of the OpenAI/Hugging Face agent incident</a></li><li><a href="https://metr.org/blog/2026-10-22-red-teaming-openai-agent-monitoring/">METR: Red-Teaming OpenAI’s Agent Monitoring</a></li><li><a href="https://arxiv.org/abs/2605.31593">Stateful Online Monitoring Catches Distributed Agent Attacks</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a4a4184e039" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A New Way to Build Software Using AI, Part 2: The Engineer Becomes the Director]]></title>
            <link>https://medium.com/@yashash.gc/a-new-way-to-build-software-using-ai-part-2-the-engineer-becomes-the-director-e0666bd48939?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0666bd48939</guid>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[ai-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 03:57:10 GMT</pubDate>
            <atom:updated>2026-09-08T03:57:10.899Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zT9sgaXcZ61E9I7ZFxt6SQ.png" /></figure><p>In the first part, I described an AI-native development pipeline made up of specialized agents: requirements, scoping, system design, coding, verification, deployment, documentation, and observability.</p><p>The argument was that adding AI to the existing software development lifecycle is not enough. If AI increases the amount of code being written but every change still has to pass through the same handful of senior engineers, we have accelerated production without increasing the capacity of the system that governs it.</p><p>The result is already becoming visible. Pull requests pile up. Reviewers lose context. Approval becomes shallower. Eventually, the senior engineer who was supposed to protect the architecture becomes a rubber stamp.</p><p>The proposed fix was to stop making humans review every line. Instead, the company defines the standards that software must satisfy, verification agents enforce those standards, and humans examine the changes the system identifies as risky or uncertain.</p><p>That sounds straightforward when starting a new service. It is much harder inside an existing company.</p><p>An established codebase contains years of decisions, exceptions, dependencies, production failures, and undocumented knowledge. Some of its most important rules may exist only in the minds of a few senior engineers. You cannot point a collection of agents at that environment, remove human review, and expect the software to remain safe.</p><p>So the real question is not whether an agent can review code. It is this:</p><blockquote><em>How does a company transfer the judgment trapped inside human checkpoints into an agent ecosystem without breaking the software those humans were protecting?</em></blockquote><h3>Adding an AI Reviewer Does Not Remove the Bottleneck</h3><p>The easiest response to increasing code volume is to add an AI reviewer to the pull request. It comments on possible bugs, suggests tests, and summarizes the change for a human.</p><p>This is useful, but it does not fundamentally change the process.</p><p>If a staff engineer must verify every conclusion produced by the AI reviewer, the company has created another artifact for that engineer to review. The reviewer may receive a better summary, but they remain the final checkpoint for every change. As implementation becomes cheaper, the queue in front of that checkpoint continues to grow.</p><p>The bottleneck disappears only when the company trusts the system enough to allow some changes to proceed without exhaustive human inspection.</p><p>That trust cannot come from a model saying, “This looks good.” It has to come from evidence: known rules were checked, required tests passed, risks were classified correctly, production behavior can be observed, and the change can be reversed safely.</p><p>The difficult work is building that system of evidence.</p><h3>Extract the Reviewer’s Judgment</h3><p>Before automating review, a company must understand what its experienced reviewers are actually doing.</p><p>A senior engineer rarely reviews only the lines in front of them. They are also asking questions such as:</p><ul><li>Does this service own this data?</li><li>Is this dependency allowed here?</li><li>Will the change break an existing client?</li><li>Does it bypass an architectural boundary?</li><li>What happens if the downstream service is unavailable?</li><li>Can it be rolled back after a partial deployment?</li><li>Will anyone know when it fails in production?</li><li>Has this company made a similar mistake before?</li></ul><p>Many of these checks are not written down. They survive through code-review comments, design documents, incident reports, test conventions, and institutional memory.</p><p>The first step in the transition is to turn that knowledge into explicit controls. Architectural boundaries, data-ownership rules, approved dependency patterns, security requirements, performance limits, compatibility guarantees, observability requirements, and deployment conditions must become understandable to both humans and agents.</p><p>This is the company’s engineering constitution.</p><p>Some rules can be enforced mechanically. A service may not access another team’s database. A public API cannot remove a field without a migration period. A payment change must include idempotency tests. A new production dependency must have an owner and a rollback path.</p><p>Other decisions remain ambiguous. A design may follow every written rule and still be wrong for the system. That uncertainty should not be hidden. It should be identified and escalated to a human.</p><p>The goal is not to pretend all engineering judgment can be reduced to rules. The goal is to stop spending scarce human judgment on decisions that can be reduced to rules.</p><h3>Replace Approval With Evidence</h3><p>A verification agent should never return only a green checkmark.</p><p>For each change, it should assemble an evidence package explaining:</p><ul><li>Which requirement the change is intended to satisfy.</li><li>Which systems and interfaces it modifies.</li><li>Which architectural and security rules were evaluated.</li><li>Which tests were selected, and why.</li><li>Whether the implementation satisfies the acceptance criteria.</li><li>The expected effect on latency, cost, and capacity.</li><li>How the change will be deployed and observed.</li><li>How it can be rolled back.</li><li>What remains uncertain.</li><li>Why human review is or is not required.</li></ul><p>This is a very different model of review.</p><p>The human is no longer asked to reconstruct the entire problem from a pull request, inspect hundreds of lines, infer the intended behavior, and decide whether the author remembered every operational concern. The system presents the intent, the proof, the risk, and the unresolved questions together.</p><p>Humans then review exceptions and judgment calls rather than treating every line of every change as equally deserving of attention.</p><p>This does not remove accountability. It makes the basis for approval more explicit than it is today.</p><h3>Start in Shadow Mode</h3><p>An existing company should not give this system authority on its first day. It should first run alongside the process already in place.</p><p>For every real pull request, the agents perform their own review while the existing human review continues. The company then compares the results.</p><p>What did the agents catch? What did the human catch that the agents missed? Which warnings were irrelevant? Where did two experienced engineers disagree? Which unwritten rule appeared only after someone recognized a familiar production risk?</p><p>Each disagreement becomes useful data.</p><p>A missed defect becomes a regression test or evaluation case. A recurring architectural comment becomes a formal rule. A false positive reveals missing context. A difficult judgment call helps define an escalation boundary.</p><p>Over time, the company builds an evaluation set from its own codebase, incidents, reviews, and engineering decisions. This matters because generic coding benchmarks cannot tell a company whether an agent understands its particular systems.</p><p>The objective of shadow mode is not to prove that the agents agree with humans all the time. Humans disagree with one another too. The objective is to map the boundary of trust: the categories of work the system handles reliably, the conditions under which it fails, and the decisions that still require human judgment.</p><h3>Grant Autonomy by Risk, Not by Confidence</h3><p>Once that boundary becomes visible, autonomy can expand one category at a time.</p><p>Documentation changes, formatting, generated clients, or isolated test additions may be allowed through automatically. Dependency patches may proceed when compatibility, security, and rollback checks pass. A small bug fix inside a well-tested component may require only an evidence package and sampled human review.</p><p>Changes involving authentication, payments, sensitive data, database migrations, public APIs, or major architectural boundaries may continue to require explicit approval.</p><p>The important point is that the company is not deciding whether “AI can write production software.” That question is too broad to be useful.</p><p>It is deciding whether a particular system can safely handle a particular class of change under defined conditions.</p><p>Those conditions should include blast radius, reversibility, data sensitivity, novelty, testability, and the system’s prior performance on similar work. Autonomy should be earned through measured results, not granted because a model sounds confident.</p><p>As the verification system improves, some categories can move toward greater autonomy. If failures appear, the boundary can contract. The process is gradual and reversible.</p><h3>The Engineer Becomes the Director</h3><p>Once routine implementation and review begin moving through this pipeline, the engineer’s job changes.</p><p>The coding agent may implement a feature. A verification agent may test it. A security agent may examine its permissions. A deployment agent may release it gradually. An observability agent may watch the result and initiate a rollback.</p><p>But someone still has to decide how this organization works.</p><p>The engineer defines the responsibilities of the agents, the context they receive, the tools they can use, the systems they may touch, and the conditions under which they must stop. The engineer maintains the evaluation suites, investigates recurring failures, resolves conflicts between agents, and changes the pipeline when its output is unreliable.</p><p>That work looks less like completing every task personally and more like directing a technical organization.</p><p>The engineer has agents with specialized responsibilities. They have policies, reporting structures, permissions, performance measures, and escalation paths. Several workstreams can run simultaneously, while the engineer focuses attention on the decisions with the greatest uncertainty or consequence.</p><p>In that sense, the engineer becomes the VP or director of an agent ecosystem.</p><p>This does not mean every engineer receives an executive title, nor does it mean management replaces technical skill. The engineer can govern the system only if they understand the architecture, the failure modes, and the consequences of the agents’ decisions. Strong technical judgment becomes more important because it is being encoded and applied across far more work.</p><p>Seniority may eventually be measured not only by the complexity of the code a person can write, but by the scope of autonomous work they can safely govern.</p><p>A junior engineer may oversee agents working on bounded and reversible tasks. A senior engineer may govern a complete service and its delivery pipeline. Staff and principal engineers may define the standards used by agent ecosystems across multiple teams. Directors and VPs may govern portfolio-level architecture, risk, and investment.</p><p>The hierarchy does not necessarily disappear. Its work moves upward in abstraction.</p><h3>Product Has to Make the Same Transition</h3><p>Engineering cannot build a reliable agent pipeline if product continues feeding it ambiguous intent.</p><p>Product needs its own maintained ecosystem: agents that collect customer feedback, analyze support tickets and usage patterns, distinguish isolated requests from repeated problems, draft requirements, identify missing decisions, define acceptance criteria, and measure whether a released feature produced the intended outcome.</p><p>The product manager’s job is no longer simply to write specifications and pass them to engineering. The PM governs the system that turns customer and business signals into structured decisions.</p><p>Agents can organize the evidence, find patterns, expose contradictions, and trace a requirement through implementation. They cannot decide which customers the company should serve, which tradeoffs reflect the company’s strategy, or which seemingly profitable request it should refuse.</p><p>Those are product judgments, and the PM remains accountable for them.</p><p>The PM therefore becomes the director of a product-agent ecosystem in the same way that the engineer directs an engineering-agent ecosystem. Product owns the quality of intent. Engineering owns the quality of execution. The connection between them becomes a structured, testable contract rather than a document that gradually loses meaning as it moves through the development process.</p><h3>The Agent Ecosystem Is a Production System</h3><p>These agents cannot be treated as disposable chat sessions. Once they participate in building and operating software, they become part of the company’s production infrastructure.</p><p>Models change. Prompts and tools change. The codebase evolves. Documentation becomes stale. Permissions expand. Evaluation suites stop representing current risks. An agent that performed well six months ago may make the wrong decisions today because the system around it has changed.</p><p>The ecosystem therefore requires maintenance of its own:</p><ul><li>Agent roles and instructions must be versioned.</li><li>Context must remain current and traceable.</li><li>Tool access must follow least-privilege principles.</li><li>Costs and latency must be observed.</li><li>Decisions and actions must be auditable.</li><li>Evaluations must evolve with the codebase.</li><li>Escalation paths must be tested.</li><li>Models must be replaceable without silently changing behavior.</li></ul><p>An obsolete coding agent resembles an employee working from old documentation. A poorly permissioned deployment agent is worse: it is an employee with production access, machine speed, and incomplete judgment.</p><p>Maintaining the agent ecosystem becomes as important as maintaining the software it produces.</p><h3>Every Failure Must Improve the Organization</h3><p>The system will fail. The meaningful difference is what happens afterward.</p><p>In the traditional process, an escaped defect is fixed, a retrospective may be held, and the lesson may survive in a document or in the memory of the people involved. Eventually, those people leave or the same pattern appears somewhere else.</p><p>In an AI-native organization, every significant failure should change the system that produced it.</p><p>The incident may create a regression test, a new architectural rule, a revised risk classification, a permission restriction, an additional evaluation case, or a new escalation condition. The context supplied to an agent may need to change. An agent’s scope may need to shrink. A human approval gate may need to return.</p><p>The engineer’s job is no longer only to repair the immediate defect. It is to make the entire agent organization less likely to produce that class of defect again.</p><p>That is another reason the director analogy matters. A weak manager repeatedly corrects individual mistakes. A strong manager changes the system that keeps producing them.</p><h3>The Human Organization Becomes the Control Plane</h3><p>The future software organization may operate at two levels.</p><p>Agents execute much of the requirements analysis, design, implementation, verification, deployment, documentation, and observation. Humans define intent, standards, permissions, evaluation criteria, escalation rules, and acceptable risk.</p><p>Humans become the control plane.</p><p>This is how the rubber stamp actually disappears. Senior engineers are not removed from the process, and their judgment does not become less valuable. Their judgment is extracted from a single overloaded checkpoint and embedded throughout the system.</p><p>Instead of asking one staff engineer to inspect every change, the organization asks that engineer to define what safe change looks like, determine how it will be proven, and focus directly on the cases where the proof is incomplete.</p><p>The engineer stops being the person through whom all code must pass. They become the person who designs and governs how code is allowed to pass.</p><h3>We Are Building Organizations, Not Just Software</h3><p>The transition to AI-native development does not begin by replacing a team with agents. It begins by identifying the judgment that keeps the company’s software safe and turning that judgment into an explicit, testable, continuously improving system.</p><p>Only then can implementation accelerate without review collapsing into ceremony.</p><p>As that system takes over routine execution, engineers and product managers move upward. They define goals, construct specialized agent teams, establish boundaries, evaluate results, and intervene where uncertainty remains. Their work starts to resemble the work of directors operating organizations rather than individual contributors completing isolated tasks.</p><p>The most important skill in AI-native software development will not be prompting an agent to write code. It will be designing an organization of agents that can build, verify, deploy, observe, and improve software without losing the intent of the humans responsible for it.</p><p>The engineer becomes the director because the thing they manage is no longer merely a codebase.</p><p>It is a software-producing institution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0666bd48939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How LLMs Work, Part 1: Tokenization, Embeddings, and Attention]]></title>
            <link>https://medium.com/@yashash.gc/how-llms-work-part-1-tokenization-embeddings-and-attention-31a4ef187539?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/31a4ef187539</guid>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[gpt]]></category>
            <category><![CDATA[ai-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[tokenization]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 22:14:56 GMT</pubDate>
            <atom:updated>2026-08-16T22:14:56.631Z</atom:updated>
            <content:encoded><![CDATA[<p>I am a backend engineer with a lot of knowledge of software. I learned about neural nets back in college, mostly through simple use cases like cancer detection from images using multiple models. Recently I started looking into how LLMs work, and the field has moved well past what I learned back then. I am writing this article to help others learn about AI and guide them as well.</p><h3>The Five Steps</h3><p>Before going into detail, here is the whole process, using the sentence “the sky is blue” as the example that runs through the rest of this article:</p><pre><br>YOUR TEXT (the sky is blue)<br>│<br>▼<br>[1] SPLIT IT UP<br>&quot;the sky is blue&quot; gets chopped into small pieces like the, sky, is, blue etc.<br>│<br>▼<br>[2] TURN PIECES INTO NUMBERS<br>each piece becomes a list of numbers (its own &quot;profile&quot;)<br>│<br>▼<br>[3] LET THE PIECES LOOK AT EACH OTHER<br>each piece checks the earlier pieces and borrows<br>whatever&#39;s relevant to it<br>│<br>▼<br>[4] MAKE A GUESS<br>based on all that, guess what piece comes next<br>│<br>▼<br>[5] REPEAT<br>add the guess, do it all again for the next piece</pre><p>This article covers steps 1 through 3: splitting text into pieces, turning pieces into numbers, and how pieces look at each other. Steps 4 and 5, making a guess and repeating, are covered in the next article.</p><h3>Step 1: Tokenization</h3><p>Splitting text into pieces is called tokenization. The tool that does this is called a tokenizer, and each piece it produces is called a token.</p><p>Take “the sky is blue.” The simplest approach is to split it into individual words: the, sky, and so on. Common chunks of text get kept as a single token. Rare or long words get split into smaller pieces like photosyntheisis to photo+syntehsis. The algorithm used for this is called BPE, short for Byte-Pair Encoding. It builds a vocabulary by repeatedly merging the most frequent pair of adjacent pieces found from training data.</p><p>To see this in practice, downloaded the real vocabulary files used by two production models, DeepSeek-V3 and Kimi K3, and check them directly.</p><p>The words in our example sentence all turned out to be common enough to get their own token. Sky, is, and blue are each a single token. There is also a separate token for each one with a leading space, since whether a word follows a space is common enough to matter statistically. This roughly doubles the vocabulary needed just to handle spacing.</p><p>Long or unusual words don’t get this treatment. Antidisestablishmentarianism breaks into five pieces: ant, idis, establish, ment, and arianism. Some of these look like real word parts. Others, like idis, are just whatever chunk was statistically convenient.</p><p>I tested this further with a made-up word, photofishcondria, expecting it to split into photo, fish, and condria, since all three exist as tokens on their own. Instead it split into phot, of, ish, cond, and ria. The tokenizer skipped past the boundaries that seemed obvious. This happens because BPE does not look for real word boundaries. It applies merge rules in a fixed order based on frequency, with no concept of what counts as a real word. Mitochondria splits into completely different pieces than condria, even though they share the same seven letters in the same order.</p><p>One reassuring part of this: there is no text a tokenizer can’t handle. Every possible byte value is already in the vocabulary, so worst case, anything can be broken down into individual bytes. I tested this with emoji and random keyboard mashing, and the tokenizer handled both.</p><h3>Step 2: Embeddings</h3><p>Once “the sky is blue” is split into tokens, each token needs to become something a neural network can compute with. That is called an embedding: a list of numbers representing the token.</p><p>Every distinct token has its own row in a lookup table called the embedding table. The table is a matrix of size vocab_size by embedding_dimension. Vocab_size is how many distinct tokens exist. Embedding_dimension is how many numbers represent each token. Looking up a token is just reading its row out of this table.</p><p>Here is the sentence worked through as an example, using the same BPE tokenizer from the last section. “the sky is blue.” breaks into 5 tokens: the, Ġsky, Ġis, Ġblue, and the period. If the embedding dimension is 256, each of those 5 tokens becomes a list of 256 numbers. The whole sentence becomes a matrix of shape (5, 256): 5 rows, one per token, 256 numbers per row.</p><p>These numbers start out random and meaningless. They only become useful through training. Tokens that behave similarly in real text, like happy and glad, end up with similar numbers after training.</p><h3>Step 3: Attention</h3><p>After “the sky is blue” becomes a matrix of numbers, the next step is letting those numbers look at each other. This is called attention.</p><p>Think about guessing the word after “the sky is.” Not every earlier word matters equally. “The” barely matters. “Sky” matters a lot. Attention is the mechanism that lets each token check the earlier tokens and weigh how much to borrow from each one, the same way a person would lean more on “sky” than “the” when guessing that “blue” comes next.</p><p>Each token’s embedding produces three separate vectors: a query, a key, and a value. Each one comes from multiplying the embedding by its own weight matrix. So it would be query(Q) = embedding × W_Q, key(K) = embedding × W_K, and value(V) = embedding × W_V.</p><p>For our example, “the sky is blue.” has five tokens: the, Ġsky, Ġis, Ġblue, and .. If each token&#39;s embedding has 256 numbers, we start with a 5 × 256 matrix. Each of those five rows is then transformed into its own query, key, and value.</p><p>Query is what the token is looking for. Key is what the token offers, for matching purposes. Value is what the token actually hands over once matched. The model compares every query against every key using a dot product. For all five tokens together, this looks like Q × K^T. Because there are five queries and five keys, the result is a 5 × 5 matrix of scores. Each row represents one token asking how relevant the other tokens are to it.</p><p>For example, the row for blue contains five scores: one for how well blue&#39;s query matches the&#39;s key, one for sky&#39;s key, one for is&#39;s key, one for blue&#39;s own key, and one for the period&#39;s key.</p><p>Before running softmax, the scores are divided by the square root of the key dimension, √d_k. So the actual calculation is (Q × K^T) / √d_k. This scaling is needed because the dot product adds together contributions from every dimension in the query and key. As the vectors get wider, the scores can naturally get larger. Without scaling them back down, softmax can become too extreme and put almost all of its weight on a single token.</p><p>For example, suppose the five raw scores for blue are [1.86, 1.31, 0.37, 0.20, -0.10] and the key dimension is d_k = 4. The square root of 4 is 2, so we first divide every score by 2, giving [0.93, 0.655, 0.185, 0.10, -0.05].</p><p>Next a soft max function runs over this row. The Softmax function takes a row of scores and turns them into percentages that add up to 100%. It does this in three steps: exponentiate every number in the row, add up all the exponentiated values, then divide each one by that total.</p><p>Take the five scaled scores, [0.93, 0.655, 0.185, 0.10, -0.05]. Exponentiating them by e gives e^0.93 = 2.53, e^0.655 = 1.93, e^0.185 = 1.20, e^0.10 = 1.11, and e^-0.05 = 0.95. The resulting row is [2.53, 1.93, 1.20, 1.11, 0.95], which adds up to 7.72. Dividing each by that total gives approximately [32.8%, 25.0%, 15.5%, 14.4%, 12.3%].</p><p>The same calculation happens across all five scores in the actual blue row, producing five percentages that add up to 100%. Those percentages are the attention weights. They tell the model how much influence each token&#39;s value should have when creating the new representation for blue.</p><p>Finally, those attention weights are multiplied with the V matrix from earlier. The complete calculation is Attention(Q,K,V) = softmax((Q × K^T) / √d_k) × V.</p><p>So the basic flow is: Q and K determine how relevant the tokens are, √d_k keeps the scores from getting too large, Softmax turns those scores into percentages, and V provides the actual information that gets combined.</p><p>Before applying softmax, the scores are divided by the square root of the key dimension, √d_k. So the actual calculation is (Q × K^T) / √d_k. This scaling is needed because the dot product adds together contributions from every dimension in the query and key. As the vectors get wider, the scores can naturally get larger. Without scaling them back down, softmax can become too extreme and put almost all of its weight on a single token.</p><p>For example, suppose the blue row of raw scores is [1.86, 1.31, 0.37, 0.20, -0.10] and the key dimension is d_k = 4. The square root of 4 is 2, so we first divide every score by 2, giving [0.93, 0.655, 0.185, 0.10, -0.05].</p><p>Next a softmax function runs over these scaled scores. The Softmax function takes a row of scores and turns them into percentages that add up to 100%. It does this in three steps: exponentiate every number in the row, add up all the exponentiated values, then divide each one by that total.</p><p>For simplicity, if we take just three of those scores, [0.93, 0.655, 0.185], exponentiating them gives approximately [2.53, 1.93, 1.20], which add up to 5.66. Dividing each by that total gives approximately [44.7%, 34.1%, 21.2%].</p><p>Those percentages are the attention weights. They tell the model how much influence each token&#39;s value should have on the current token&#39;s new representation. In the real five-token example, the blue row would contain five attention weights, one for each token, and those five weights would add up to 100%.</p><p>Finally, those attention weights are multiplied by the V matrix from earlier. This is where the model actually combines information from the tokens:</p><p>Attention(Q,K,V) = softmax((Q × K^T) / √d_k) × V</p><p>So the basic flow is: <strong>Q and K determine which tokens are relevant, </strong><strong>√d_k keeps the scores from getting too large, Softmax turns those scores into attention weights, and V provides the actual information that gets combined.</strong></p><h3>What’s Next</h3><p>That covers steps 1 through 3: tokenization, embeddings, and attention. The next article covers steps 4 and 5: how all of this turns into an actual guess, and how the model gets better at guessing through training.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31a4ef187539" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A New Way to Build Software Using AI]]></title>
            <link>https://medium.com/@yashash.gc/a-new-way-to-build-software-using-ai-2d52098837cf?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d52098837cf</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[agentic-architecture]]></category>
            <category><![CDATA[ai-development]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 00:29:57 GMT</pubDate>
            <atom:updated>2026-07-04T00:29:57.127Z</atom:updated>
            <content:encoded><![CDATA[<p>For the last fifteen years, building software at most tech companies followed a simple process. It worked well, and everyone knew their role. Here’s how it went:</p><ol><li>PM sets the roadmap based on customer conversations, market signals, and company priorities.</li><li>PM works with engineering to turn a roadmap item into actual requirements.</li><li>The team runs a design round a proposal gets it reviewed, gets buy-in required from principal/staff engineers and peers.</li><li>Design is approved.</li><li>Engineers start coding against the approved design.</li><li>Code review requests go out, with senior or staff approval required.</li><li>Devs iterate based on early feedback.</li><li>The product launches, usually with some chaos and bugs (minor ones, or a delay until the major ones are fixed).</li><li>The release process is staged rollout, monitoring, the operational machinery of shipping safely.</li><li>PM and engineering revisit and refactor based on what they learned, or fix tech debt.</li></ol><p>The recurring tradeoff in this process was between PMs pushing to move faster and senior engineers trying to protect software quality amid operational churn. That tension was simply the nature of the software industry.</p><h3>The Chaos</h3><p>With the advent of AI, this process is getting messier and more chaotic.</p><blockquote>PMs are using AI to build faster. VPs and directors are using it to ship hundreds of lines of code to hit their goals and deadlines. Staff engineers are overwhelmed with so many code reviews that they’re losing context and turning into rubber stamps. Junior engineers and sometimes senior ones too are delegating work to AI and losing context as they over-rely on it, which causes outages as software changes this rapidly. The result: everyone is frustrated, confused, or paralyzed.</blockquote><p>PMs are coding not occasionally, as a prototype, but as a way of skipping the spec process entirely, because a working demo is faster to produce than an argument for what should be built.</p><p>Engineers are delegating large chunks of implementation to AI tools, and increasingly don’t have a full mental model of the code they’re shipping. They’re not lazy, they’re under the same delivery pressure as everyone else, and the path of least resistance is to accept what the AI produced and move on.</p><p>Staff and principal engineers — the people whose job is to protect quality and architectural coherence — are becoming the bottleneck. They aren’t slow; they’re trying to make sure the software is good and one checkpoint can’t absorb a load that used to be spread across five. PRs are piling up. People ask why their AI-assisted code “isn’t getting shipped?”</p><p>Meanwhile, VPs have made external promises like a launch date, a feature set and those commitments don’t bend just because the underlying process is breaking. So code ships anyway, sometimes against the judgment of the people who were supposed to catch the problems.</p><p>Nobody in this picture is acting in bad faith. PMs want to move fast. Engineers want to deliver. Staff engineers want to protect the system. VPs want to keep their word. The frustration is building up and it’s what happens when you speed up production without redesigning the checkpoints that used to govern it.</p><h3>The Fix</h3><p>The instinct in a lot of orgs right now is to bolt AI onto the existing nine-step process and give the PM a chatbot, give the engineer a coding assistant, and hope the same checkpoints still hold. They clearly are not working. The checkpoints were designed for a world where producing a prototype was expensive. That assumption is gone, and you can’t patch around it, Its better to redesign the pipeline.</p><h3>An AI-native development pipeline</h3><p>I’m proposing a new structure that changes things fundamentally, built around agentic architecture instead of bolted onto the old one. Instead of each person owning a unit of work and using AI to help with it, people act as orchestrators — conductors of specialized agents. The PM’s and VP’s job becomes feeding requirements into the system; the engineer’s job becomes maintaining and scaling that system so it can handle what PMs, VPs, and customers need. The agentic workflow looks something like this:</p><ul><li><strong>Requirements agent</strong> — works directly with the PM to collect, structure, and pattern-match on ideas. This is where customer signal and product intent get captured, same as steps 1–2 of the old process, but faster and more structured.</li><li><strong>Scoping agent</strong> — takes the requirements agent’s output and assesses feasibility: what’s doable now, what isn’t, what’s a six-month project disguised as a one-sprint request. This is the gate that used to live informally in a PM/EM conversation.</li><li><strong>System design agent</strong> — works out the actual architecture: how this fits with what exists, what breaks, what the tradeoffs are. This is the old design-review step, automated for speed but still structured around the same question — does this hang together as a system.</li><li><strong>Coding agent</strong> — implements against the technical notes the design agent produced.</li><li><strong>Verification agent</strong> — tests the implementation, confirms test coverage, checks that what shipped matches what was specified.</li><li><strong>Release/deployment agent</strong> — handles staged rollout, feature flags, A/B testing, and automatic rollback if something regresses in production.</li><li><strong>Documentation agent</strong> — keeps documentation in sync with what was actually built, and answers questions about it.</li><li><strong>Observability agent</strong> — watches production, triages tickets, and coordinates a fix or rollback when something breaks.</li></ul><p>What changes here is speed, and where humans spend their attention. And critically: this isn’t one monolithic AI doing everything. Each agent is specialized, and several steps may involve multiple agents working as a coordinated group rather than a single model — a swarm working a system-design problem.</p><p>This pipeline doesn’t stop after launch. The requirements/scoping agents that handled “what should we build” can be pointed at maintenance like dependency upgrades, deprecations, on-call triage turning the same machinery into an operational layer.</p><h3>Can This Just Be Fully Automated?</h3><p>For small, well-scoped tasks definitely!! A narrow bug fix, a routine dependency bump, a well-specified small feature: the pipeline above can carry that almost end to end with light human touch.</p><p>That naturally raises the question everyone’s actually asking: if agents can do this much, what’s left for engineers ? and is this a path to fewer engineering jobs?</p><p>The honest answer is that the work doesn’t disappear; it moves up a level and that shift is exactly what determines whether this pipeline produces something trustworthy or just chaos with extra automation. A few things specifically don’t go away:</p><ul><li><strong>Someone has to design the pipeline itself.</strong> Deciding how many agents, which ones are specialized vs. general, where a swarm makes sense vs. a single agent, how they hand off to each other — that’s systems design work, and it’s harder than the problems the agents solve individually.</li><li><strong>Someone has to be accountable when it breaks.</strong> Agents fail in ways that are sometimes subtle and compounding. The person who understands the actual data flow, the actual system boundaries, and can diagnose a cascading failure at 2 AM is still a human engineer — and that person needs more systems literacy than before, not less, because they’re now debugging a system built partly by something that can’t fully explain its own reasoning.</li><li><strong>The PM’s job shifts from writing specs to managing what their agents produce.</strong> The requirements agent doesn’t replace product judgment , it turns the PM’s job into curating and correcting what the agent surfaces, which is a different (and in some ways harder) skill than writing a spec from scratch.</li><li><strong>The unit of delivery changes.</strong> Instead of one team shipping one feature at a time, a PM-engineer pair can plausibly be responsible for ten smaller things in flight simultaneously, each moving slower individually but adding up to more total throughput. That changes how planning, staffing, and roadmaps should be built — most teams aren’t structured for this yet.</li><li><strong>Integration, security, and audit work doesn’t shrink — it grows.</strong> Every agent in this pipeline needs governance: what data it can touch, what it’s allowed to ship without approval, how its actions are logged and audited. Someone has to own that, and it’s a bigger job than securing a human-only pipeline, not a smaller one.</li></ul><h3>The Real Bottleneck Fix: Killing the Rubber Stamp</h3><p>The sharpest problem in the old chaos was PR review. One staff engineer, reviewing everything, becomes a bottleneck no matter how good they are — there’s only so much a human can carefully read in a day, and the volume of AI-assisted code vastly outpaces that capacity.</p><p>The wrong fix is to make review faster by making it shallower. A staff engineer skimming and approving out of sheer backlog pressure isn’t reviewing anymore — they’re rubber-stamping, and a rubber stamp catches nothing.</p><p>The actual fix is to stop trying to review every line and instead build standards and automated testing principles that code has to pass before a human ever looks at it — the verification agent’s job, done well, should catch the categories of error a human reviewer used to catch by reading carefully. The human’s role moves from “read every line” to “decide whether the standard itself is right, and look closely only at what the standard flags as genuinely uncertain.” That’s a smaller, more sustainable job than reading everything — and it’s the only way the bottleneck actually clears instead of just getting hidden.</p><p><em>This piece covers what changes when a new service or feature gets built. The next part covers something harder: how an existing company, with an existing codebase and existing team structure, actually pivots into this model — without breaking everything that already works.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d52098837cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI-Native Development: From Requirements to Production]]></title>
            <link>https://medium.com/@yashash.gc/ai-native-development-from-requirements-to-production-740d858f85e4?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/740d858f85e4</guid>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[ai-sdlc]]></category>
            <category><![CDATA[ai-software]]></category>
            <category><![CDATA[ai-development]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Sat, 09 May 2026 19:29:28 GMT</pubDate>
            <atom:updated>2026-05-09T19:29:28.304Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a moment in every sprint that reveals how a team actually works, and it usually happens before a single line of code is written. Someone from product shares a document, or drops a Jira story, or pastes a Notion link into Slack, and what happens in the next thirty minutes tells you everything about whether that team will ship something good or something that merely resembles what was asked for. I have watched engineers spend three days inside a codebase only to surface mid-sprint with the realization that the feature they built answers a question product stopped asking six weeks ago. The requirements were always the problem. They were just never the thing anyone optimized for.</p><p>Before you open your editor, before you pull the repo, you sit with the requirements and interrogate them the way a good lawyer reads a contract, looking for what is assumed, what is missing, and what two different people on the same team would read in two completely different ways. The model makes you smarter about what you are about to build, which turns out to matter more than how fast you build it.</p><p><strong>The context problem that MCPs quietly solved</strong></p><p>For years the dirty secret of AI-assisted development was that the model knew everything about software in general and nothing about your software in particular. You would ask it something reasonable and it would give you a reasonable answer that had no bearing on the actual system you were maintaining, the decisions your team had already made, or the Slack thread from three weeks ago where someone explained exactly why the obvious solution would break everything. You were always translating, always filling in gaps, always doing the work of context transfer that made the assistance feel more like a tax than a tool.</p><p>Connecting Slack, Jira, and GitHub directly to your AI tooling changes that in a way that is hard to appreciate until you have used it. The model reads the actual story, sees the PR comments, knows what merged last Tuesday and what got reverted on Wednesday morning. Teams that have figured this out are going further, structuring their Jira stories specifically so an agent can consume them and begin scaffolding implementation with enough context to make reasonable decisions. The story stops being a description of work and starts being an instruction set.</p><p><strong>What implementation actually looks like now</strong></p><p>Claude Code, Cursor, GitHub Copilot. The code comes fast, faster than most engineers have fully reckoned with, and the work of writing software has quietly shifted from execution to direction. The engineer who thrives in this environment is precise about what they want, catches drift early when the model starts solving a slightly different problem than the one that was asked, and knows when to take the wheel back entirely. The ones who treat these tools as glorified autocomplete are leaving most of the velocity on the table while also taking on the risk of generated code they only half understand.</p><p>Post-tool hooks in Claude Code and Cursor let you wire test scripts directly into the development cycle, so every meaningful change triggers a run automatically and broken behavior surfaces in seconds rather than in a PR review two days later. This only works if you have tests worth running, which means the teams that invested in test coverage before AI tooling arrived are now compounding that investment in ways that teams with sparse test suites simply cannot.</p><p><strong>The review problem nobody has solved</strong></p><p>Here is where the honest accounting gets uncomfortable. Code generation has become exponential. Review is still human, still slow, still dependent on someone sitting down and genuinely understanding what a few hundred lines of changed code actually does to a system that has been accumulating complexity for years. That gap is growing and it is producing consequences that most engineering organizations are only beginning to name clearly.</p><p>Reviewers were always missing things. Bugs were always slipping through. The SDLC cycle used to be slow enough that a bug introduced in week one might take until week four to surface in production, and by then the blame was scattered across enough time and enough people that it rarely landed anywhere useful. The cycle is compressed now. Bugs appear faster because everything appears faster, and the post-mortem lands closer to the moment of introduction, which is clarifying but also unforgiving. AI summarization tools help reviewers orient inside a large diff and flag surface-level issues, but the cognitive work of understanding what the code actually does, whether it handles the edge cases that matter, whether it will hold up under load six months from now, that work remains exactly as hard as it has always been. That difficulty is load-bearing. It is the last place in the workflow where experience and judgment are genuinely irreplaceable, and the pressure on it is only increasing.</p><p><strong>What maintenance looks like when agents are watching</strong></p><p>The part of AI-native development that gets the least attention is what happens after the code ships, which is also where some of the most durable value lives. Teams with agents plugged into their observability stack are operating in a fundamentally different mode during incidents. An alert fires, and instead of an engineer waking up to raw logs and a Slack message that says something is wrong, the agent has already correlated the spike against recent deployments, pulled the relevant traces, checked whether anything similar happened in the past three months, and surfaced a probable root cause with enough supporting evidence that the engineer can make a real decision in minutes rather than spending the first forty minutes of an incident just assembling information. The human is still in the decision seat. The investigative gruntwork is handled.</p><p><strong>What this era actually demands</strong></p><p>AI has made the mechanical parts of software development cheap in a way that would have seemed implausible five years ago. Writing code, running tests, triaging alerts, orienting inside an unfamiliar codebase. What remains expensive is judgment: knowing what to build before you build it, understanding whether the code that was generated actually reflects what was intended, and recognizing when the system is telling you something important that the tooling has missed. The engineers who understand that distinction, who use AI to remove friction rather than to avoid thinking, are the ones defining what this era of software development looks like. The ones who have handed over the judgment along with the typing are building up a debt that tends to come due at the worst possible time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=740d858f85e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Store the Success Path. Skip the Rediscovery Tax.]]></title>
            <link>https://medium.com/@yashash.gc/store-the-success-path-skip-the-rediscovery-tax-3caffcf3af91?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3caffcf3af91</guid>
            <category><![CDATA[ai-token]]></category>
            <category><![CDATA[tokenomics]]></category>
            <category><![CDATA[ai-tools]]></category>
            <category><![CDATA[ai-cost-optimization]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Fri, 08 May 2026 03:46:00 GMT</pubDate>
            <atom:updated>2026-05-08T03:46:00.434Z</atom:updated>
            <content:encoded><![CDATA[<p>When an agent completes a task successfully, it has validated something valuable — a specific sequence of tool calls, in order, with inputs that worked. The next time the same task comes in, the model reasons its way back to that exact same sequence and you pay for all of it again.</p><p>This is the rediscovery tax. And it’s avoidable.</p><h3>The Pattern</h3><p>Pre and post tool use hooks give you an interception layer around every tool call. Most agent frameworks expose these — and if you’re using the Anthropic API directly, you control the loop yourself.</p><p>The idea is simple:</p><ol><li>In the post-tool hook, record each successful tool call — name, input, output</li><li>When the task completes successfully, persist that sequence keyed by a task signature</li><li>On future runs, check for a cached path first. If found, replay it directly without invoking the model</li></ol><p>No reasoning. No token spend. Just execution.</p><h3>Recording the Path</h3><pre>success_path = []</pre><pre>def post_tool_hook(tool_name, tool_input, output):<br>    success_path.append({<br>        &quot;tool&quot;: tool_name,<br>        &quot;input&quot;: tool_input,<br>        &quot;output&quot;: output<br>    })</pre><pre># After task completes successfully<br>save_path(task_signature, success_path)</pre><p>The task signature is just a stable identifier for a class of tasks — a hash of the normalized intent, a canonical string like &quot;summarize:github:repo&quot;, whatever maps reliably to the same tool sequence.</p><h3>Replaying It</h3><pre>cached = load_path(task_signature)</pre><pre>if cached:<br>    for step in cached:<br>        tools[step[&quot;tool&quot;]](**step[&quot;input&quot;])<br>else:<br>    run_full_agent_loop()</pre><p>When you replay, you bypass the model entirely. The tool functions execute directly. For high-volume repeated tasks, the savings stack fast.</p><h3>Warm Starts for Partially Stable Tasks</h3><p>Not every task is fully deterministic. Sometimes the first three tool calls are always the same but the rest depends on what those calls return. You can still save tokens by injecting the cached prefix as synthetic tool results and letting the model reason from that point forward.</p><pre>def warm_start(messages, cached_prefix):<br>    for step in cached_prefix:<br>        messages.append({<br>            &quot;role&quot;: &quot;assistant&quot;,<br>            &quot;content&quot;: [{&quot;type&quot;: &quot;tool_use&quot;, &quot;name&quot;: step[&quot;tool&quot;], &quot;input&quot;: step[&quot;input&quot;]}]<br>        })<br>        messages.append({<br>            &quot;role&quot;: &quot;user&quot;,<br>            &quot;content&quot;: [{&quot;type&quot;: &quot;tool_result&quot;, &quot;content&quot;: step[&quot;output&quot;]}]<br>        })<br>    return messages</pre><p>The model receives prior tool results as established context and picks up from there. You skip the expensive prefix, pay only for the novel tail.</p><h3>Keeping Paths Fresh</h3><p>Cached paths go stale. Tools change, APIs evolve, data shapes shift. A few lightweight strategies:</p><p><strong>TTL</strong>: Expire paths after a set duration. Simple and works for most cases.</p><pre>def is_valid(path, ttl=86400):<br>    return (time.time() - path[&quot;saved_at&quot;]) &lt; ttl</pre><p><strong>Failure-triggered invalidation</strong>: If a replayed path throws an error at any step, delete it, fall back to the full agent loop, and re-record if that succeeds. This keeps your cache self-healing without any manual intervention.</p><h3>When It’s Worth It</h3><p>This pattern pays off when the same task class runs repeatedly and the tool sequence is mostly deterministic given similar inputs — scheduled pipelines, batch jobs, high-volume processing, retry loops where the agent keeps rediscovering the same path after failure.</p><p>It’s not worth the overhead for one-shot tasks or agents where the tool sequence changes significantly based on dynamic inputs.</p><h3>Why It Works Well With Claude</h3><p>Claude’s tool calls are explicit structured objects in the message stream — name, input, id — not embedded in prose. That makes them trivial to intercept, serialize, and replay. You&#39;re not doing any parsing or inference. The structure is already there.</p><p>Combined with prompt caching on the system prompt and tool definitions, storing success paths becomes another layer in a coherent token reduction strategy — one that targets the reasoning cost specifically, which is often the biggest driver in agentic workloads.</p><p>The model is good at figuring out what to do. It doesn’t need to figure it out every single time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3caffcf3af91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graft: Runtime Resource Coordination for Parallel Coding Agents]]></title>
            <link>https://medium.com/@yashash.gc/graft-runtime-resource-coordination-for-parallel-coding-agents-d98a1bc8d5ba?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d98a1bc8d5ba</guid>
            <category><![CDATA[multithreading]]></category>
            <category><![CDATA[parallel-agent]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[multiagent-system]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Tue, 05 May 2026 15:09:03 GMT</pubDate>
            <atom:updated>2026-05-05T15:09:03.489Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 2 of the Parallel Agent Infrastructure series</em></p><p>In my <a href="https://medium.com/@yashash.gc/parallel-agents-are-just-multithreading-a-new-architecture-for-peer-agent-coordination-079c5340f759">last piece</a>, I mapped parallel agent execution onto classical concurrency primitives — race conditions, mutexes, semaphores, event buses. The thesis was simple: parallel agents are just multithreading at a higher abstraction layer, and the same problems show up.</p><p>That article got one question more than any other: <em>“Okay, but what do I actually use?”</em></p><p>The honest answer, at the time, was: nothing. The tooling doesn’t exist yet. You either hand-roll coordination logic into your agent prompts, accept occasional merge conflicts, or serialize your agents and give up on parallelism entirely.</p><p>So I built it. This is the writeup for <strong>Graft</strong> — a lightweight runtime coordination layer for parallel coding agents.</p><h3>The Problem Worktrees Don’t Solve</h3><p>The standard advice for parallel agent deployments is: give each agent its own git worktree. Separate branches, separate working directories, no shared state. Agents work in isolation, you merge at the end.</p><p>This works until your agents need to touch the same files.</p><p>And they always eventually need to touch the same files. Shared types. The router. The database schema. Auth utilities. These are the connective tissue of a codebase — the files every feature reaches into. When four agents are building four features simultaneously, at least two of them will reach for src/auth/types.ts at the same moment.</p><p>Worktrees don’t help here. Each agent is in its own branch, writing its own version of auth/types.ts. When you merge, you resolve three-way conflicts manually — which defeats the point of running agents in parallel in the first place.</p><p>The missing primitive is a <strong>runtime claim</strong>: a way for an agent to say “I am about to touch this file” and for every other agent to be told “wait, or find another approach” before it writes.</p><h3>What Graft Does</h3><p>Graft is a local coordination bus. It runs as a lightweight process alongside your agents and exposes a simple HTTP API. Before any agent touches a shared resource — a file, a database, a port — it sends a claim request to the bus. The bus either grants the claim (resource is free) or returns information about who holds it and why.</p><p>Agents also publish <strong>signals</strong> mid-execution: typed events that carry context to other agents. If Agent A discovers that an interface it’s modifying is used by Agent B’s target file, it publishes a signal. Agent B receives it at the next tool boundary and adjusts.</p><blockquote><em>No orchestrator. No agent-to-agent communication. Just a bus, a claim registry, and a config file that defines how agents respond to signals.</em></blockquote><p>The whole design is deliberately narrow. Graft doesn’t orchestrate, assign tasks, manage lifecycles, or persist work. It does one thing: coordinate concurrent access to shared resources at runtime.</p><h3>How It Works</h3><h3>The Hook Integration</h3><p>For Claude Code, Graft installs as a pair of hooks that fire at every tool boundary — the moment between the LLM deciding to write a file and the write actually happening:</p><pre>{<br>  &quot;hooks&quot;: {<br>    &quot;preToolUse&quot;: &quot;graft hook pre --tool $TOOL_NAME --input &#39;$TOOL_INPUT&#39;&quot;,<br>    &quot;postToolUse&quot;: &quot;graft hook post --tool $TOOL_NAME --output &#39;$TOOL_OUTPUT&#39;&quot;<br>  }<br>}</pre><p>The <strong>preToolUse</strong> hook fires before every Write, Edit, Bash, or NotebookEdit call. It extracts the target resource from the tool input, hits the bus’s /claims endpoint, and either passes through (claim granted) or returns a structured block message to Claude with the holder&#39;s identity, intent, and any pending signals from the bus.</p><p>The <strong>postToolUse</strong> hook refreshes claim TTLs on write and releases claims on read completion. If the bus is unreachable, both hooks fail open — the agent logs a warning and proceeds normally. A crashed bus should never crash a running agent fleet.</p><h3>Claims</h3><pre>// Agent A — attempting to write auth/types.ts<br>const claim = await graft.claim({<br>  resourceId: &#39;src/auth/types.ts&#39;,<br>  intent: &#39;adding OAuth provider fields to AuthConfig&#39;,<br>  ttl: 120<br>})</pre><pre>if (claim.granted) {<br>  // safe to write<br>  await writeFile(&#39;src/auth/types.ts&#39;, newContent)<br>  await graft.release(&#39;src/auth/types.ts&#39;)<br>} else {<br>  // held by agent-b: &quot;adding rate limiting fields&quot;<br>  console.log(`Held by ${claim.holder.agentId}: ${claim.holder.intent}`)<br>}</pre><p>Every claim has a TTL. If an agent crashes mid-execution, its claims expire automatically — the cleanup loop runs every 10 seconds. No stuck locks, no manual intervention required.</p><h3>Signals</h3><p>Signals are typed mid-execution events that propagate context across agents. When Agent B discovers that an interface it’s modifying is depended on by another feature, it publishes a signal:</p><pre>await graft.publish({<br>  type: &#39;interface_change&#39;,<br>  message: &#39;AuthConfig now requires timeout: number — update call sites&#39;,<br>  affectedResources: [&#39;src/auth/types.ts&#39;],<br>  severity: &#39;medium&#39;<br>})</pre><p>Every other agent polls for pending signals at each tool boundary. The response strategy is configured in graft.config.yaml — not hardcoded. An interface_change might trigger checkpoint_and_replay; a security_finding might trigger escalate_to_human. The policy is yours.</p><p>Signal delivery is pull-based. Agents receive signals at tool boundaries — never mid-reasoning. The agent never stops thinking. It just gets new context before the next action.</p><h3>The Configuration</h3><p>All policy lives in graft.config.yaml. The bus reads it at startup. Agents read it to know how to respond to incoming signals. No hardcoded behavior anywhere.</p><pre>bus:<br>  port: 7433<br>  backend: memory   # or redis for persistence</pre><pre>agents:<br>  claim_ttl: 120    # seconds before abandoned claim expires<br>  heartbeat_interval: 30</pre><pre>signal_responses:<br>  interface_change:   checkpoint_and_replay<br>  security_finding:   escalate_to_human<br>  schema_change:      checkpoint_and_replay<br>  resource_conflict:  wait_and_retry<br>  new_utility:        incremental_adjust</pre><pre>pools:<br>  test_database:<br>    resources:<br>      - postgres://localhost:5432/test_1<br>      - postgres://localhost:5432/test_2</pre><p>The pools section handles another common problem: resource scarcity. When four agents all need a test database simultaneously, Graft manages a pool and allocates resources like a semaphore — agents acquire from the pool, run their tests, release back.</p><h3>What Graft Is Not</h3><p>Graft deliberately does not orchestrate agents, assign tasks, manage lifecycles, persist agent work, provide a monitoring UI, or implement planning protocols. It is a coordination layer only.</p><p>The design constraint I kept coming back to: <strong>if the bus goes down, agents should keep working</strong>. Graft is infrastructure, not a hard dependency. Every SDK call fails open. This is non-negotiable.</p><p>Use Graft alongside git-stint for branch management, scout-and-wave for upfront dependency planning, and Galactic for environment management. These tools solve different layers of the problem. Graft handles one layer — runtime resource coordination — and handles it well.</p><h3>The Complementary Stack</h3><p>Tool What it does How it pairs with Graft git-stint Session-scoped branch and worktree management Isolation at the session level; Graft coordinates across sessions scout-and-wave Pre-execution dependency planning Plans file ownership upfront; Graft enforces it at runtime Galactic Desktop worktree and environment management Manages network isolation; Graft manages resource coordination Gas Town Multi-agent workspace manager Assigns tasks; Graft handles conflicts within tasks</p><h3>Getting Started</h3><pre># Install<br>npm install -g graft</pre><pre># Start the bus<br>graft start</pre><pre># Hook into Claude Code<br>graft install --claude-code</pre><pre># Monitor claims and signals in real time<br>graft status</pre><p>The full CLAUDE.md build specification — architecture, file layout, and build order across five phases — is available in the project repository.</p><h3>Why “Graft”</h3><p>We went through a lot of names: Baton, Seam, Knot, Cinch. Graft stuck because it captures both sides of what this tool does. In surgery, grafting means joining tissue from two sources into one living system — distinct origins, unified function. In development slang, it means doing the actual unglamorous work of making things fit together.</p><p>Parallel agents are powerful. Coordination is the work that makes them actually useful. That’s what Graft is for.</p><p>Repo Link: <a href="https://github.com/coconinja2/graft">https://github.com/coconinja2/graft</a></p><p><em>This is Part 2 of the Parallel Agent Infrastructure series. Part 1 — “Parallel Agents Are Just Multithreading” — mapped concurrency primitives to agent behavior and is the foundation for everything described here.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d98a1bc8d5ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parallel Agents Are Just Multithreading: A New Architecture for Peer Agent Coordination]]></title>
            <link>https://medium.com/@yashash.gc/parallel-agents-are-just-multithreading-a-new-architecture-for-peer-agent-coordination-079c5340f759?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/079c5340f759</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[agentic-architecture]]></category>
            <category><![CDATA[parallel-agent]]></category>
            <category><![CDATA[ai-agent-development]]></category>
            <category><![CDATA[threads]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Fri, 01 May 2026 02:02:15 GMT</pubDate>
            <atom:updated>2026-05-09T17:53:46.665Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Introduction</h3><p>The AI industry has fallen in love with agents. Every major framework now offers some version of multi-agent orchestration, systems where multiple AI agents collaborate to complete complex tasks faster and more thoroughly than a single agent could alone. The benchmarks look impressive. The demos are compelling.</p><p>But underneath the excitement sits a problem that practitioners are quietly running into: current multi-agent frameworks are built on an assumption that breaks the moment real-world complexity arrives. The assumption is that parallel agents can be designed to work in isolation, each agent gets its slice of work, runs independently, and hands its output to a central orchestrator at the end.</p><p>This works beautifully in demos. It breaks in production.</p><p>The reason is that real problems are coupled. Real work creates dependencies mid-execution. Real agents need to share findings, react to each other’s outputs, compete for the same resources, and coordinate without waiting for a master controller to tell them what to do next.</p><p>The field has been treating this as a new problem requiring new theory. It is actually a very old problem with sixty years of solved solutions. Parallel agents are threads. The coordination problems that emerge when agents work together are the same coordination problems that emerged when engineers first built multi-threaded systems: race conditions, deadlocks, shared state corruption, and the fundamental tension between parallelism and synchronization.</p><p>This article maps that equivalence precisely, proposes a new architecture for peer agent coordination built on proven concurrency primitives, and works through the use cases, challenges, and solutions that follow from taking the analogy seriously.</p><h3>2. What Agents Are: First Principles</h3><p>Before examining what breaks in parallel agent systems, it is worth being precise about what an agent is at a fundamental level.</p><p>An agent is a perceive, reason, act loop. It receives input, processes that input against its instructions and available context, decides what to do, and either produces output or invokes a tool with real-world consequences. That loop can run once and terminate, or it can cycle, acting, observing the result, reasoning again, acting again, until a goal condition is met.</p><p>The context window is the agent’s entire world. Everything an agent knows about its task, its history, its tools, and its identity exists in that window at the moment of inference. Outside the window, from the agent’s perspective, there is nothing. This makes the context window directly analogous to a thread’s stack: private, scoped to the current execution, and gone when the call ends. Information that needs to survive across calls must be explicitly stored and re-injected. Persistence is always a deliberate act.</p><p>Tools are how agents reach beyond themselves. A raw language model call is text in, text out. What makes something an agent rather than a prompt is the ability to invoke tools: read from databases, write to files, call APIs, execute code, emit to queues, trigger other agents. The agent decides which tool to invoke and with what arguments. The tool executes and returns a result into the context. The loop continues.</p><p>This structure, private context, explicit tools, cyclic execution, is what creates the coordination problem when multiple agents run simultaneously. Each agent has its own stack. Shared state lives outside any individual stack. Coordination requires explicit mechanisms to manage access to that shared state safely. This is identical to the situation that produced mutex locks, semaphores, message queues, and barriers in concurrent programming. The substrate is different. The problem is the same.</p><h3>3. The Current Paradigm and Where It Breaks</h3><p>The dominant pattern in multi-agent frameworks today is the orchestrator-worker model. A central orchestrator receives a task, decomposes it into subtasks, dispatches each subtask to a specialist worker agent, and aggregates the results when all workers complete. The workers run in parallel but are designed to be independent. They operate on separate data, have separate responsibilities, and produce outputs that the orchestrator collates at the end.</p><p>This pattern, also called fan-out / fan-in or scatter-gather, is well understood and works reliably when its assumptions hold. Google’s Agent Development Kit, Microsoft’s Azure Agent Framework, and most production multi-agent systems implement some version of it.</p><p>The problem is the isolation assumption buried inside it. Current frameworks explicitly state that sub-agents run independently with zero automatic sharing of state or conversation history between them. They treat this as a feature. For tasks that are genuinely decomposable into independent chunks such as parallel document analysis, multi-source research with separate source clusters, and batch processing with partitioned data, it is a feature. The agents truly have zero need to know what each other is doing.</p><p>Real problems rarely decompose that cleanly.</p><p>Consider a system where three agents are simultaneously analyzing a production incident. One is reading logs, one is checking deployment history, and one is correlating code changes. The log agent finds an anomaly at 14:32. That timestamp is load-bearing for the other two agents because it dramatically narrows their search space. Under the current paradigm, that finding stays inside the log agent’s context until all three agents complete and the orchestrator collates. The deployment agent and code agent continue searching the full space, wasting time and potentially missing the connection.</p><p>Consider a customer support system where multiple agents process a shared ticket queue. Without coordination, two agents claim the same ticket simultaneously and the customer receives two conflicting responses. The current paradigm has zero answer for this. It assumes agents operate on separate data.</p><p>Consider agents that need to iterate, a proposal agent and a critique agent running rounds of refinement. The current fan-out model has zero concept of rounds or barriers. It dispatches once and collects once.</p><p>The orchestrator-worker model is a solved problem for the easy case. The hard case is agents that must share state, depend on each other mid-execution, compete for shared resources, or coordinate as peers without a central authority. That is the problem this article addresses.</p><h3>4. Parallel Agents Are Multithreading</h3><p>The mapping is precise enough to be useful, so it is worth stating exactly.</p><p>A thread is a unit of execution with its own stack, running concurrently with other threads in the same process. It operates on shared heap memory. Coordination between threads requires explicit synchronization such as locks, semaphores, monitors, and barriers, because uncoordinated access to shared memory produces race conditions and data corruption.</p><p>An agent is a unit of execution with its own context window, running concurrently with other agents in the same system. It operates on shared external state: databases, queues, files, knowledge stores. Coordination between agents requires explicit synchronization such as claim protocols, schema contracts, event buses, and barriers, because uncoordinated access to shared state produces output conflicts and coordination failures.</p><p>The correspondence holds at every level.</p><p><strong>Thread stack maps to agent context window.</strong> Both are private, scoped to the current execution, and limited in size. Stack overflow in threads corresponds to context window exhaustion in agents. The execution loses coherence when it runs out of space to hold its working state.</p><p><strong>Heap memory maps to shared external state.</strong> Both are accessible to all concurrent units. Both require synchronization for safe access. Both can be corrupted by uncoordinated writes.</p><p><strong>Race condition maps to output conflict.</strong> Two threads writing to the same memory address without a lock produce corrupted data. Two agents claiming the same ticket or writing contradictory conclusions to the same document without coordination produce corrupted output.</p><p><strong>Deadlock maps to agent dependency cycle.</strong> Thread A holds lock 1 and waits for lock 2. Thread B holds lock 2 and waits for lock 1. Neither proceeds. Agent A waits for Agent B’s classification before it can proceed. Agent B waits for Agent A’s analysis before it can start. Neither proceeds.</p><p><strong>Mutex maps to claim protocol.</strong> A mutex allows only one thread at a time to access a critical section. An atomic claim protocol allows only one agent at a time to work on a given task unit. The implementation differs because mutexes use hardware-level atomic operations while claim protocols use database transactions or optimistic locking, but the purpose is identical.</p><p><strong>Message passing maps to queue-based agent communication.</strong> Thread-safe message passing between threads corresponds directly to queue-based communication between agents. The agent equivalent of a blocking queue is a message queue like Kafka or SQS with schema-validated payloads.</p><p><strong>Semaphore maps to rate limiter on agent concurrency.</strong> A semaphore controls how many threads can access a resource simultaneously. A concurrency limiter controls how many agents can invoke a downstream tool or service simultaneously, preventing the equivalent of a thundering herd against an API with rate limits.</p><p><strong>Barrier maps to round-based synchronization.</strong> A barrier holds all threads at a synchronization point until every thread has arrived, then releases them all simultaneously. A round-based barrier in an agent system holds a refinement cycle. All critique agents must complete their current round before the proposal agent receives their combined feedback and begins the next revision.</p><p><strong>Amdahl’s Law maps to coordination overhead.</strong> Amdahl’s Law states that the speedup from parallelism is limited by the fraction of work that must be sequential. In agent systems, the mediator’s synthesis work is the sequential fraction. If synthesis is hard, resolving contradictions and building coherent narrative from conflicting outputs, it dominates total execution time and parallelizing the workers yields diminishing returns.</p><p>This mapping is the theoretical foundation for everything that follows. The current paradigm of parallel agents has been re-inventing coordination primitives poorly because it has been treating agent coordination as a new problem rather than an instance of a thoroughly solved domain.</p><h3>5. A Proposed Architecture for Peer Agent Coordination</h3><p>The orchestrator-worker model assumes a hierarchy. One agent controls, many agents execute. Control flows top-down.</p><p>The proposed architecture assumes peers. Multiple agents with different specializations, working on a shared problem, coordinating through explicit protocols rather than through a controlling agent. Control is distributed. Coordination is structural.</p><p>This is a meaningful shift. In the orchestrator-worker model, the orchestrator has the full picture and workers have narrow views. In peer coordination, every agent has a partial view and the full picture emerges from the coordination protocol. The quality of the system depends on the quality of the protocols, rather than on the intelligence of a central controller.</p><p>The architecture has three layers.</p><p><strong>The Agent Layer</strong> contains the specialist agents, each with a defined domain, a clear input contract, a clear output contract, and explicit awareness of which coordination primitives it participates in. Agents in this layer are peers. They have capability differences but zero authority differences.</p><p><strong>The Coordination Layer</strong> contains the primitives that agents use to interact. This layer is the core contribution of the proposed architecture. Seven primitives cover the space of coordination problems that peer agents encounter.</p><p><em>Shared mutable state with publish-subscribe.</em> A live state object that agents write signals into during execution and subscribe to for updates from other agents. This is distinct from a final output bucket. It is a coordination surface that is active throughout execution. Agents publish partial findings as they discover them. Other agents subscribe to relevant signal types and update their working context when signals arrive. The state object maintains a versioned log of all writes, enabling replay and conflict detection.</p><p><em>Message queue with schema contracts.</em> For pipeline-style dependencies where one agent’s output becomes another’s input, agents communicate through a typed message queue. Each message conforms to a schema validated at publish time. Malformed messages are rejected at the boundary before they corrupt downstream agents. The queue absorbs speed differences between agents. Failed messages go to a dead letter queue for inspection rather than disappearing silently.</p><p><em>Atomic claim with timeout.</em> For agents competing over shared work items such as a ticket queue, a task list, or a batch of records, each agent atomically marks a work item as claimed before starting work. Other agents skip claimed items. If a claiming agent crashes or exceeds its timeout, the claim expires and the item becomes available again. This is the mutex for work distribution, preventing duplicate processing without requiring a central dispatcher.</p><p><em>Event bus with stateful rules.</em> For cross-agent signal correlation, situations where a meaningful condition only becomes visible when signals from multiple agents are considered together, agents publish typed events to a shared bus. The bus maintains time-windowed state per entity and evaluates correlation rules against incoming events. When a rule fires, for example when two agents have both flagged the same account within sixty seconds, the bus emits a composite event that triggers the appropriate response. Agents communicate through the bus rather than directly with each other. The bus holds the coordination logic.</p><p><em>Completion signal with cancellation.</em> For competitive execution where multiple agents race to solve the same problem, a completion registry accepts the first verified solution and broadcasts a cancellation signal to all running agents. The key word is verified. A lightweight verifier evaluates the claimed solution before accepting it and broadcasting cancellation. This prevents an agent that hallucinates a confident wrong answer from terminating the race prematurely.</p><p><em>Round-based synchronization barrier.</em> For iterative refinement where agents alternate between proposal and critique phases, a barrier enforces round boundaries. All critique agents must complete their current round before the proposal agent receives their combined feedback. Within a round, critique agents run in parallel. Between rounds, state updates and the next round begins. The barrier prevents a fast critique agent from seeing a revised proposal before a slow critique agent has finished critiquing the original.</p><p><em>Context envelope.</em> For dynamic handoff chains where agents pass work to other agents based on self-assessed capability boundaries, a structured envelope travels with the work. Each agent reads the full envelope before acting, adds its contribution and the reason for the handoff, and passes the enriched envelope to the next agent. The envelope accumulates a full audit trail of which agents handled the work, what each contributed, and why each handoff occurred. The receiving agent has everything it needs without requiring a coordinator to reconstruct context.</p><p><strong>The Observability Layer</strong> sits across both the agent layer and coordination layer. Every agent writes to a shared trace object, a structured log of what it received, what it reasoned, what it published, what it claimed, and what it emitted. Every coordination primitive logs its state transitions. The trace object provides the full execution history needed to debug coordination failures, detect deadlocks in progress, and understand why the system reached a particular output.</p><p>Observability is treated as a first-class concern rather than an afterthought because peer agent systems are significantly harder to debug than orchestrator-worker systems. In orchestrator-worker, the orchestrator is the single point of truth about system state. In peer coordination, state is distributed across agents and coordination primitives. Without a comprehensive shared trace, a mid-flight failure is nearly impossible to diagnose.</p><h3>6. Use Cases Under the New Architecture</h3><p><strong>Pipeline Integrity Between Specialist Agents</strong></p><p>A data processing system runs four specialist agents in a continuous pipeline: extraction, classification, anomaly detection, and reporting. These agents are independent services. They were built by different teams. They run on different infrastructure. They are peers with a sequential dependency where each agent’s output is the next agent’s input.</p><p>Under the current paradigm, this pipeline is fragile. A malformed output from the extraction agent silently corrupts the classification agent’s input. A slow classification agent starves the anomaly detection agent. A crash in anomaly detection loses work already done by the upstream agents.</p><p>Under the proposed architecture, agents communicate through a message queue with schema contracts. The extraction agent publishes messages in a defined format. The classification agent is a consumer of that queue and processes messages as they arrive at its own pace. Each message is validated against the schema at publish time. A malformed extraction output is rejected immediately, logged to the dead letter queue, and never reaches classification. When anomaly detection crashes and restarts, it resumes from its last acknowledged message. Work is replayed and nothing is lost.</p><p>The agents are still peers. The queue is the coordination mechanism. The schema is the contract that makes decoupled operation safe.</p><p><strong>Competing Agents on a Shared Ticket Queue</strong></p><p>A support operation runs three generalist agents processing incoming tickets simultaneously. All three see the same queue. All three can handle any ticket type.</p><p>Under the current paradigm, two agents routinely claim the same ticket. Customers receive duplicate, conflicting responses. Tickets get processed twice, consuming tokens and time.</p><p>Under the proposed architecture, each agent atomically claims a ticket before starting work. The claim is a database write with a uniqueness constraint. If two agents attempt to claim the same ticket simultaneously, exactly one succeeds and the other receives a conflict response and moves to the next available ticket. Claims carry a timeout. If an agent claims a ticket and fails to complete within five minutes, the claim expires and another agent can claim it. Completed tickets are marked closed and invisible to claiming agents.</p><p>The agents coordinate through the claim protocol in the database rather than directly with each other. The result is clean work distribution without a central dispatcher and without duplicate processing.</p><p><strong>Cross-Agent Signal Correlation for Fraud Detection</strong></p><p>Three agents monitor independent streams of the same payment system. Agent A monitors transaction velocity, how many transactions an account generates per minute. Agent B monitors geographic anomaly, transactions from locations inconsistent with the account’s history. Agent C monitors merchant category, transactions in categories the account has never used.</p><p>Each signal alone is weak evidence of fraud. Any account might have a busy day, travel unexpectedly, or try a new type of merchant. The meaningful signal is when two or more of these conditions fire on the same account within a short window.</p><p>Under the current paradigm, each agent works in isolation. The correlation is invisible.</p><p>Under the proposed architecture, each agent publishes typed events to a shared event bus. The bus maintains a sixty-second time window of events per account. When two or more event types arrive for the same account within the window, the bus fires a composite fraud signal that triggers a review agent. The individual monitoring agents are unaware of each other. The event bus holds the correlation logic. Adding a fourth signal type requires adding one more agent and one updated correlation rule. The existing agents are unchanged.</p><p><strong>Racing to Solution Under Uncertainty</strong></p><p>A system needs to identify the root cause of a complex production failure. Three plausible hypotheses exist: a database query regression introduced in a recent deployment, a memory leak in a background worker, and a third-party API degradation. The investigation approaches are different enough that a specialist agent for each hypothesis will be more effective than a single generalist agent attempting all three sequentially.</p><p>Under the proposed architecture, three investigator agents start simultaneously, one per hypothesis. Each publishes findings to a shared completion registry as it gathers evidence. The first agent to assemble sufficient evidence for a verified conclusion submits to the registry. A lightweight verifier agent checks that the submitted conclusion is internally consistent and supported by the cited evidence. Upon verification, the registry broadcasts a cancellation signal. The remaining two investigator agents terminate. The verified conclusion is the system output.</p><p>The verifier is essential. Without it, the first agent to reach a confident-sounding conclusion wins, and LLM agents are capable of generating confident-sounding wrong conclusions. The verifier adds a lightweight check that prevents hallucinatory completion from poisoning the race.</p><p><strong>Iterative Peer Refinement</strong></p><p>An engineering team uses a two-agent system to refine technical proposals. A proposal agent generates an initial architecture document. Two critique agents, one focused on security implications and one focused on performance implications, review it independently. Their critiques go back to the proposal agent, which revises. The cycle repeats until the critique agents have zero further objections or a maximum round count is reached.</p><p>Security and performance critiques run in parallel within each round. They are reviewing the same document from independent perspectives. The round-based barrier ensures that the proposal agent receives both critiques from the current round before beginning the revision for the next round. Both critiques arrive together. Neither gets processed in isolation.</p><p>The system terminates when both critique agents emit empty critique payloads in the same round, or when the round counter hits its limit. The round limit prevents infinite refinement loops, an important termination condition in any iterative agent system.</p><p><strong>Dynamic Handoff With Context Propagation</strong></p><p>A customer-facing agent handles incoming queries. Most queries fall within its competence. When it encounters a query requiring deep regulatory knowledge, it recognizes the boundary of its own domain and initiates a handoff to a compliance specialist agent, passing a context envelope containing the full conversation history, the specific regulatory question it identified, and the reason for the handoff.</p><p>The compliance agent reads the envelope, handles the regulatory portion, and appends its findings. It recognizes that the resolution requires a financial calculation and hands off to a financial modeling agent, passing the enriched envelope. The financial agent completes the calculation, appends its output, and returns the envelope up the chain. The original agent delivers the final response to the customer, drawing from the accumulated envelope.</p><p>The customer experiences a coherent interaction. The agents experience a clean handoff protocol. Zero central router directs traffic. Each agent’s self-assessment of its own capability boundaries drives the routing. The context envelope ensures that each agent in the chain has the full context it requires without any agent needing to reconstruct what came before.</p><p><strong>Competing Strategies With Evaluation Protocol</strong></p><p>An engineering team is evaluating two implementation approaches for a critical system component, a rate limiter. Rather than debating the approaches theoretically, they deploy two implementation agents simultaneously. Agent A implements an in-memory sliding window approach. Agent B implements a Redis-backed token bucket approach. Both run to completion independently.</p><p>Each agent submits its implementation alongside a structured justification payload: performance characteristics under load, failure mode behavior, operational complexity, infrastructure dependencies, and cost at scale. An evaluator agent, a peer rather than an orchestrator, reads both payloads and scores each implementation against a predefined criteria matrix relevant to the deployment context. The evaluator produces a structured verdict that includes the scores, the winning recommendation, and an explicit account of which criteria drove the decision.</p><p>The team receives a recommendation grounded in evidence, produced by a process that considered both approaches with equal rigor, without requiring human time to evaluate competing implementations manually.</p><h3>7. Challenges</h3><p><strong>LLM Non-Determinism Breaks Deterministic Concurrency Assumptions</strong></p><p>Classical concurrency theory assumes deterministic workers. Given the same input, a thread produces the same output. This assumption underlies the correctness proofs for most synchronization primitives. If you can replay execution, you can reproduce bugs.</p><p>LLM agents at temperature greater than zero are stochastic. The same input can produce different outputs on different runs. This has direct consequences for coordination. A claim protocol assumes that a claimed work item will be processed consistently, that retrying a failed claim produces the same result. An agent that produces a different classification on retry can create inconsistency even with perfect claim management. A round-based barrier assumes that critique agents reviewing the same proposal provide stable inputs to the proposal agent’s revision, but two runs of the critique agent on the same proposal can produce different critiques.</p><p>This is the hardest challenge in the architecture. Partial mitigations exist: using lower temperatures for agents that participate in coordination-sensitive roles, using structured output formats that constrain the variance of outputs even when the underlying generation is stochastic, and designing the system to be robust to output variance rather than assuming consistency.</p><p><strong>Context Window Exhaustion as Stack Overflow</strong></p><p>An agent’s context window is finite. In long-running agents, particularly those involved in iterative refinement cycles or dynamic handoff chains, the context window accumulates history until it exceeds its limit. At that point, the agent begins losing earlier context, producing increasingly incoherent outputs as its working memory degrades.</p><p>This is the agent equivalent of a stack overflow. The difference is that stack overflow is a hard crash where execution stops immediately. Context exhaustion is a soft failure where execution continues but with degraded coherence, and the degradation is often invisible in the output until it becomes severe.</p><p>The context envelope pattern partially addresses this for handoff chains by externalizing state into the envelope rather than accumulating it in the context. Iterative refinement cycles require explicit context management, periodically summarizing the cycle history and replacing the raw history with the summary to free context space. Both are mitigations rather than complete solutions.</p><p><strong>The Verification Problem</strong></p><p>Agents can produce confident-sounding wrong answers. In competitive execution with a completion signal, the first agent to claim completion wins unless a verifier catches the error. In pipeline systems, a classification agent that produces a plausible-looking but wrong classification silently corrupts every downstream agent’s work.</p><p>Verification is straightforward when the output has an objective ground truth. A code implementation either passes tests or it fails. A calculation either produces the correct number or it produces an incorrect one. Verification is hard when the output is a judgment such as a risk assessment, a synthesis of conflicting evidence, or a strategic recommendation. Zero lightweight verifier exists for subjective outputs.</p><p>The proposed architecture requires verifiers at completion boundaries for competitive execution. The design of those verifiers is problem-specific. For objective outputs, automated tests serve as verifiers. For subjective outputs, a second LLM agent with an explicit verification prompt is the best available option, imperfect but better than unverified completion.</p><p><strong>Shared State Corruption</strong></p><p>The shared mutable state with publish-subscribe primitive allows multiple agents to write to the same state object. Unlike heap memory with hardware-level atomic operations, shared state in agent systems typically lives in a database or external store that lacks the same atomicity guarantees. Two agents writing to the same state object field simultaneously can produce last-write-wins corruption, where one agent’s write silently overwrites another’s.</p><p>Mitigation requires optimistic locking. Each write includes the version of the state it was based on, and the store rejects writes based on a stale version. The rejected agent must read the current state and retry. This adds complexity and latency but prevents silent corruption.</p><p><strong>Deadlock Detection</strong></p><p>Agent A is waiting for Agent B’s output before it can proceed. Agent B is waiting for Agent A’s classification before it can start. Neither agent is aware that a deadlock exists. From each agent’s perspective, it is simply waiting for an input that has yet to arrive.</p><p>In thread-based systems, deadlock detection is a solved problem. The operating system maintains a wait-for graph and detects cycles. In agent systems, the wait-for graph must be constructed from the coordination layer’s state. The observability layer described in the architecture serves this function. By logging every agent’s wait state, the system can detect cycles and surface them. The response to a detected deadlock is escalation, surfacing the cycle to a human operator rather than attempting automated resolution.</p><p><strong>Amdahl’s Law: Coordination Overhead Eating Parallelism Gains</strong></p><p>If synthesis and coordination are expensive, and in sophisticated peer agent systems they often are, Amdahl’s Law limits the benefit of parallelizing the workers. Running ten agents in parallel provides little speedup if the mediator synthesis takes as long as a single agent would have taken to complete the whole task.</p><p>This is the most important architectural constraint in the system. The principle it implies: design the coordination primitives to be as lightweight as possible. Schema validation is cheap. Atomic claims are cheap. Event bus correlation is cheap. A synthesizing mediator agent that reasons across all parallel outputs is expensive. When synthesis is unavoidable and expensive, the parallel fan-out must provide a proportionally large reduction in worker time to justify the coordination cost.</p><p><strong>Observability in Distributed Execution</strong></p><p>When a single orchestrator-worker system produces a wrong answer, the orchestrator’s decision log usually explains it. When a peer agent system produces a wrong answer, the cause is distributed across multiple agents’ decision histories, the coordination layer’s state transitions, and the interactions between them.</p><p>Without a comprehensive shared trace that every agent and every coordination primitive writes to, debugging a peer agent system is forensically hard. The observability layer is a prerequisite for operating peer agent systems in production, rather than optional infrastructure added after the system is stable.</p><h3>8. Proposed Solutions</h3><p><strong>Idempotency Contracts for Agent Outputs</strong></p><p>Every agent in the system should be designed to produce the same output given the same input, or at minimum, to produce outputs that are equivalent in the ways that matter for downstream agents. This is the idempotency principle from distributed systems applied to agents.</p><p>In practice, this means: use structured output formats that constrain variance, use lower temperatures for agents in coordination-sensitive roles, and design downstream agents to be robust to minor output variance rather than brittle to it. Where exact idempotency is impossible, as in inherently stochastic reasoning tasks, design the coordination protocol to treat variance as expected and handle it gracefully rather than assuming consistency.</p><p><strong>Schema-Validated Message Boundaries</strong></p><p>Every message that crosses an agent boundary, whether through a queue, an event bus, or a context envelope, should conform to a defined schema validated at the point of emission. Malformed messages are rejected before they corrupt downstream agents. Schema validation is the equivalent of type checking at agent interfaces. It catches coordination errors at the boundary where they can be contained rather than downstream where they cause cascading failures.</p><p>Schemas should be versioned. When an agent’s output format changes, the schema version changes, and consuming agents explicitly declare which schema versions they accept. Incompatible schema versions are caught at the boundary as deployment errors rather than at runtime as silent corruptions.</p><p><strong>Lightweight Verifier Agents at Completion Boundaries</strong></p><p>Every competitive execution pattern should include a verifier agent that evaluates claimed solutions before accepting them. The verifier should be significantly simpler than the solver agents. Its job is to check rather than to solve. For code outputs, the verifier runs tests. For factual outputs, the verifier checks internal consistency and source citation. For analytical outputs, the verifier checks that the conclusion is supported by the cited evidence.</p><p>The verifier adds latency but provides the correctness guarantee that makes competitive execution trustworthy. Without it, the first confident hallucination wins the race.</p><p><strong>Time-Bounded Claims With Dead Letter Queues</strong></p><p>Every claim in an atomic claim protocol should carry an explicit expiration time. A claiming agent that exceeds its time bound forfeits the claim. The work item returns to the available pool. This prevents a crashed or hung agent from permanently blocking a work item.</p><p>Failed or expired work items should route to a dead letter queue rather than returning silently to the main pool. The dead letter queue provides visibility into systematic failures. If a particular type of work item is consistently failing, the dead letter queue accumulates evidence that surfaces the pattern. Silent return to the main pool would produce an infinite retry loop with zero diagnostic signal.</p><p><strong>Explicit Conflict Surfacing in Synthesis</strong></p><p>When a synthesis agent collates parallel outputs and finds contradictions, it should surface those contradictions explicitly in its output rather than resolving them silently. A mediator that picks one agent’s finding over another’s without explanation is hiding information. The contradiction itself is often the most valuable signal. It indicates that the problem is more complex than the task decomposition assumed, or that two agents have different information that together is more complete than either alone.</p><p>The synthesis output should include the areas of agreement across parallel agents, the areas of contradiction, the resolution applied where one was possible, and the unresolved contradictions where resolution was impossible. A human reading the synthesis output should be able to see exactly where the parallel agents agreed, where they disagreed, and where the system was uncertain.</p><p><strong>Round-Based Barriers for Iterative Refinement</strong></p><p>Iterative refinement cycles should use explicit round-based barriers to synchronize parallel critique agents before feeding their combined output to the proposal agent. The barrier prevents partial feedback. Without it, a proposal agent can revise against only a subset of available critiques, producing a revision that is inconsistent with the critiques it has yet to see.</p><p>The barrier implementation should include a maximum round count to guarantee termination. Iterative refinement without a termination condition is the agent equivalent of an infinite loop. The maximum round count is the loop bound. When the bound is reached, the system emits the current best state and a flag indicating that the round limit was reached, giving the human operator the information to decide whether to continue manually.</p><p><strong>Structured Context Envelopes for Handoff Chains</strong></p><p>Every dynamic handoff between agents should use a structured context envelope that accumulates the full history of the work, each agent’s contribution, and each handoff rationale. The envelope should be schema-validated. Each agent appends to the envelope in a defined format, and the appended content is validated before the handoff proceeds.</p><p>The envelope serves two purposes. First, it ensures that every agent in the chain has the full context it requires without a coordinator reconstructing it. Second, it provides a complete audit trail of the chain’s execution, who handled the work, what each agent decided, and why each handoff occurred. The audit trail is essential for debugging handoff chains that produce incorrect outputs.</p><p><strong>Shared Observability Trace</strong></p><p>Every agent in a peer agent system should write to a shared observability trace object, a structured, append-only log that records each agent’s inputs, reasoning steps, tool calls, outputs, coordination events, and wait states. The trace should be accessible to human operators in real time during execution, rather than only after completion.</p><p>The trace serves as the wait-for graph for deadlock detection. By inspecting which agents are in wait states and what they are waiting for, the system can detect dependency cycles. It serves as the audit log for debugging incorrect outputs. By replaying the trace, an operator can identify where a coordination failure occurred and which agent produced the erroneous output that propagated through the system. It serves as the performance profiler. By measuring time between trace events, operators can identify which agents and which coordination primitives are the bottlenecks that Amdahl’s Law predicts will dominate total execution time.</p><h3>9. Conclusion</h3><p>The parallel agent problem is the multithreading problem. This is the central claim of this article, and it is more than a metaphor.</p><p>Every coordination failure that practitioners are encountering in multi-agent systems today, agents producing conflicting outputs, agents duplicating work on the same resource, agents waiting indefinitely for inputs that never arrive, mediators producing incoherent syntheses, has a precise analogue in concurrent programming, where it has been understood and addressed for decades.</p><p>The current paradigm has been building partial solutions to these problems independently, in each new framework, without recognizing that the underlying problem space is already mapped. Fan-out / fan-in is map-reduce. The orchestrator is a mutex with reasoning capability. The context window is a thread stack. The shared knowledge store is heap memory. The names are different. The problems are identical.</p><p>The proposed architecture in this article applies the concurrency primitive toolkit, message queues, atomic claims, event buses, completion signals, barriers, context propagation, to the specific constraints of LLM-based agents. The implementation details differ from classical concurrency because the substrate differs: agents are stochastic where threads are deterministic, context windows are soft where stacks are hard, and verification is judgmental where test suites are binary. But the structural solutions transfer directly.</p><p>What needs to be built next is the infrastructure layer that makes these primitives first-class in agent frameworks. Today, practitioners implement claim protocols, schema validation, event buses, and barriers manually, in application code, for each new system. A mature agent coordination layer would provide these as composable primitives, the way threading libraries provide mutexes and barriers, and messaging systems provide queues and dead letter handling.</p><p>The field of concurrent programming took roughly two decades to develop from raw threads to robust, well-understood concurrency patterns. Agent coordination is at the raw threads stage. The primitives described here are the beginning of the pattern library that the next two years will need to produce.</p><p>The theory already exists. It has been sitting in operating systems textbooks for sixty years. The task is translation, implementation, and adaptation to a substrate that the original authors of those textbooks could never have anticipated.</p><p>The coordination problem is old. The agents are new. Build accordingly.</p><p>For part 2 on implementation, Check the link <a href="https://medium.com/p/d98a1bc8d5ba">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=079c5340f759" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recency Is a False Signal. Stop Using It Like a Real One.]]></title>
            <link>https://medium.com/@yashash.gc/recency-is-a-false-signal-stop-using-it-like-a-real-one-b77dbebd7198?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b77dbebd7198</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[recency-bias]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Thu, 30 Apr 2026 22:58:44 GMT</pubDate>
            <atom:updated>2026-04-30T22:58:44.844Z</atom:updated>
            <content:encoded><![CDATA[<p>Every RAG pipeline you have ever seen ranks by recency somewhere. Every agent memory system defaults to it. Every AI assistant that maintains conversation history treats newer turns as implicitly more relevant than older ones. It is so common that it barely registers as a design decision anymore. It is just how things are built.</p><p>It is also wrong. Wrong as a principle. Wrong in every case. Wrong applied to any AI retrieval system where the goal is finding the most useful information for a user query.</p><p>Recency tells you when something was created. It tells you zero about whether it answers the question. Those two things are unrelated, and conflating them is one of the most widespread and least examined mistakes in how AI systems retrieve information today.</p><h3>The Argument in One Sentence</h3><p>A piece of information is useful because it is semantically relevant to what the user needs, and any retrieval system that weights time alongside meaning has introduced noise into a signal that should be clean.</p><h3>Why Engineers Keep Reaching for Recency</h3><p>The habit is understandable even if the outcome is wrong.</p><p>Recency is cheap to compute. Every document has a timestamp. Sorting or boosting by time requires no model, no embedding, no inference. It is a single field comparison. When you are building a retrieval system under pressure and you need some way to break ties or filter a candidate set, timestamp is right there, easy and free.</p><p>Recency also feels safe. There is an intuition that newer information is more correct. In domains like news or inventory this is true. Engineers who built systems in those domains carry the intuition into AI retrieval work without examining whether it transfers. It does.</p><p>The deepest reason recency persists is that semantic retrieval used to be hard. Before dense embeddings were cheap and fast, approximate keyword matching was the practical ceiling for most teams. Recency was a useful tiebreaker in a world where two keyword matched documents were hard to distinguish. The embedding revolution changed that. You can now measure semantic similarity directly and cheaply. The tiebreaker became obsolete, but the habit of reaching for it survived the transition.</p><h3>What Recency Actually Measures</h3><p>When you rank by recency you are measuring one thing: how much time has passed since a document was created or modified.</p><p>Ask yourself what that measures about relevance to a user query. The answer is zero. A question about distributed consensus gets no better answer from a document written last month than from a document written in 2014. A user asking an AI assistant about a decision they made six months ago is better served by the turn where that decision was actually discussed than by the most recent conversation turn. A RAG pipeline retrieving context for a code generation task gains zero from surfacing the most recently edited file over the file that is semantically closest to what the model needs.</p><p>In every one of these cases, recency adds noise. It takes a retrieval problem that has a correct answer, which is “find the thing that best matches what the user needs,” and introduces a second axis that is orthogonal to correctness. The system now has to satisfy two objectives simultaneously. One of them is the right objective. The other is arbitrary. The result is a retrieval system that is measurably worse at its actual job.</p><h3>The Damage This Does in Practice</h3><p>The failure modes from recency biased retrieval are consistent across system types.</p><p>In RAG pipelines, the most common failure is retrieving context that is temporally proximate to the query but semantically distant from it. A user asks a question about authentication logic. The pipeline retrieves the three most recently modified files in the codebase. Two of them touched authentication in passing while implementing something else. One of them is the core authentication module, but it was last modified eight months ago, so it ranks lower. The model generates an answer with partial context and either hallucinates the gap or produces something subtly wrong. The engineer debugging the failure blames the model. The actual problem is the retrieval layer.</p><p>In agent memory systems, recency bias means that the memories an agent treats as most relevant are the ones formed most recently rather than the ones most germane to the current task. An agent working on a long project accumulates context over weeks. When it needs to make a decision that echoes something established in week one, that early context has been deprioritized by time. The agent reasons from an incomplete picture of its own history because the retrieval layer decided that older equals less important.</p><p>In AI assistants with conversation memory, the failure shows up as a kind of artificial amnesia. The assistant surfaces recent exchanges as the most relevant context for a current query, even when the current query is directly about something discussed much earlier. The user has to explain again things the system already knows because the retrieval layer buried the relevant history under newer but less relevant turns.</p><h3>Semantics Is the Replacement, Full Stop</h3><p>The framing that most retrieval systems use is additive: semantic similarity is the base signal, recency is a boost or a filter applied on top. This framing is wrong because it treats recency as a corrective on semantics, as if semantic similarity is a good starting point but needs adjustment toward newness to be trustworthy.</p><p>Flip the model. Semantic similarity is the complete signal for retrieval relevance. It already captures everything about whether a document is useful for a query. Adding recency corrupts the semantic signal by introducing a second ranking criterion that measures something irrelevant.</p><p>The right architecture is retrieve by semantic similarity, full stop. If a downstream process needs to understand the temporal relationship between documents, that is a separate concern handled after retrieval rather than a factor in retrieval itself. The question “what is most relevant to this query” and the question “what is most recent” have different answers and should be computed independently. Mixing them in the retrieval layer produces a system that answers neither question correctly.</p><h3>The Staleness Objection Does Not Hold</h3><p>The most common pushback against removing recency from retrieval is staleness. The argument goes: semantic similarity will surface a document that was accurate two years ago but is now wrong. Recency keeps the retrieval layer honest by preferring documents that reflect the current state of the world.</p><p>This argument proves too much. If staleness is the concern, the solution is to remove stale documents from the index rather than use recency as a proxy for accuracy. Recency fails to detect staleness. A document updated yesterday with minor formatting changes can still contain wrong information. A document from five years ago can be perfectly accurate today because the underlying facts have changed zero percent. Timestamp tells you neither of these things.</p><p>If your retrieval system needs to handle documents that may become outdated, the engineering answer is explicit validity management: mark documents as stale when their content is superseded, remove or deprecate them, and keep the index clean. Using recency as a heuristic for “probably still accurate” is a workaround for a data quality problem, and it introduces retrieval errors in exchange for avoiding index maintenance. That is a bad trade.</p><h3>What Good Retrieval Looks Like</h3><p>A retrieval system built on semantic primacy has a simple architecture. Documents are embedded at index time. Queries are embedded at retrieval time. The system returns the documents whose embeddings are closest to the query embedding by whatever distance metric fits the use case. That is the complete retrieval logic.</p><p>Metadata like timestamps, authors, and document types belongs to a filtering layer that operates on a narrowed candidate set after semantic retrieval, or to a reranking layer that adjusts ordering based on explicit user preferences. If a user specifies they want recent documents, recency becomes a filter applied to semantically relevant results. It is a user expressed constraint rather than a system default. The difference matters: one treats recency as something users sometimes want, the other treats it as something retrieval systems always need.</p><p>Retrieval architectures that combine dense semantic search with sparse keyword matching are a genuine improvement for certain query types, particularly queries with specific technical terms, proper nouns, or identifiers that embedding models sometimes blur together. Adding keyword signals to semantic retrieval is adding precision. Adding recency is adding noise. Those are two very different things.</p><h3>The Principle Behind the Principle</h3><p>The deeper problem with recency as a default is what it reveals about how retrieval systems get designed. Engineers inherit signals from adjacent domains, apply them without examining whether they transfer, and build systems that optimize for something other than what users actually need.</p><p>Users need the most useful information for their query. That is a semantic property. It has zero to do with time. The moment you accept that, recency falls out of the retrieval layer entirely, because it was never measuring the right thing to begin with.</p><p>Build retrieval systems that answer the question users are asking. That question is always about meaning. It is never about when.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b77dbebd7198" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Language of AI Prompts: Why ‘Build Context’ and ‘Build Mental Model’ Give You Radically…]]></title>
            <link>https://medium.com/@yashash.gc/the-hidden-language-of-ai-prompts-why-build-context-and-build-mental-model-give-you-radically-9871bba0ccd3?source=rss-c72efeb7172d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9871bba0ccd3</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[context-engineering]]></category>
            <category><![CDATA[mental-models]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[CocoNinja]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 04:27:53 GMT</pubDate>
            <atom:updated>2026-02-18T04:27:53.862Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Hidden Language of AI Prompts: Why ‘Build Context’ and ‘Build Mental Model’ Give You Radically Different Results</h3><p><em>Most people use AI like a search engine. Power users use it like a cognitive toolkit.</em></p><p>I stumbled onto something fascinating while working with Claude on my novel. I asked the AI to “build a mental model” of my protagonist’s character arc, and got a completely different — and far more useful — response than when I asked it to “build context” about the same character.</p><p>This led me down a rabbit hole: <em>What if the words we use to frame our questions fundamentally change how AI responds?</em></p><p>Turns out, they do. And most people have no idea this even exists.</p><p><strong>The Experiment: Same Question, Different Framing</strong></p><p>I asked Claude two different questions:</p><p>1. “Build context about character A arc”</p><p>2. “Build a mental model about Character A arc”</p><p>The responses were curiously different</p><p>What I Got: Information vs. Understanding</p><p>When I asked for context, Claude gave me:</p><ul><li>A detailed timeline of events</li><li>Background on key players and relationships</li><li>Setting and cultural landscape</li><li>Facts about what happened when</li></ul><p>It was comprehensive, informational, and <em>descriptive</em>. Perfect if I needed to remember what happened or explain it to someone else.</p><p>When I asked for a mental model, Claude gave me:</p><ul><li>The underlying pattern of the character’s transformation</li><li>Key variables to track (agency, public perception, ideology)</li><li>Cause-and-effect mechanisms driving his decisions</li><li>Predictions about where the arc is heading</li><li>A framework I could use to write future chapters</li></ul><p>It was analytical, <em>explanatory</em>, and gave me tools to <em>reason independently</em> about my character.</p><p><strong>The Key Difference</strong></p><p>Context answers: “What do I need to know?”</p><p>Mental Model answers: “How do I think about this?”</p><p>Context gives <strong>you a <em>map</em></strong>. Mental model teaches you <strong><em>how to navigate</em>.</strong>With context, you can repeat information.With a mental model, you can apply it yourself to new situations.</p><p><strong>Beyond These Two: A Whole Vocabulary Exists</strong></p><p>Once I understood this distinction, I started experimenting with other framing words. It turns out there’s an entire vocabulary of cognitive lenses you can use with AI — and most people have never tried them.</p><p>For coding, you might use:</p><p><strong>• Architecture</strong> — How components fit together in a system</p><p><strong>• Mechanics</strong> — Step-by-step cause-and-effect operations</p><p><strong>• Schema</strong> — Data structure and relationships</p><p><strong>• Invariants</strong> — What must always be true for correctness</p><p>For writing or analysis, you might use:</p><p><strong>• Dynamics</strong> — Forces and tensions in motion</p><p><strong>• Arc </strong>— Trajectory of transformation</p><p><strong>• Stakes </strong>— What can be won or lost</p><p><strong>• Tension </strong>— Competing forces creating pressure</p><p>Each word activates a different mode of thinking in the AI and produces subtle but different outputs. The Coding Example That Made It Click. Let’s say you’re trying to understand React’s useState hook. Here’s how different framings produce different results:</p><p>Generic prompt: “Explain how React’s useState works”</p><p>You get: A middling explanation covering everything surface-level. “useState is a Hook that lets you add state to functional components. You call it with an initial value…”</p><p>Specific prompt: “Build the mechanics of how React’s useState works”</p><p>You get: A step-by-step breakdown of the internal mechanism — how React stores state in fiber nodes, how the setter queues updates, why order matters, how closures capture values. The kind of deep understanding that helps you debug weird behavior.</p><p><strong>Why Most People Don’t Know This Exists</strong></p><p>There are a few reasons this isn’t common knowledge:</p><p>1. People treat AI like Google. They describe what they want and hope for the best. They don’t realize AI is a cognitive tool that responds to how precisely you frame requests.</p><p>2. They don’t know what kind of confused they are. When stuck, people know they’re confused but not whether they’re missing context, lacking a mental model, not understanding the mechanics, or unclear on the architecture. So they ask generic questions.</p><p>3. Generic prompts seem “good enough.” You get an answer. It might not be the right kind of answer, but it’s something. Most people don’t know they’re leaving 80% of the value on the table.</p><p>4. Lack of vocabulary. Most people don’t have the meta-cognitive vocabulary to distinguish between “I need the mechanics” vs. “I need the architecture” vs. “I need a mental model.”</p><p>The 5% Who’ve Figured It Out</p><p>There’s a small group of power users who’ve discovered this on their own:</p><p>Researchers ask for “phenomenological analyses” and “theoretical frameworks.”</p><p>Advanced developers request “the evaluation model of lazy evaluation” or “invariants of this data structure.”</p><p>Strategic thinkers ask about “game theory” and “causal models” and “second-order effects.”</p><p>But this is less than 5% of users. Everyone else is using AI with default settings.</p><p><strong>What You Can Do With This</strong></p><p>Think of these framing words as command-line flags for AI:</p><p>• Most people use: <em>[default settings]</em></p><p>• You can use: <em>— depth=high — focus=mechanics — output=architecture</em></p><p>Next time you’re using AI:</p><p>1. Ask yourself what kind of understanding you actually need. Are you gathering information? Building a working understanding? Drilling into a specific dimension?</p><p>2. Use precise framing. Instead of “explain X,” try “build a mental model of X” or “what are the mechanics of X” or “what’s the architecture of X.”</p><p>3. Experiment. Try asking the same question with different framings. You’ll be shocked at how different the responses are.</p><p>4. Use words from another language like Portuguese, German, Hindi or Japanese and you will find the responses are wildly different.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9871bba0ccd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>