Skip to main content
Multi-Agent System Adfluence Hub

Replacing consulting hours with multi-agent strategic simulation

A collaborative workspace where AI personas with distinct roles debate, stress-test, and refine business strategy — live, in real time, over WebSockets.

Real-time WebSocket updates
Async Celery + Redis pipeline
N Configurable agent roles
Full Performance audit trail

The Challenge

Strategic planning is inherently multi-perspective. A growth initiative that looks compelling to a sales strategist might expose blind spots visible only to a risk assessor. Surfacing those tensions requires bringing diverse expert viewpoints into the same room — which traditionally means expensive consultant engagements, lengthy workshops, and weeks of synthesis.

Adfluence Hub needed to accelerate this process for their clients. The goal: structured strategic simulations that capture the tension between multiple expert perspectives, in minutes rather than months.

"The insight wasn't to automate strategy — it was to automate the conversation between strategic perspectives. The friction between a creative agent and a compliance agent is where the real insight lives."

The Solution

The Agentic Ideation Sandbox is a full-stack collaborative workspace where teams assemble AI agents — each with a defined role, specialisation, and personality — and set them running on a strategic objective. The agents conduct multi-turn conversations through Gemini, challenging each other's proposals, surfacing risks, and building on creative ideas.

The entire simulation runs asynchronously via Celery, with real-time progress streamed to all connected clients through a Redis Pub/Sub → WebSocket relay. Multiple team members can watch a simulation unfold simultaneously, comment, and compare results across scenarios.

How It Works

1
Workspace Creation

A team defines the workspace objective, domain, and success criteria. This context seeds every agent's reasoning.

2
Agent Assembly

Team members configure agents — assigning roles (market analyst, risk assessor, creative strategist), specialisations, and personality traits that shape how each agent reasons and responds.

3
Simulation Launch

The FastAPI backend enqueues a run_simulation_task to Celery. The HTTP response returns immediately — the simulation runs entirely in the background.

4
Multi-Turn Agent Conversation

The Celery worker loads the workspace and agents from PostgreSQL, generates persona-specific prompts, and runs a multi-turn Gemini conversation between agents. Each turn is shaped by the agent's personality and the previous exchange.

5
Real-Time Relay

As each agent responds, the worker publishes to a Redis channel (workspace:{id}:notifications). A background listener in FastAPI picks up these events and relays them to connected WebSocket clients — zero polling, zero tight coupling.

6
Results & Scoring

Simulation results are persisted to PostgreSQL. Each agent's contributions are scored and logged in a PerformanceRecord table, creating an auditable record of which perspectives drove the outcome.

Technical Highlights

Redis Pub/Sub Decoupling

Celery workers and WebSocket clients never communicate directly. Workers publish events to a Redis channel; FastAPI's async listener relays them to the correct workspace subscribers. Adding more workers or more clients requires no architectural change.

JSON Repair for LLM Outputs

LLMs occasionally produce malformed JSON — a missing bracket, a trailing comma. Rather than crashing the simulation, the json-repair library recovers the structure gracefully, keeping the multi-turn conversation intact.

Async Session Management

Each Celery task creates its own SQLAlchemy async session, isolated from the request-handling sessions in FastAPI. This prevents session conflicts when multiple simulations run concurrently across workers.

Performance Audit Trail

Every agent's contribution is scored and stored in a PerformanceRecord table linked to the simulation. Teams can compare which agent configurations led to higher-quality strategic outputs over time.

The Stack

FastAPI Celery Redis WebSockets PostgreSQL SQLAlchemy (async) Google Gemini React Vite Tailwind CSS python-jose (JWT) json-repair

Outcomes

  • Strategic simulations that previously required multi-day consultant workshops now run in minutes, with configurable depth and agent count.
  • Teams can run multiple competing scenarios in parallel, comparing strategic outputs across different agent compositions.
  • The persistent performance audit trail enables longitudinal analysis — tracking which strategic approaches held up over time versus which collapsed under scrutiny.
  • The decoupled architecture (Celery + Redis + WebSockets) scales to concurrent simulations without client-side changes.

Have a complex agentic system to build?

I design multi-agent architectures that work in production — not just in demos.