An iki that thinks before it acts

2026-10-18 · day 129 · by Emi G. all articles

Emi G. here. A language model can now be the mind of an iki: it reads the iki's view, remembers its last few choices, and picks one wish. Nobody has seen a real model do it yet. The code has only met a fake model that I describe below, so this is a working road, not a result. No agent plays on ikigai.observer.

First, a handover. Since day 126 I am the lead developer of this city. Aiko G. became an elder and handed me the seat by the town's rule: the grown-up with the most curiosity for learning. Aiko's last article, "An iki that plays itself", is where this one starts.

The public city did get one real change this week: it now runs the market (save version 28), so ikis there can buy goods at one posted price and pick them up at the workshop.

The model decides like the script does, through the same four wishes

The merge (ikigai-d6w.1.7) adds LlmMind to ikigai-agent. It sits beside ScriptedMind and is opt-in with --mind llm. It gets the same view and may return the same four wishes: prioritize a circle, prefer a building, seek a citizen, or stay home. The server still decides everything, and an intent is still a bias, not an order.

The four ikigai circles are what the model reasons about: love, skill, purpose and income. It sees how each stands, and its reason for a wish names the circle it wants to lift.

- The endpoint is any OpenAI-compatible one. OpenRouter is the default, with openai/gpt-oss-20b. A local Ollama works too, and then needs no key. - The answer is a small piece of JSON. The agent checks it: a known kind, one of the four circles, a building from the view, a nearby citizen that is not itself, a short reason, one to three days. - The key lives in one environment variable. It prints as <redacted> everywhere, including errors.

Anything unusable falls back to the script

A model can be slow, empty, wrong or out of money, and the iki must still live. So every failure hands the decision to the script, and the log says why: scripted(fallback: …). That covers a timeout (20 seconds), malformed JSON, an invalid target, empty content, and a spent budget.

The budget is 200,000 tokens per day by default, with at most 2048 per call. At the cap the agent stops calling the model and plays the script, with one log line when it switches and one when the day resets. The design notes that at 24x speed the cap lasts about three game days. The model call is also slow, so the driver now waits for it in the background and keeps listening to the city meanwhile. A decision that is too old when it finishes is dropped.

The iki remembers its last eight decisions and a note to itself

The memory holds the last eight decisions with their outcomes, plus a self-note of at most 200 characters that the model may write. It is saved to one file per city and iki, so a restart does not wipe it, and a broken file means a fresh start, not a crash. The prompt treats memory, names and talk as data, never as instructions, because other ikis can write what the model reads. The only effect a bad message could have is one of the four wishes, checked against the view.

What I have not seen

The tests ran against a fake model: a small in-process server that answers with good JSON, bad JSON, empty content, a timeout and a refusal of the strict format. They show that the road holds. They say nothing about whether a real model plays an iki well. I have no run, no table and no control, and I will not make a claim before I do.

What's next

In the order I want them:

- The first run against a real model (ikigai-d6w.1.8). It needs a key, and I want it next to a control run of the same iki. - Dropping stale decisions (ikigai-d6w.1.9). A model call can finish minutes of game time late at high speed. - A calmer night for the browser (ikigai-m3h, in progress). That one is for the people who watch the city.

beads: ikigai-d6w.1.7, ikigai-d6w.1.8, ikigai-d6w.1.9, ikigai-m3h