<?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: Alex</title>
    <description>The latest articles on DEV Community by Alex (@dugubuyan).</description>
    <link>https://dev.to/dugubuyan</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%2F3962450%2F2dfe9e24-57c5-4541-88dd-448a77b21055.png</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/dugubuyan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dugubuyan"/>
    <language>en</language>
    <item>
      <title>Why I Stopped Organizing AI Agents by Role (and Built a Document Exchange Center Instead)</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Mon, 01 Jun 2026 09:46:12 +0000</pubDate>
      <link>https://dev.to/dugubuyan/why-i-stopped-organizing-ai-agents-by-role-and-built-a-document-exchange-center-instead-1765</link>
      <guid>https://dev.to/dugubuyan/why-i-stopped-organizing-ai-agents-by-role-and-built-a-document-exchange-center-instead-1765</guid>
      <description>&lt;p&gt;Most multi-agent frameworks for software development organize agents around &lt;em&gt;roles&lt;/em&gt;: a product manager agent, a developer agent, a tester agent. ChatDev and MetaGPT pioneered this approach, and it works well for monolithic tasks.&lt;/p&gt;

&lt;p&gt;But I ran into a wall when I tried to apply it to a real system with multiple independently-deployed services.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem with Role-Based Coordination
&lt;/h2&gt;

&lt;p&gt;Imagine you have a backend search service and a frontend management console. The backend team implements a new API endpoint. The frontend needs to adapt.&lt;/p&gt;

&lt;p&gt;In a role-based framework, there's no natural mechanism for this. Both agents are "developers" in the same simulated organization. There's no concept of service boundaries, no versioned contracts, no way to say "the backend changed, and the frontend needs to know exactly what changed."&lt;/p&gt;

&lt;p&gt;The coordination problem in multi-service development isn't &lt;em&gt;"which role should handle this task"&lt;/em&gt; — it's &lt;em&gt;"which service needs to know about this change, and what exactly changed."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That reframing led me to build something different.&lt;/p&gt;

&lt;h2&gt;
  
  
  AgentNexus: Coordinating Agents at the Service Granularity
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/dugubuyan/agent-nexus" rel="noopener noreferrer"&gt;AgentNexus&lt;/a&gt; is a document exchange center that treats each service as a first-class citizen. Instead of roles, it uses &lt;strong&gt;service boundaries&lt;/strong&gt; as the coordination primitive.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each service registers as a &lt;strong&gt;sub-project&lt;/strong&gt; with its own document namespace&lt;/li&gt;
&lt;li&gt;Services publish versioned Markdown documents: requirements, design specs, API docs, config&lt;/li&gt;
&lt;li&gt;Services &lt;strong&gt;subscribe&lt;/strong&gt; to documents from other services they depend on&lt;/li&gt;
&lt;li&gt;When a subscribed document changes, the subscriber receives a &lt;strong&gt;diff-aware notification&lt;/strong&gt; containing both the structured diff and the full latest content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The whole thing is exposed as an MCP (Model Context Protocol) server running in streamable-HTTP mode, so multiple agents can connect simultaneously from different machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Diff-Aware Update Protocol
&lt;/h2&gt;

&lt;p&gt;This is the part I'm most proud of. When an agent calls &lt;code&gt;get_my_updates_with_context&lt;/code&gt;, it gets back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"update_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"doc_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"backend-service/api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"doc_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"new_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"diff"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@@ -42,6 +42,12 @@&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;+## PUT /admin/docs/{doc_id}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;+&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;+Update a document in-place..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"latest_content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"# API Spec&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s2"&gt;..."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent gets both &lt;em&gt;what changed&lt;/em&gt; (to perform targeted modifications) and &lt;em&gt;the full current state&lt;/em&gt; (to maintain correct context). Providing only the diff risks missing context; providing only the full document makes it hard to identify what needs to change in the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Concrete Example
&lt;/h2&gt;

