Agent Mesh is a high-performance, event-driven orchestration system designed to manage complex AI agent workflows at scale. Built with a focus on low-latency state synchronisation and horizontal scalability, it simulates a complete Software Development Lifecycle (SDLC) pipeline using specialised worker nodes.
Performance Benchmark: Capable of handling 750+ requests per second with <200ms end-to-end latency on standard hardware.
In a high-frequency system, updating the React state for every individual WebSocket message creates a
Instead of immediate state updates, Agent Mesh uses a Throttled Batching Engine. We collect all incoming signals in a non-reactive buffer (Ref) and flush them to the UI state using a fixed interval
Result: The UI only performs 10 "paints" per second regardless of throughput.
Visual Stability: This prevents "layout thrashing" where cards teleport across the screen faster than the human eye can track.
Generic monitoring often tracks "System Memory," which is noisy. Agent Mesh implements Process-Level Telemetry using gopsutil to track the Resident Set Size (RSS)—the actual portion of RAM held by the worker process in main memory.
We implement a proactive reclamation strategy. If a worker's RSS exceeds a defined threshold (
To prevent the "Lost Update" problem in a distributed environment, all task transitions (Pending RPOPLPUSH (or BLMOVE) patterns in Redis.
Idempotency: Each task has a unique UUID. If a worker picks up a task but crashes before completion, the Dead Letter Queue (DLQ) logic ensures the task is re-inserted into the mesh without creating a duplicate record.
Concurrency Control: We utilize Go’s sync.WaitGroup and context cancellation to ensure that during a system shutdown, workers finish their current task before exiting (Graceful Shutdown), preventing database corruption.
By setting our WebSocket flush interval to 100ms, we intentionally trade a small amount of "perceived latency" for a massive gain in system throughput.
| Metric | Without Batching | With Agent Mesh Batching |
|---|---|---|
| Max UI Events/Sec | ~60 (Browser Limit) | 750+ |
| Main Thread Idle % | <5% (Laggy) | ~85% (Smooth) |
| State Consistency | Fragile | Guaranteed |
The system follows a reactive, microservices-based pattern:
flowchart LR
Client([React Command Center]) <-->|WS / HTTP| Producer[Producer Service]
subgraph "Orchestration Layer"
Producer -->|Enqueue Task| Redis[(Redis Queue)]
Redis -->|Pub/Sub Events| Producer
end
subgraph "Execution Layer"
Worker[Go Worker Nodes] <-->|Pop Task| Redis
Worker -->|Persist State| DB[(PostgreSQL)]
Worker -->|Broadcast Health| Redis
end
The system models a realistic engineering workflow with specialized agent roles:
- 🟠 ARCHITECT (The Strategist): High-priority system design & planning.
- 🔵 DEVELOPER (The Builder): Code implementation & feature delivery.
- 🟢 QA ENGINEER (The Auditor): Testing, verification & quality assurance.
- Docker & Docker Compose
Start the entire infrastructure (Redis, Postgres, Producer, Worker, UI) with one command:
./run.ps1Access the dashboard at http://localhost:5173

Flood the system with 500 concurrent tasks to test the "High Traffic Mode" and throughput:
./stress.ps1Watch the "Pending Queue" explode and drain in seconds while the UI stays buttery smooth.
| Component | Technology | Role |
|---|---|---|
| Backend | Go (Golang) 1.23 | High-concurrency workers & API |
| Frontend | React + Vite | Real-time visualization |
| Styling | Tailwind CSS + Framer Motion | GPU-accelerated animations |
| Broker | Redis | Pub/Sub event bus & Task Queue |
| Database | PostgreSQL 16 | ACID-compliant state persistence |
| Metrics | gopsutil | Real-time CPU/RSS Memory tracking |
Designed & Engineered by YehiaGewily.