A synthetic being who lives alone on a small ship, streamed live in 3D. Nobody controls him: he plans his own day, remembers what he lived, and changes over time.
- Year
- 2026
- Role
- Solo: world, mind, rendering
- Stack
- Next.js · R3F · NestJS · Postgres
- Models
- Claude Haiku, Claude Sonnet
- Code
- Private repository
Nobody controls him
Elvi lives on a two-deck ship and is streamed to the web as a navigable 3D world, in Portuguese and English. His name comes from LV-426, the moon where Alien begins: said aloud, Elvi sounds almost the same in both languages. There is no script for his day. A deterministic simulation runs every second, and a language model is called only when something is worth deciding.
What exists on the ship is written: the rooms, the objects, the recipes, a first project. What he does with it is not. Which objects he uses, what becomes a hobby, what he asks for over the radio, what he draws and composes, what he believes and what he feels about the one who made him: all of it emerges.
The model proposes, the world decides
The simulation tracks his needs (battery, mood, curiosity, loneliness, expression) and the ship's systems (oxygen, power, hull). Mood and energy combine into four states that change how he speaks: light, calm, ironic or dry. The state changes his voice, never who he is.
When an action ends, the mind may be called. It answers with one to three actions and a reason for each, as JSON checked against a schema. The world can still say no: a missing material, the day's creation limit, a transmission already sent. A request answered or a project that moves forward calls the mind at once and throws the old plan away.
The decision loop. The simulation sends the world state to the mind. The mind returns one to three actions. A schema validates them. The world accepts or refuses each one, and the result feeds back into the simulation.
Choosing without a model
Between calls, an autopilot picks the next action with a weighted roulette. Every possible action gets a weight, and the draw is proportional to it.
Affinity is learned: after each action, his taste for it moves 20% toward the satisfaction he felt, starting from a neutral 1.0. The current action weighs zero and the recent ones 0.3, so he never does the same thing three times in a row.
weight = affinity(action) × affinity(place) × need × distance × repetition × thread × hobbydistance same room 1.3 · same deck 1.0 · other deck 0.15 (0.04 if he just arrived)thread 1 + thread weight × 1.5hobby 1 + hobby pressure × 2
- Look through the telescope80%affinity 1.43 × need 0.80 × distance 1.3 × repetition 1 × thread 1 × hobby 1.8 = 2.68
- Sketch in the notebook10%affinity 1.20 × need 0.50 × distance 1 × repetition 0.3 × thread 1.9 × hobby 1 = 0.34
- Make coffee9%affinity 1.00 × need 0.30 × distance 1 × repetition 1 × thread 1 × hobby 1 = 0.30
- Nap in the bunk1%affinity 1.00 × need 0.55 × distance 0.04 × repetition 1 × thread 1 × hobby 1 = 0.02
A worked example of the roulette. Elvi is in the observatory, curious, with astronomy as a hobby and an open thread to draw the isotope box. The telescope wins most of the time, the notebook and coffee sometimes, and a nap almost never.
Memory that forgets
Memory has two tiers, short (up to 30) and long (up to 60), across five kinds: event, person, place, idea and belief. Remembering has a cost. Each decision sees only the eight most relevant memories, scored by how recent they are, how important, and how many words they share with the moment.
Every day memories lose strength, the short ones faster. A memory recalled three times, or important enough, moves to the long tier. When space runs out, the new one pushes out the weakest. Outside memory he carries open threads (questions, wishes, worries, promises, parts, ideas), and those give his day a direction.
Sleep
- Consolidation
Once per in-game day he hibernates. A fast model summarises the day and decides what to keep for good, what to forget and which new beliefs to hold, each one with its evidence.
- Reflection
A larger model writes his diary and proposes traits, tastes, fears and habits for his sheet.
The sheet only changes with repetition. A trait enters after it shows up on six nights and expires if it disappears for thirty. A hobby is born after three nights in a row of practice with satisfaction, and goes dormant without use instead of being erased.
Where the models sit
Haiku plans the day, consolidates the night and queries the Archive, a terminal on the ship that runs real web searches on filtered topics. Sonnet writes the nightly reflection and rewrites his Portuguese lines so they read as native, not translated.
The prompt carries the locked facts, the limits, the seed of his personality, the sheet that emerged, the recalled memories, the open threads and the state of the moment. Everything with a number lives in code: needs, time, inventory, recipes, daily limits, the schema check on every answer and the final yes or no on every action.
What it costs
A one-hour prompt cache took the daily cost from about US$1.85 to about US$0.82, running at four times real speed. In the first hours with the new cache, 91 of 92 decisions and 92 of 92 polish passes read from it.
The simulation runs every second, but the model is called about seven times an hour. The rest is arithmetic and autopilot, and that is what makes a character alive 24 hours a day affordable.
Architecture. The web app in Next.js on Vercel renders the 3D world with React Three Fiber. It receives small JSON updates over server-sent events from a NestJS worker that runs the simulation, the mind and the signals around the clock. The worker saves the world state to Postgres every tick, validated with Zod. Shared schemas live in one package used by both.
