Definition
Use multiple agents to simulate a crowd, organization, community, or social system. The focus is long-term memory, planning, relationships, and emergent behavior.
Category: Simulation
When to use
User research, product validation, social behavior simulation, game NPCs, organizational modeling, information-propagation studies.
When not to use
Production task execution, strongly deterministic flows, anything that needs a coding agent to perform real work.
How to implement
- Design world state: locations, time, events, objects, relationships.
- Each agent has memory, profile, goals, and a daily plan.
- Use an
observe → reflect → plan → actloop. - Record agent interactions and world-state changes.
- The goal is simulation credibility, not single-task success rate.
Minimal pseudocode
TypeScript
async function tick(world) {
for (const agent of world.agents) {
const obs = world.observe(agent);
agent.memory.store(obs);
const reflection = await agent.reflect();
const plan = await agent.plan(reflection);
await world.apply(await agent.act(plan));
}
}
Recommended trace events
simulation.tick.startedagent.observedagent.reflectedagent.actedworld.state.updated
Common failure modes
- Treating simulation results as real predictions.
- Persona is convincing but behavior isn't verified.
- Long-term memory pollutes future runs.
Implementation checklist
- Trigger and exit conditions defined.
- Input/output schemas defined.
- Permission, budget, timeout, and retry policies defined.
- Trace events defined.
- Degradation or human-takeover strategies defined.