<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amit Bhadoria</title>
    <description>The latest articles on DEV Community by Amit Bhadoria (@amit_bhadoria_9d67cd7ea32).</description>
    <link>https://dev.to/amit_bhadoria_9d67cd7ea32</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3669552%2F48d5b63e-bfd1-48ef-a521-22d52185333e.jpg</url>
      <title>DEV Community: Amit Bhadoria</title>
      <link>https://dev.to/amit_bhadoria_9d67cd7ea32</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amit_bhadoria_9d67cd7ea32"/>
    <language>en</language>
    <item>
      <title>It's Time to DisCo: The Case for Distributed Cognition in AI Agents.</title>
      <dc:creator>Amit Bhadoria</dc:creator>
      <pubDate>Thu, 18 Dec 2025 20:01:23 +0000</pubDate>
      <link>https://dev.to/amit_bhadoria_9d67cd7ea32/its-time-to-disco-the-case-for-distributed-cognition-in-ai-agents-1999</link>
      <guid>https://dev.to/amit_bhadoria_9d67cd7ea32/its-time-to-disco-the-case-for-distributed-cognition-in-ai-agents-1999</guid>
      <description>&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; Why we need to move beyond single-threaded loops and embrace event-driven cognitive architectures.&lt;/p&gt;




&lt;h3&gt;
  
  
  The "Single Loop" Trap
&lt;/h3&gt;

&lt;p&gt;If you have built an AI agent in the last 18 months, your code probably looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;goal_achieved&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;observation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;thought&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;think&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;observation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;act&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;thought&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;step&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the &lt;strong&gt;ReAct Loop&lt;/strong&gt;. It is the foundation of Gen-1 agent frameworks like LangChain, AutoGen, and BabyAGI. It is brilliant for demos, simple to understand, and fundamentally unscalable for the enterprise.&lt;/p&gt;

&lt;p&gt;Why? Because it is &lt;strong&gt;single-threaded cognition&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you deploy this into production, you hit two walls:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Human-in-the-Loop (HITL) Problem&lt;/strong&gt;&lt;br&gt;
Real-world enterprise processes rarely finish in milliseconds. Consider a "Procurement Agent" that drafts a purchase order but requires approval from a human manager.&lt;br&gt;
In a single-threaded loop, the agent halts. It must spin and wait—potentially for hours or days—for that approval signal. If that script crashes or the server restarts while waiting, the context is lost. You cannot build a robust organization on software that has to "sleep" for three days.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The Framework Bloat Problem&lt;/strong&gt;&lt;br&gt;
We have spent the last year wrapping simple OpenAI API calls in increasingly complex "Agent Frameworks." But as many engineers are discovering, these frameworks often add more friction than value. You don't need a heavy, opinionated graph library just to call an LLM. Any competent engineer can write the logic to prompt GPT-4.&lt;/p&gt;

&lt;p&gt;The hard problem isn't &lt;strong&gt;how to prompt&lt;/strong&gt;. The hard problem is &lt;strong&gt;how to orchestrate&lt;/strong&gt; state, history, and communication across 50 different agents running in parallel.&lt;/p&gt;

&lt;p&gt;We are trying to build complex, asynchronous digital organizations using the synchronous architecture of a 1990s shell script.&lt;/p&gt;




&lt;h3&gt;
  
  
  Enter DisCo: Distributed Cognition
&lt;/h3&gt;

&lt;p&gt;We need a new architecture. One that mirrors how human organizations actually work. We call it &lt;strong&gt;DisCo (Distributed Cognition)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;DisCo is not a code framework; it is an architectural pattern. It decouples &lt;strong&gt;Cognition&lt;/strong&gt; (the thinking) from &lt;strong&gt;Control&lt;/strong&gt; (the flow).&lt;/p&gt;

&lt;p&gt;In a DisCo architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Agents are Services, not Scripts:&lt;/strong&gt; They are long-lived "Workers" that react to events, rather than ephemeral loops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Communication is Asynchronous:&lt;/strong&gt; Agents don't "call" each other; they publish &lt;strong&gt;Intent&lt;/strong&gt; ("I need this route optimized") and subscribe to &lt;strong&gt;Outcomes&lt;/strong&gt; ("Route optimized by Agent B").&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State is Durable:&lt;/strong&gt; The state of the system lives in a shared, persistent ledger (the &lt;strong&gt;State Tracker&lt;/strong&gt;), not in the Python memory of a single process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzo2c1z06ic8r9oxm95zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzo2c1z06ic8r9oxm95zc.png" alt="Figure 1: The DisCo Control Plane Architecture" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  The 4 Pillars of a DisCo Platform
&lt;/h3&gt;

&lt;p&gt;To build this, you need more than just an LLM. You need a &lt;strong&gt;Cognitive Control Plane&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. The Registry (Service Discovery)
&lt;/h4&gt;

