D&D School Simulator
Multi-agent LLM system where persistent AI characters with individual memory, goals, and social relationships generate emergent school narratives a testbed for long-horizon coherent agent behaviour.
Skills involved
What This Is
A school simulator where every character is an LLM agent with persistent memory, a defined personality, social relationships, and their own goals. The D&D framing is the delivery mechanism the underlying research problem is emergent narrative from multi-agent LLM interaction.
This is one of the hard problems in AI right now. Getting a single LLM to tell a coherent story is solved. Getting a dozen agents to interact over many turns while staying in character, remembering prior events, and generating surprising but believable outcomes is not.
The Hard Problems
Memory and consistency. Each agent needs to remember what happened to them but naive context stuffing doesn't scale. We use a structured memory system: episodic memory (events), semantic memory (beliefs about other characters), and a working context window that pulls relevant memories at each turn.
Persona coherence. Characters need to act like themselves across hundreds of interactions. We use system-prompt-level persona definitions with explicit trait vectors, combined with consistency checks that flag when an agent's response contradicts their established character.
Emergent social dynamics. The interesting part isn't scripted it's what happens when Agent A does something Agent B didn't expect. We model relationship states (trust, resentment, influence) that update based on interactions and feed back into future behaviour.
Story caching. LLM calls are expensive. We cache story state at checkpoints and only regenerate branches when something relevant changes making long-running sessions tractable.
Current Stack
- Python + Flask backend
- Each agent has an individual LLM call with injected memory context
- Structured memory storage in a local database
- Web interface for human interaction and observation
What We're Optimising
- Memory retrieval quality: moving from recency-weighted to relevance-weighted memory (embedding similarity)
- Inter-agent communication protocol: designing the message format agents use to affect each other
- Consistency enforcement: automated contradiction detection using a judge LLM
- Token efficiency: smarter context compression for very long sessions
What's Next
- Replace context stuffing with a proper RAG-based memory system
- Add an emotion model: agents track valence/arousal states that modulate tone
- Explore game theory: do agents that model other agents' goals outperform reactive agents?
Last updated Feb 9, 2026
← Back to all projects