# Worm Lab

A browser laboratory for exploring a digital C. elegans worm: follow signals through 300 neurons, change individual cells and compare how the model responds.

- Role: Product concept, experiment workflow, interface direction and AI-assisted implementation.
- Status: Live interactive prototype
- Status code: live-interactive-prototype
- Case page: https://oleksii.almalvs.online/work/worm-lab
- Website: https://worm.almalvs.online/
- Reviewed: 2026-09-06

## Problem

A moving simulation is hard to understand when the inputs, internal activity and resulting behavior are hidden. Visitors need a way to inspect the model and test their own questions.

## Constraints

- Run entirely in the browser
- Make experiments repeatable from the same starting state
- Distinguish model output from biological measurements

## Architecture

- Food or touch stimulus
- Fixed weighted neural network
- Neural and muscle activity
- Movement and signal history
- Control and intervention comparison

## Decisions

- Show the organism, circuit and signals on one simulation clock
- Restore complete checkpoints for repeatable experiments
- Expose neural steering, odor assistance and boundary correction separately
- Keep the simulation local to the browser, without API keys or a remote inference service

## Evidence

- Public interactive laboratory with Observe, Circuit and Compare views
  - Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.
  - Sources: None published.
- 300 neurons, 96 muscle cells and 3,689 directed weighted connections in the source table
  - Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.
  - Sources: None published.
- Cell stimulation and silencing, connection controls and sampled history
  - Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.
  - Sources: None published.
- Paired control and intervention runs with a shared playhead
  - Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.
  - Sources: None published.

## Safety and boundaries

- Educational model with fixed weights, not a biologically complete digital twin
- Movement combines neural output, optional odor steering and boundary correction
- Schematic anatomy and arbitrary units; activity is not a biological measurement
- No learning or claim of consciousness

## Stack

- JavaScript
- Canvas
- Browser ES modules
- Deterministic simulation
- Responsive CSS

## Media

![Worm Lab showing the digital organism, stimulus controls, selected neuron and signal history.](https://oleksii.almalvs.online/images/evidence/worm-lab-live.png)

Actual public Worm Lab interface, captured September 27, 2026. A paused model run with food placed ahead; schematic anatomy and simulated signals, not biological measurements.

## Credits

- None published.

## Public sources

- [Explore the live Worm Lab](https://worm.almalvs.online/)
- [Worm Lab: how the model works](https://worm.almalvs.online/#how-it-works)
- [WormBrain: source connectivity table and neural model](https://github.com/leparlon/WormBrain/tree/9cd6480f6b74f4edb18dfd3cb058aaab8142bc6f)

## Related projects

- [ecogen-controller](https://oleksii.almalvs.online/work/ecogen-controller)
- [chevrolet-volt-toolkit](https://oleksii.almalvs.online/work/chevrolet-volt-toolkit)

## A nervous system you can explore

Canonical case section: [https://oleksii.almalvs.online/work/worm-lab#result](https://oleksii.almalvs.online/work/worm-lab#result)

Worm Lab grew from an OpenWorm-inspired idea: make a small organism's neural activity visible and open to experimentation. The browser model represents 300 neurons, 96 muscle cells and 3,689 directed weighted connections. A moving worm, a cell inspector and synchronized signal charts let visitors connect a stimulus with changes inside the model and its resulting movement.

Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.

Sources:
- None published.

## Observe, inspect, intervene

Canonical case section: [https://oleksii.almalvs.online/work/worm-lab#workflow](https://oleksii.almalvs.online/work/worm-lab#workflow)

Observe offers neural-activity, muscle-activity and body layers. Place food or apply a food or touch pulse from either side, then follow the signals. Circuit shows a selected cell and its neighbors, with incoming and outgoing connections ordered by weight. Stimulate a cell, silence it, restore it or disable a connection to explore its contribution.

Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.

Sources:
- None published.

## Rewind and compare

Canonical case section: [https://oleksii.almalvs.online/work/worm-lab#experiments](https://oleksii.almalvs.online/work/worm-lab#experiments)

About 60 seconds of sampled history lets you revisit an earlier moment or resume from its saved state. Compare creates a control and an intervention from the same checkpoint, silences selected cells in the intervention and applies the same initial pulse. Both run for eight simulated seconds. A shared playhead lets you compare trajectories, neural turning and threshold events; a small or zero difference is also a valid result.

Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.

Sources:
- None published.

## What I built around the model

Canonical case section: [https://oleksii.almalvs.online/work/worm-lab#engineering](https://oleksii.almalvs.online/work/worm-lab#engineering)

The connectivity table and neural dynamics are adapted from the open-source WormBrain project, with attribution retained. Worm Lab adds the browser laboratory, cell and connection controls, synchronized telemetry, complete checkpoints and paired experiments. The deterministic engine advances at 30 ticks per simulated second. JavaScript modules and Canvas run the simulation locally in the browser, without API keys or a remote inference service.

Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.

Sources:
- None published.

## What the model can explain

Canonical case section: [https://oleksii.almalvs.online/work/worm-lab#boundary](https://oleksii.almalvs.online/work/worm-lab#boundary)

This is an educational model with fixed weights and simplified dynamics. Movement combines neural output, optional odor assistance and boundary correction, displayed separately. Anatomy and motion are schematic; potential uses arbitrary units and muscle activity is not measured force. The model does not learn or reproduce a complete biological organism. Its purpose is to make a computational model inspectable and experiments repeatable.

Provenance: First-hand account. Published from Oleksii Mazur's first-hand account.

Sources:
- None published.
