Inspiration

Most software infrastructure today assumes humans are the primary operators. Current multi-agent solutions (like AutoGen or CrewAI) treat agents like humans in a group chat, passing massive, expensive context windows back and forth.

We realized that retrofitting human-centered chat software for agent workflows causes context overflow, token cost explosions, and a "telephone game" effect where information degrades. We wanted to build true AI-native infrastructure—a system designed from the ground up for how machines should talk to each other.

What it does

AgentMesh is a file-based, protocol-driven communication framework that enables heterogeneous AI coding agents (Claude, Codex, Gemini, Ollama) to collaborate on a shared codebase without shared memory or massive token overhead.

Instead of agents talking directly, each major LLM gets a "Mini Agent" (a lightweight sidecar process). These sidecars communicate by passing Minimum Viable Context (MVC). When an agent updates its code, its sidecar computes a minimal JSON diff and routes only those specific changes to the agents that depend on them.

How we built it

We built the infrastructure around a Three-File System (Context, Summary, and Input) to act as the universal interface for any agent.

  • The Message Bus: We wrote Python sidecars using the watchdog library to monitor local directories. When an LLM updates its state, deepdiff calculates the exact changes and drops a "sticky note" into the target agent's input.json queue.
  • The Smart Filing Cabinet: To manage memory within the 48-hour limit, we engineered "Context Folder Splitting." Instead of complex compression, if an agent's memory file exceeds 100KB, the system automatically splits it by domain (e.g., decisions_auth.json vs decisions_routes.json) and uses an _index.json manifest. Agents "lazy load" only the exact files they need.
  • The Visualizer: We built a React/Next.js "Mission Control" dashboard to visualize the JSON diffs flying between agents in real-time.

Challenges we ran into

  • State Drift & Schema Adherence: LLMs are prone to hallucinating or truncating JSON. Getting the major agents to reliably update their dictionary.json state to perfectly match their code output required strict system prompting.
  • The Pivot: Our original architecture called for zlib compression to handle large context blobs. We realized this was too CPU-heavy and complex for the hackathon timeline. Pivoting to the "Smart Filing Cabinet" approach (plain-text file splitting and lazy loading) saved the architecture and made debugging infinitely easier.
  • File I/O Race Conditions: Managing concurrent file reads/writes across multiple asynchronous agent processes required implementing atomic write-to-temp-then-rename patterns.

Accomplishments that we're proud of

We successfully decoupled the "thinking" (the LLMs) from the "communicating" (the sidecars). By proving out the event-driven diff system, we estimate AgentMesh reduces inter-agent token consumption by 60-80% compared to standard orchestrators, completely eliminating the cold-start problem.

What we learned

Files are the ultimate universal interface. By removing proprietary API wrappers and relying on standard OS file systems, you break vendor lock-in entirely. A local Ollama model can seamlessly collaborate with a cloud-based Gemini model just by reading and writing JSON files to a shared directory.

What's next for AgentMesh

  • Git Integration: Automatically committing dictionary state changes to a dedicated branch for full version history.
  • Automated Self-Healing: Adding a verification loop where the Mini Agent detects if an LLM's code output has drifted from its declared JSON dictionary, forcing the agent to reconcile the two.
  • VS Code Extension: Moving the visualizer directly into the IDE so developers can watch agent structures build natively alongside their code.

Built With

Share this project:

Updates