prototype · artificial-life
Digital Bacteria: A World That Decides for Itself
An interactive artificial-life world where bacteria driven by tiny recurrent neural networks forage, avoid ambush poison, signal each other indirectly, and evolve — and the simulation behind the note on Genesis and the age of AI.
- artificial-intelligence
- emergence
- complex-systems
- neural-networks
- simulation
This is the experiment behind the note And on the Seventh Day, He Rested. It is a small living world — a 32×32 grid where digital bacteria, each driven by a tiny recurrent neural network, search for food, avoid poison, reproduce, and die. Nothing in it is scripted. You set the rules and watch what happens.
Press Play below. With no file loaded it starts from random brains, so the first generations look clumsy; the population only survives because of a bootstrapping grace period with no poison. Load a trained population.bin and the colony already knows how to forage and regroup.
Cargá tu population.bin (formato v6) para ver bacterias entrenadas
sin archivo arranca con cerebros aleatorios
What each bacterium actually is
Every agent runs a continuous-time recurrent neural network (CTRNN) with 12 neurons, 16 sensors, and 7 actions. It cannot see the grid. It only feels gradients: how much food is nearby, how crowded the cell is, its own hunger, and a handful of chemical signals left by others. From those 16 numbers it decides where to move, whether to eat, and whether to reproduce.
There is no global controller telling the colony to cooperate, compete, or explore. Those behaviors — when they appear — are emergent.
The signals are indirect, and one of them lies
The bacteria never communicate directly. They change the environment, and the environment changes them — classic stigmergy:
- Quorum marks where the colony is dense, biasing others to gather or scatter.
- Food alarm is an honest signal: it only rises where real food was eaten.
- Death scent lingers where a bacterium died from poison — a fading warning.
- Stigma trails record heavily walked and death cells.
The cruel detail: food and poison emit the identical sensory signal. A bacterium cannot tell them apart until it bites. Survival depends on reading the context — the death scent, the crowding, the alarm — not the food signal itself. Toggle reveal poison to see what the colony cannot.
The world is an agent too
This is the part that connects back to the note. The environment is not a passive backdrop — it runs its own homeostatic loop. As the population grows, the world quietly tightens: it grows less food and seeds more poison in the most crowded cells. As the population crashes, it eases off and re-seeds. Food does not bloom where the colony already is; it sprouts in low-quorum regions, so the map can never be memorized.
The result is a negotiation. Neither the bacteria nor the world is in charge. Balance is something the two of them produce together — and I only set the initial conditions.
Reading the visualizer
- Layers overlay the invisible fields — quorum, stigma, food alarm, death scent — so you can watch the chemistry the agents actually sense.
- Hover any cell for the full state of a bacterium (energy, hunger, fitness, evolved traits) or a tile.
- Evolution happens by crossover on collision: two well-fed agents on the same cell may breed, with assortative mating weighted by an evolved selectivity trait, and mutation on the genome and on traits like curiosity, sociability, and altruism.
It is a toy. But it is enough to make the old question concrete: once the rules are set and the world starts deciding for itself, the work is no longer to direct. It is to watch.
For a companion world — predators, prey, and poison finding their own balance — see Predator and Prey.