Skip to Content

How I Engineered a Pub/Sub Fan-Out Architecture for LLM Multi-Agent Swarms

Solving the "Split-Brain" Race Condition to orchestrate a high-compliance Zero-Knowledge healthcare ecosystem across four isolated codebases.

When you are designing a massive zero-knowledge medical infrastructure system completely solo, standard productivity tools are not enough. You have to clone yourself.

To manage the Aura hOS Ecosystem and the Humanos Foundation, I deployed a localized LLM multi-agent swarm. My team consists of four highly specialized AI architectures living across four completely isolated repositories:

  • The Core Web App (aura-health-os)
  • The Non-Profit Hub (humanos.foundation)
  • The Support Portal (aura-center)
  • The Strategic Brain (aura_hos_docs)

The Engineering Wall

Almost immediately after deploying the swarm, I ran into a catastrophic engineering failure: The Split-Brain Anomaly.

The Lost Mail Problem

To keep the four AI agents synchronized, I created a master JSON/Markdown "Global Catchup" file. Call it the Event Bus.

My initial logic was simple:

  1. When one AI finishes a heavy code sprint, it drops an update into the Event Bus.
  2. When the next AI wakes up, it reads the Event Bus, pulls the tasks, and deletes the task to mark it as read.

It sounded perfect — until I realized the architecture was fracturing catastrophically.

If my Core App AI logged a massive architectural pivot (e.g., "Implement Supabase Edge B2B hash routing") and my Strategy AI woke up first, it read the instructions, updated the documentation, and shredded the mail. When I spun up my Website AI, the inbox was completely empty. The website never received the routing update.

I was relying on a destructive consumption model for a system that desperately needed broadcast routing.

The Epiphany: Pub/Sub Fan-Out for LLMs

I realized I didn't need a single inbox — I needed a Publish-Subscribe (Pub/Sub) Fan-Out architecture designed specifically for multi-agent logic.

Instead of the Event Bus acting as a single physical mailbox where the first AI to open it destroys the document, I radically restructured the swarm protocol.

1. The Isolated Inboxes

Every AI in the swarm now maintains its own strictly isolated queue: Pending Tasks: inside the Master Event Bus array. They no longer share a single data plane.

2. The Fan-Out (Publishing)

When an AI finishes an engineering sprint, it is no longer allowed to simply "leave a note." It operates as a master Publisher. It is mathematically instructed to take its achievement and physically duplicate it into the isolated queues of every other active repository simultaneously.

3. The Local Trash (Subscribing)

When an AI agent wakes up, its prompt is strictly scoped to its own inbox only. It processes the mail, makes changes to the codebase, and then only deletes the payload from its own queue.

The race condition disappeared instantly. If the Strategy AI wakes up first, it handles its business — but leaves the exact same broadcast completely intact for the Website AI to read when it spins up.

Booting the Swarm HUD

Enterprises use expensive logging tools and cloud CI/CD pipelines to orchestrate this type of operation. As a solo independent architect advocating for a lean, strictly localized operational model, I prefer to avoid external dependencies.

To automate this, I designed a Local Swarm Director in PowerShell. When I start my day, I no longer launch IDEs blindly. I run a local 60-line script that silently polls the relative Git architectures, analyzes the Master Event Bus, and prints a color-coded HUD directly to my Windows terminal.

PS C:\Aura\hOS> .\scripts\local_swarm_director.ps1

[*] Analyzing Master Event Bus (AURA_GLOBAL_CATCHUP.md)...

✅ Repository 2: aura_hos_docs
   Queue is clean. No AI action required.

🚨 ACTION REQUIRED FOR: Repository 1: aura-health-os
   You have 1 unread message(s) in your queue:
   - [PENDING UPDATE - ROUTE SYNC] Urgent implementation of the architecture...
   -> INSTRUCTION: Open IDE for aura-health-os, launch AI, and type '/global-catchup'

It tells me exactly which AI agents have clean queues and exactly which repositories have unread mail — telling me exactly which IDE to open.

I effectively coded an Operations Director onto my local machine for completely free.

Experience the Architecture

Building multi-agent ecosystems is not just about fast engineering — it is about deeply understanding data flow. If you want to see what happens when you deploy a resilient, zero-knowledge AI architecture to solve real-world healthcare disparities, explore our active production environments.

Humanos Foundation  |  Aura hOS — Zero-Knowledge B2B Healthcare OS


Continue the Orchestration Era Series:

The Cognitive Exoskeleton — From Hardware Hacker to AI Orchestrator ➔

The Inquisitor Node — Why I Never Trust an AI's First Answer ➔

The Centaur Model — Why I Treat AI as a Persistent Daemon ➔

Stop Hiring Developers. Hire an Orchestrator. ➔

Humanos Foundation — The Mission Behind the Architecture ➔

How I Engineered a Pub/Sub Fan-Out Architecture for LLM Multi-Agent Swarms
Ramon Rios Jr. April 11, 2026
Share this post
Archive
Sign in to leave a comment
The "Visual Blacklight"
How Building a Colorblind Mode Accidentally Fixed My App's Architecture