@rshah88/antibody

5
4
flwr new @rshah88/antibody

Antibody: an immune system for buildings

Antibody is a swarm of 11 specialist agents and one coordinator. Each specialist watches one way a building fails; the coordinator ranks every problem, looks up the governing safety standard with web_search, and writes an alert that says what is wrong, who to call, the fix and the deadline.

AgentWatchesAgentWatches
PWRUPS battery bankHVACRooftop chiller
ELECMain switchgearH2OPipe leaks
WIREWall wiringENVFacade
FIRESprinkler riserAIRAir quality
STRStructural columnCYBERBuilding control system (BMS)
LIFTElevator

Demo data. Sensor readings are simulated for a demo tower modelled on Stanford's Hoover Tower (agent/building_data.py). The agents' reasoning, ranking, web searches and alerts are real.

Try it in Flower chat

Select Antibody in the agent picker and send:

Check the building.

About two to three minutes later you get the building health out of 100, all 11 areas ranked, and the top three alerts with cited standards (for example NFPA 855 for battery rooms, NIST SP 800-82 for building-control security).

Follow-ups use the same run series, so Antibody reports the trend:

The leak got worse. {"H2O": {"night_flow_lpm_building_empty": 14}}
Patch the BMS. {"CYBER": {"default_admin_password": false, "open_ports_to_internet": [], "failed_logins_24h": 0}}
Check the building, then keep watching it: scan every 10 minutes for the next 24 hours.

Pasting JSON overrides any reading for that scan. The last prompt schedules recurring scans with start_automation.

How a scan works

  1. Sense. The 11 specialists assess their own system in parallel and each return a JSON report: risk 0–1, confidence, finding, evidence, time to failure, fix.
  2. Rank. Plain code scores risk × consequence × urgency and computes building health, so the ranking is auditable.
  3. Investigate. The coordinator runs up to three web_search calls in parallel for the top problems. If you bind Slack, Notion or GitHub to the run, it also searches them for tenant reports, open work orders or BMS configuration. Unbound account connectors are never offered.
  4. Alert. The alert streams back with its sources.
  5. Remember. Health history and the last exchange are kept in run-series state (context.state).

Flower features used

FeatureUse
AgentApp, parallel specialist calls on the Flower Runtime modelThe swarm
web_search connectorCites the governing standard for each top problem
slack, notion, github connectors (when bound)Human evidence and open work orders
start_automationRound-the-clock watch on request
Run-series stateHealth trend and follow-up memory
Structured run events (antibody.*)Drive a live web console: 3D building, agent cards, health gauge, sources

Files

FileWhat it holds
agent/agent_app.pyThe scan flow: sense, rank, investigate, alert, remember
agent/specialists.pyOne job description and consequence weight per agent. Add an entry to add a building system
agent/building_data.pyThe demo building and its simulated sensor snapshot

Run from source

uv sync
uv run flwr build
uv run flwr login supergrid
uv run flwr chat        # then: /load .   and   Check the building.

To run fully on premises with a local model, start a local SuperLink with FLWR_MODEL_API_ENDPOINT pointing at an Open Responses endpoint (for example Ollama) and set ANTIBODY_MODEL to that model's name.