&lt;p&gt;In a monolithic script, you hardcode your tools. In DisCo, agents dynamically discover capabilities. A Planner doesn't need to know &lt;em&gt;who&lt;/em&gt; will book the flight or where that code runs; it just queries the Registry for a worker with the &lt;code&gt;book_flight&lt;/code&gt; capability. This allows you to hot-swap models (e.g., upgrading a worker from GPT-4o to Claude 3.5 Sonnet) without rewriting your orchestration logic.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. The Event Service (Choreography over Orchestration)
&lt;/h4&gt;

&lt;p&gt;Orchestration is a conductor waving a baton (central bottleneck). Choreography is dancers reacting to the music (distributed scale).&lt;/p&gt;

&lt;p&gt;We use an &lt;strong&gt;Event Service&lt;/strong&gt; (a smart proxy) to abstract the underlying message bus. Whether you run &lt;strong&gt;NATS JetStream&lt;/strong&gt; locally for low latency, &lt;strong&gt;Google Pub/Sub&lt;/strong&gt; in the cloud, or &lt;strong&gt;Kafka&lt;/strong&gt; in the enterprise, your agents simply publish events. The Event Service handles the durability, fan-out, and protocol translation, ensuring thousands of agents can operate in parallel without a single point of failure.&lt;/p&gt;

&lt;h4&gt;
  
  
  3. The Tracker (Distributed State &amp;amp; HITL)
&lt;/h4&gt;

&lt;p&gt;When Agent A hands off a task to Agent B, who tracks the deadline? The Tracker is a specialized state machine that monitors the lifecycle of distributed goals.&lt;/p&gt;

&lt;p&gt;Crucially, this solves the &lt;strong&gt;Human-in-the-Loop&lt;/strong&gt; problem. An agent can emit an &lt;code&gt;ApprovalNeeded&lt;/code&gt; event and exit. The Tracker persists the state. Three days later, when a manager clicks "Approve" in a dashboard, the Tracker emits a &lt;code&gt;TaskApproved&lt;/code&gt; event, waking up the next worker in the chain. No blocking. No wasted compute.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. The Memory (Shared Context)
&lt;/h4&gt;

&lt;p&gt;Agents need more than just their own conversation history. They need &lt;strong&gt;Episodic Memory&lt;/strong&gt; (what happened yesterday across the fleet?) and &lt;strong&gt;Semantic Memory&lt;/strong&gt; (what is our policy on refunds?). DisCo treats memory as a managed service, accessible to any authorized agent in the mesh.&lt;/p&gt;




&lt;h3&gt;
  
  
  Soorma: The Reference Implementation
&lt;/h3&gt;

&lt;p&gt;This architecture sounds complex because distributed systems &lt;em&gt;are&lt;/em&gt; complex. But you shouldn't have to build the plumbing from scratch.&lt;/p&gt;

&lt;p&gt;That is why we are building &lt;strong&gt;Soorma&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Soorma is the open-source infrastructure for DisCo. We provide the control plane—the Gateway, Registry, Event Service, and Tracker—so you can focus on the logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Framework Agnostic&lt;/strong&gt;&lt;br&gt;
We believe you shouldn't be locked into a specific way of prompting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Want to use &lt;strong&gt;LangChain&lt;/strong&gt; or &lt;strong&gt;CrewAI&lt;/strong&gt; for your worker logic? Go ahead.&lt;/li&gt;
&lt;li&gt;Want to use raw &lt;strong&gt;OpenAI&lt;/strong&gt; client calls? Perfect.&lt;/li&gt;
&lt;li&gt;Want to use a &lt;strong&gt;Rule-Based&lt;/strong&gt; script for deterministic tasks? Even better.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You write the logic. Soorma handles the &lt;strong&gt;Connection&lt;/strong&gt;, the &lt;strong&gt;State&lt;/strong&gt;, and the &lt;strong&gt;Scale&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Future is Asynchronous
&lt;/h3&gt;

&lt;p&gt;The next generation of AI applications won't be chatbots. They will be &lt;strong&gt;Digital Organizations&lt;/strong&gt;. They will run in the background, continuously optimizing supply chains, refactoring code, and monitoring security.&lt;/p&gt;

&lt;p&gt;They won't run in a &lt;code&gt;while&lt;/code&gt; loop. They will &lt;strong&gt;DisCo&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Join the movement.&lt;/strong&gt;&lt;br&gt;
We are building the foundation in the open.&lt;br&gt;
&lt;strong&gt;Join the waitlist:&lt;/strong&gt; &lt;a href="https://soorma.ai" rel="noopener noreferrer"&gt;soorma.ai&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Star the repo:&lt;/strong&gt; &lt;a href="https://github.com/soorma-ai/soorma-core" rel="noopener noreferrer"&gt;github.com/soorma-ai/soorma-core&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
