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.
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:
nomic-ai/nomic-embed-text-v1.5
using its trained clustering: prefix.[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.
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 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).
Each worm has:
poem.txt) that appends every eaten word
as it eats it.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.
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.)
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.
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.