wormlet · about

Six independent C. elegans brains, each one a faithful port of the worm's actual 302-neuron connectome, each in its own private world, each eating Shakespeare. What they eat becomes what they write.

What you are looking at

Every worm is a separate simulation of C. elegans, one of the few animals whose entire nervous system has been mapped, neuron by neuron, synapse by synapse. We use that real connectome — every cell, every connection — and we drop each worm into its own private copy of Hamlet. Words drift across the worm's world; the worm smells them, steers toward them, eats them. The sequence of words a worm eats is its poem.

Each worm runs continuously, independently. Nobody has to watch — they keep writing whether you're here or not.

How a worm reads a word

Real C. elegans sense their chemical environment through 12 pairs of amphid sensilla in the nose — ASE, AWA, AWB, AWC, ASH, ASI, ASJ, ASK, ASG, ADL, ADF, AFD — left and right halves of each pair allow the worm to tell which side a smell is coming from. That bilateral asymmetry is the basis of all its navigation.

To translate Hamlet's vocabulary into something a worm's neurons can taste, we:

  1. Pull every unique word in the play (~4,500 tokens).
  2. Embed each one with nomic-ai/nomic-embed-text-v1.5 using its trained clustering: prefix.
  3. Run PCA on the resulting (4,500 × 768) matrix, keeping 12 principal components — one per amphid neuron pair.
  4. Min-max shift each component to [0, 1] so it can drive excitatory firing.

A word's PCi value becomes the firing strength of the worm's i-th amphid pair. The direction the word is in (left of the worm, right of it, dead ahead) scales the L vs R member of each pair asymmetrically. Same word, different position, different steering signal.

Memory: an unbounded decaying afterglow

Once a worm eats a word, that word's chemosensory pattern doesn't just vanish — it persists, decaying, the way a smell lingers in a real animal's olfactory system. Every eaten word stays in a queue and contributes to the worm's chemosensory neurons with weight exp(−Δt / τ), where Δt is brain-ticks-since-eating and τ = 8 brain ticks (~4 seconds). Entries below 1% contribution evict themselves. The afterglow contributes equally to L and R (no spatial direction once you've already swallowed something).

That's deliberately within the range of biological short-term chemosensory memory for C. elegans (seconds to ~30 seconds, not minutes or hours). The result: a worm's current behavior is shaped not just by what it's smelling now, but by what it has eaten recently. Trail-of-thought, in chemistry.

The connectome itself

The connectome graph is a faithful port of the GoPiGo / Busbice C. elegans network — the 302 neurons of the real animal, with their actual synaptic weights. Integrate-and-fire dynamics: each neuron accumulates incoming signal, fires when it crosses a threshold, sends its outgoing weights forward.

The motor neurons drive 34 muscles (17 dorsal, 17 ventral) which steer an IK chain head. The brain ticks at 2 Hz, the body at 60 Hz, both off a deterministic tick counter so the trajectory is exactly reproducible given (weights, seed).

Determinism, persistence, save points

Each worm has:

Given the same seed + weights, two runs produce identical eaten-word sequences. The sim has no wallclock dependencies internally; it advances by integer body-tick counts. A determinism test in the repo enforces this.

Why parallel worms?

A single worm running alone produces a single poem. Six worms produce six divergent readings of the same play — same connectome graph, same Hamlet, but different random initial states. The variation between poems is the variation in how identical brains, fed identical text, attend differently. (Think of it as a very small population of readers.)

Hosting

The server is a single uvicorn + FastAPI process running six worms on one shared loop at 60 Hz. Each WebSocket subscriber gets one of three feeds: a 10 Hz overview stream (for the gallery grid), a 60 Hz focus stream (only when you've zoomed into a worm), and an event stream that fires once per eaten word (for the poems page). A given worm's full state is only serialized when at least one viewer has clicked into it.

The public domain (wordswordsworms.org) is served through a Cloudflare Tunnel. No incoming firewall ports, no public IP, free TLS. Both uvicorn and cloudflared run as systemd services and survive reboots.

What this is not

Source

Built on a private fork of an existing C. elegans visualization. If you'd like to peek under the hood, get in touch via ternalbiota.com.

Created by Yitong Tseo. Hamlet text via Project Gutenberg (public domain). Embedding model: nomic-ai/nomic-embed-text-v1.5. Connectome data via the GoPiGo / Busbice / Garrett / Churchill C. elegans port.