@kariminem/swarm-sar-commander
flwr new @kariminem/swarm-sar-commanderSAR Commander — human-approved rescue dispatch
The decision half of a multi-agency search-and-rescue swarm. It reads the result of a federated survivor-detection run and drafts one rescue dispatch recommendation for a human Incident Commander to approve, reject, or send back for revision.
It dispatches nothing. That is the point.
What it receives
The companion federated learning app (kariminem/dronesar-fl) trains a survivor-detection model across five SAR drones, each operated by a different agency over different terrain, with no agency sharing raw thermal footage. It hands this AgentApp a JSON summary via agent.input:
{ "federated_accuracy_pct": 92.1, "local_only_accuracy_pct": 60.0, "improvement_pts": 32.1, "rounds": 25, "agencies": ["Park Service", "Coast Guard", "..."], "detections": [ {"drone": 1, "agency": "Coast Guard", "x": -12.1, "y": 34.9, "survivor": true, "confidence": 0.999} ] }
What it produces
A single structured recommendation:
{ "severity": "high", "recommended_action": "...", "rationale": "...", "confidence": "high", "priority_targets": [{"x": -12.1, "y": 34.9, "agency": "Coast Guard", "why": "..."}], "deprioritised": [{"x": 43.3, "y": 27.8, "why": "..."}] }
It is explicitly instructed to calibrate its own confidence against the gap between the federated and go-it-alone accuracy, to name detections it believes are false positives worth de-prioritising, and to state plainly when the model is not reliable enough to prioritise on. In practice it also tends to flag cross-sector corroboration — two agencies independently reporting near the same coordinates — which is exactly the reasoning a human commander would want surfaced.
The human gate
In the full demo the orchestrator blocks on a real asyncio.Future after this app returns. Nothing is written, and no dispatch record exists, until a person clicks Approve. Reject or "request changes" re-runs only this app with the reviewer's feedback appended to its input, leaving the federated model untouched.
That separation is deliberate: the expensive, evidence-producing step (federated training) runs once; the cheap, contestable step (the recommendation) is the one a human can send back as many times as they like.
Run it
uv sync uv run flwr login supergrid uv run flwr run . supergrid --stream
Run standalone with the default input and it will simply report that it has nothing to work with — it expects the JSON shape above. See the open-source repo this was published from for the orchestrator, the federated learning app, and the live 3D mission view that drives it.