@kariminem/swarm-merger
flwr new @kariminem/swarm-mergerSwarm Mission Coordinator
The final step of Swarm, a multi-agent demo built on Flower Agent: a planner AgentApp splits a Search & Rescue coordination brief into 4 independent tasks, 4 worker AgentApps (console/intake/safety/scoring) build them concurrently, a human Incident Commander approves the safety worker's pre-dispatch verification logic before anything ships, and this merger AgentApp ("Mission Coordinator") assembles the four approved outputs into one coherent, runnable Mission Coordination mini-app.
The scenario: a plane has crashed in a remote region. Several partner organizations hold recon data they cannot pool with each other (a fire department's drone imagery, a telecom partner's regulated cell-signal data, a satellite/terrain feed, volunteer ground reports). Each only submits a small derived candidate-sighting report -- coordinates, source, notes -- never the raw sensor feed. A safety verification step (built by the safety worker, and the one a human reviews before this merger runs) checks every report against a defined search area and known hazard zones before it's even eligible for dispatch consideration. No sighting is ever auto-dispatched -- every accepted report comes back dispatch_authorized: false until a human Incident Commander says otherwise.
File assembly is deterministic -- the console's UI files pass through as-is, and the safety/scoring workers' functions are spliced into two marker comments in the intake worker's generated server.py -- so the final artifact never depends on a second round of model parsing succeeding on stage. The model is used once here, only to write a human-readable summary.
This AgentApp task runs on SuperGrid's Deployment Runtime (remote infrastructure), so it has no access to whatever machine submitted the run. It hands its assembled files back as {filename: content} in its result rather than writing to a local path -- the full swarm's orchestrator (planner, all 4 workers, this merger, and a live dashboard) lives in the open-source repo this app was published from.
Build
uv sync uv run flwr build
Run standalone
This app expects agent.input to be a JSON string shaped like:
{"feature": "...", "workers": {"console": {...}, "intake": {...}, "safety": {...}, "scoring": {...}}}
(the shape each worker in the full swarm repo returns). Running it alone with the default input will just echo back an (almost) empty assembly -- see the main repo to run the full pipeline.
uv run flwr login supergrid uv run flwr run . supergrid --stream
Learn more
See the Flower Agent documentation for AgentApp tutorials and guides.