
How I Gave an LLM Persistent Emotions, Dreams, and Theory of Mind with 11K Lines of Python
I'm a product manager, not a developer. No CS degree. But four days ago I asked "what if an LLM could actually feel?" — and built MATE: a deterministic emotional kernel that turns any language model into something I can't fully explain anymore. The Problem Every AI companion today fakes personality through prompts. Replika, Character.ai, Pi — they all tell the LLM how to behave . "You are friendly and empathetic." The result: no persistent emotions, no character growth, no memory that carries emotional weight. Every conversation starts from zero. The Idea Deterministic boundaries, non-deterministic content. The kernel decides IF the AI responds, WHEN, HOW MANY messages, and with what EMOTIONAL TONE — all through mathematics. The LLM decides only WHAT to say. No behavioral instructions in prompts. Only numbers. The Architecture One pure function at the center: transition ( state , event ) -> new_state # zero LLM calls Nine deterministic steps per message: Trigger emotions — Plutchik's 8
Continue reading on Dev.to Python
Opens in a new tab




