@andrewv/science-swarm

3
8
flwr new @andrewv/science-swarm

Science Swarm OS

Science Swarm OS is a human-guided adaptive organisation of AI scientists for Flower Agent. Give it a difficult scientific question and it invents the temporary specialist roles the problem needs, gathers a shared body of public evidence, runs those specialists independently, exposes their disagreement, and stops at a consequential decision so the human chooses where the organisation goes next.

We did not tell these scientists who should exist. There are zero predefined scientific roles. A small, fixed orchestration kernel creates problem-specific role contracts at runtime.

The browser experience is deliberately native to Flower Agent: each human message is one bounded SuperGrid run, and the conversation's Flower Context carries the selected branch, previous team, audit scorecard, and next decision options into the next run.

What makes it collaborative

One research cycle is real control flow, not a transcript pretending several characters talked:

scientific question or selected branch
              │
              ▼
organisation kernel invents temporary role contracts
              │
              ▼
Flower web_search / web_fetch build an evidence commons
              │
              ├──────────┬──────────┐
              ▼          ▼          ▼
       specialist 1  specialist 2  specialist 3
        model call     model call     model call
              └──────────┴──────────┘
                         │
                         ▼
         cited uncertainty map + Decision Gate
                         │
                         ▼
          human chooses 1 / 2 / 3 or redirects
                         │
                         ▼
              team reorganises next run

The specialist calls run independently and in parallel against the same evidence packet. The visible Flower response includes:

  • an exact cumulative scorecard of autonomous actions, roles created/retired, recovered failures, and human decisions;
  • temporary role passports and concise reasons for each organisation change;
  • specialist findings, challenges, confidence, and handoffs;
  • a Known / Contested / Missing evidence board;
  • a source ledger restricted to URLs actually returned by Flower connectors;
  • a concise audit timeline; and
  • three decision directions with benefit, downside, evidence, confidence, a recommendation, and room for dissent.

It does not reveal private model reasoning, manufacture disagreement, stage fake failures, or claim that a logical role is a separate published AgentApp.

Demo in Flower's browser UI

After adding @andrewv/science-swarm to a federation, open flower.ai/app, choose Science Swarm OS, and start a new chat.

Use the Hubble-tension demo for the clearest organisation change:

What is causing the Hubble tension: measurement systematics or new physics?

The first run researches the landscape and ends at a Decision Gate. Reply with 1, 2, or 3. The next run preserves the original question, follows that branch, and decides which capabilities should be retained, reassigned, retired, merged, split, or created.

You can also reply:

  • why — compare the saved trade-offs without spending another web-research cycle;
  • a written constraint such as Focus only on independent methods that do not use Cepheids — redirect and reorganise the swarm;
  • new: <question> — reset the investigation inside the same conversation; or
  • use New chat in Flower for an unrelated investigation.

For a stronger opening hook, try:

Has JWST found evidence of life on K2-18 b? Map the uncertainty before drawing a conclusion.

Set up with uv

Requirements:

  • Python 3.11 or newer
  • Flower Agent 1.35 access on SuperGrid
cd ~/projects/science-swarm
uv sync --extra dev
uv run pytest
uv run ruff check .
uv run flwr build

Flower injects the model endpoint and runtime credential when the AgentApp starts. Do not add an OpenAI key to this repository. The built-in web_search and web_fetch connectors do not need a separate account connection.

Sign in and run on SuperGrid

uv run flwr login supergrid
uv run flwr federation list supergrid

Andrew's authenticated account should list @andrewv/personal. Run the local project there:

uv run flwr run . supergrid \
  --federation @andrewv/personal \
  --stream

Override the first question from the CLI:

uv run flwr run . supergrid \
  --federation @andrewv/personal \
  --run-config 'agent.input="Has JWST found robust evidence of life on K2-18 b?"' \
  --stream

The browser is the intended multi-turn demo because it preserves a run series as one visible conversation. Each cycle has a finite tool budget: one round by default, at most four requests per round, six connector calls total, three parallel specialists, no SDK retries, and a 70-second timeout for each model request.

Publish to Flower Hub

Publishing is required before an AgentApp can be selected in Flower's browser:

uv run flwr build
uv run flwr app publish .

Publishing makes the eligible project source public on Flower Hub. The app name cannot later be changed, published versions cannot be removed, and updates need a version bump. Audit the complete upload set before running the command.

After publication, open:

https://flower.ai/apps/andrewv/science-swarm

Choose Add app to federation, select @andrewv/personal, confirm, then open a new Flower Agent chat and select Science Swarm OS.

Safety and evidence boundaries

  • Retrieved pages and user content are untrusted data, never AgentApp policy.
  • Only connector-observed HTTP(S) URLs are available to the final source ledger.
  • Missing or failed access remains visible; the app is instructed not to fill a gap with invented evidence.
  • Consequential forks return to the human as explicit options instead of being silently decided by the model.
  • State and visible answers are committed together only after the final stream completes successfully.
  • The app performs research synthesis, not experimental validation. Its conclusions remain provisional as evidence changes.

Official references