A simulated fly circuit learns a small browser task: search for a fruit, choose it, and select its ripeness. The Next.js app replays a recorded run with a 3D fly and a neuron activity map.
Watch the full-resolution demo · 18 seconds
Use Node.js 24.18+ and pnpm 11.10.0. The video, scene and replay data are included; no API keys or Python setup are needed for the website.
pnpm install --frozen-lockfile
pnpm devOpen localhost:3026. pnpm build and pnpm start run the production build; pnpm lint checks the app.
apps/web/ Next.js app, replay assets and demo video
packages/experiment/ Model, browser task, checkpoints, data and results
media/ README preview and draft X post
NOTICE Sources, modifications and credits
The model uses 5,187 neurons from MaleCNS v1.0. Training adjusts gains on 61,210 existing Kenyon-cell → MBON connections using 1,200 browser rewards and 300 gradient updates. Input and output mappings stay frozen. Stagehand's Chrome extension executes the selected actions.
| Condition | Successful episodes |
|---|---|
| Random actions | 4/200 |
| Before training | 18/200 |
| Trained connections | 200/200 |
| Reset connections | 18/200 |
| Shuffled wiring, trained | 200/200 |
These are fresh seeds with a fixed vocabulary and engineered text inputs. Shuffled wiring also learns, so this demonstrates internal learning, not an anatomical advantage or general browser ability. Neuron activity comes from the rate simulation; the fly's legs are animated.
Results chart · Learning curve · Audit
Install uv, then run:
pnpm experiment:setup # Python 3.12, circuit checks, checkpoint restore
pnpm experiment:audit # Verify weights and 1,812 recorded decisions
pnpm experiment:browser # Build pinned Stagehand + fetch Flybody
pnpm experiment:train
pnpm experiment:train:shuffled
pnpm experiment:evaluate # 200 live browser episodes per condition
pnpm experiment:evals # Stagehand CLI: 16 additional smoke episodesBrowser runs need local Chrome. Commands replace their corresponding experiment outputs. experiment:collect recollects rewards; experiment:record, experiment:charts and experiment:export regenerate presentation assets. With the app running and FFmpeg installed, experiment:video renders the 18-second film. experiment:pack updates the compressed checkpoints after training.
The reduced circuit is included. Optional experiment:rebuild-data downloads approximately 1.1 GB of original data and rebuilds it. Source commits, checksums and evaluation settings live beside the data in JSON.
Built with MaleCNS, Flyhard, Flybody and Stagehand. See NOTICE for attribution and third-party licenses; MaleCNS-derived data is CC BY 4.0.
