With a language model
They deliberate
Give Terrarium a Claude API key and each person is a Claude agent that thinks its day through. Whether to share, steal, court, fight or make peace is the agent's own call.
Run it with Claude →A world of AI agents
Every person in it is an AI agent with a mind of its own.
A language model is each person's intelligence: it reads what they see, need, believe and remember, and decides what they do. Put a hundred of them in a world with seasons, scarcity and each other, and watch what kind of society comes of it.
The core idea
The simulation is only the body and the world. The mind is an AI agent: every day it gets one person's view of things and answers with what they do. Here is one day of one person, Bria, start to finish.
1 · Perceive
~ ~ * * . ~ * * . . . * B K . . . . △ . . . . . *
2 · Ask the mind
## Who you are You are Bria: cooperative, outgoing, calm. You want to be respected. You carry 9 food (it slowly spoils). I remember: Kael gave me 2 food on day 21. ## Current Situation (Day 34) Autumn. Resources are dwindling. Nearby: Kael (looks hungry, carrying 0 food) ## Available Actions GATHER · EAT · REST · MOVE GIVE <name> <n> · COURT · BUILD CLAIM · ATTACK · …
3 · The agent decides
REASONING: Kael shared with me when I was short. He looks hungry, and I have more than I need before winter. ACTION: GIVE Kael 3
The model is free to choose anything on the list, including stealing, fighting or doing nothing. Nothing in the engine nudges it either way.
4 · The world resolves
The engine applies the physics of every action together: who has the food now, what got built, who got hurt. It never decides for anyone.
5 · Remember
An illustration of one day, in the format the engine sends to the model (shortened). In the browser, where no model runs, the same loop runs on instinct.
Every person is a separate agent with its own context. They don't share a brain, a plan or a goal; they only share the world, and what they can see of each other in it.
The world turns
Food grows and spoils, herds wander, weather and illness come and go.
Every agent thinks, on its own
One call per person per day, each seeing only what that person sees.
All at once
Every choice resolves together against the same morning, so walking away doesn't dodge a blow.
Beliefs update
Each remembers what they did, what was done to them, and what they saw.
↻ then the next day, and the next. Over seasons and generations, patterns form that no one wrote.
What the agent is given is layered, from what never changes to what changes every day. Beliefs are not facts: they come from experience, and they can be out of date or wrong.
There is no code for markets, chiefs or feuds. There are agents with needs, a world with rules, and time. What you see in a run comes out of that.
The intelligence can come from either of two places. Either way, the world never chooses for anyone.
With a language model
Give Terrarium a Claude API key and each person is a Claude agent that thinks its day through. Whether to share, steal, court, fight or make peace is the agent's own call.
Run it with Claude →Without one
In your browser, people run on instinct: fast rules from behavioural ecology and social psychology, from Hamilton's rule for sharing to the logic of contests over land, with every source listed.
The science behind instinct →A grid of land with its own physics, indifferent to the agents on it.
*.~♣d!Terrarium is a societal petri dish. You make a world with rules, fill it with AI agents, one mind per person, and see what grows.
It asks one question: can social structure emerge on its own, from agents free to act within a world’s constraints? Not markets, chiefs or alliances written into the code, but ones that appear because hungry, sociable, mistaken agents found them useful.
It’s free and open source. The engine is written in Rust, the viewer runs in a terminal or, compiled to WebAssembly, right here in your browser.