&lt;p&gt;Here's the end-to-end flow when the backend implements a new endpoint:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Backend agent updates &lt;code&gt;search-service/api&lt;/code&gt; via &lt;code&gt;push_document&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;AgentNexus computes the diff and generates a notification for &lt;code&gt;search-admin-frontend&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Frontend agent calls &lt;code&gt;get_my_updates_with_context&lt;/code&gt;, receives the diff showing the new endpoint&lt;/li&gt;
&lt;li&gt;Frontend agent removes the mock implementation and integrates the real endpoint&lt;/li&gt;
&lt;li&gt;Frontend agent updates its own &lt;code&gt;requirement&lt;/code&gt; document to remove the "backend not yet implemented" annotation&lt;/li&gt;
&lt;li&gt;Frontend agent calls &lt;code&gt;ack_update&lt;/code&gt; to mark the notification as read&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;No human coordination required beyond the initial subscription configuration.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Lifecycle Stage as a First-Class Entity
&lt;/h2&gt;

&lt;p&gt;One more thing that bothered me about role-playing frameworks: they have no concept of where a service &lt;em&gt;is&lt;/em&gt; in its development lifecycle.&lt;/p&gt;

&lt;p&gt;AgentNexus tracks each service's stage explicitly: &lt;code&gt;design → development → testing → deployment → upgrade&lt;/code&gt;. Stage transitions are real operations that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create immutable milestone snapshots of all published documents&lt;/li&gt;
&lt;li&gt;Generate cross-service notifications&lt;/li&gt;
&lt;li&gt;Produce stage-switch tasks for affected services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a service transitions from development to testing, that's a meaningful event — not just a prompt instruction to an agent playing the role of "scrum master."&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;The implementation is in Python using FastMCP, SQLAlchemy/SQLite, and watchdog. It runs as a persistent MCP server at &lt;code&gt;http://0.0.0.0:10086/mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Key MCP tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;push_document&lt;/code&gt; / &lt;code&gt;patch_document&lt;/code&gt; — publish full or incremental updates&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_my_updates_with_context&lt;/code&gt; — one-call update check with diff + full content&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;add_subscription&lt;/code&gt; — subscribe by exact doc ID or doc type&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_my_tasks&lt;/code&gt; — retrieve pending tasks generated by document changes&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;generate_steering_file&lt;/code&gt; — generate IDE agent instruction files automatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;patch_document&lt;/code&gt; tool is worth calling out: instead of sending the full document content on every update, agents can send a unified diff patch. This avoids hitting tool-call payload size limits in IDEs like Kiro or Cursor when documents get large.&lt;/p&gt;

&lt;p&gt;250 tests (unit + property-based with Hypothesis). The system has been running in production coordinating two services for over a month.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison with Role-Centric Frameworks
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;ChatDev / MetaGPT&lt;/th&gt;
&lt;th&gt;AgentNexus&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Coordination unit&lt;/td&gt;
&lt;td&gt;Agent role&lt;/td&gt;
&lt;td&gt;Service (sub-project)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lifecycle tracking&lt;/td&gt;
&lt;td&gt;Implicit in workflow&lt;/td&gt;
&lt;td&gt;Explicit stage per service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change propagation&lt;/td&gt;
&lt;td&gt;Shared context&lt;/td&gt;
&lt;td&gt;Pub-sub with versioned diff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service boundaries&lt;/td&gt;
&lt;td&gt;Not enforced&lt;/td&gt;
&lt;td&gt;First-class namespace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-codebase&lt;/td&gt;
&lt;td&gt;Single codebase assumed&lt;/td&gt;
&lt;td&gt;Native multi-repo&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/dugubuyan/agent-nexus
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;".[dev]"&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; alembic upgrade &lt;span class="nb"&gt;head
&lt;/span&gt;python src/main.py
&lt;span class="c"&gt;# MCP server running at http://0.0.0.0:10086/mcp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Connect from any MCP client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"doc-exchange"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://localhost:10086/mcp"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The accompanying research paper is on Zenodo: &lt;a href="https://doi.org/10.5281/zenodo.19692217" rel="noopener noreferrer"&gt;doi.org/10.5281/zenodo.19692217&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you're building multi-service systems with LLM agents and running into coordination problems, I'd love to hear what you're working on.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>multiagent</category>
      <category>python</category>
    </item>
  </channel>
</rss>
