the biggest system. five parts.
Emotion integration: reads the six chemicals and produces a two-dimensional emotional state. valence (positive to negative, -100 to 100) comes mostly from dopamine, serotonin, and endorphins minus cortisol, plus a bit from oxytocin. arousal (calm to intense, 0-100) comes from norepinephrine and heart rate. from these it labels the dominant emotion -- excited is high valence + high arousal, content is high valence + low arousal, anxious is low valence + high arousal, sad is low valence + low arousal. high oxytocin with positive valence makes loving/affectionate. high cortisol makes stressed/fearful. high endorphins and dopamine together can produce euphoria.
Narrator / consciousness: a predictive world model built as three neural networks stacked vertically. it tries to guess what happens next at every level of abstraction.
Level 1 (sensory prediction, 8 inputs -> 128 -> 128 -> 8 outputs) predicts immediate sensory changes -- object movement, new sounds, touch, taste, smell. it absorbs routine noise. if a leaf rustles, level 1 handles it. level 2 never hears about it.
Level 2 (body state prediction, 31 inputs -> 96 -> 96 -> 31 outputs) predicts how body signals and chemicals change. it also receives any error that level 1 couldnt resolve. if level 2 predicts correctly, the error stops here.
Level 3 (abstract/social prediction, 41 inputs -> 64 -> 64 -> 41 outputs) predicts emotional state, social context, and memory patterns. this is the conscious narrator -- what the character's inner monologue draws from. it only hears about errors that level 2 couldnt resolve. only genuine surprises reach consciousness.
the narrator trains constantly. every tick it learns (current state -> next state) to stay calibrated. important moments get extra training iterations. during idle moments and sleep, it replays past experiences to reinforce them.
the narrator also maintains a self-model -- traits like "i am quiet", "i like food", "i miss people", "i am brave" with weights that shift based on repeated experiences. it has a confidence score starting at 50, going up with successful predictions and down with failures. low confidence makes speech less certain.
the narrator does several things: it endorses actions post-hoc (explaining why you did something), confabulates to explain prediction errors, generates idle thoughts from memory, engages in self-deception when cortisol is high (reframes painful truths), and retroactively rewrites old memory summaries to fit the current self-model. but critically, the narrator has no decision-making power. it just watches and predicts.
Attention: determines what the character focuses on. each potential target gets a salience score based on how relevant it is to current needs (hungry? food is salient), how novel it is (new things decay from 100% to 0% over 10 seconds), social relevance (people matter), plus a small random factor. the highest scoring target wins. if nothing is salient enough, attention wanders randomly.
Memory: this is the unusual part. memory is stored in the narrator's network weights, not in a database. the weights themselves ARE the memories. records are just lightweight indices that tell the narrator what to reconstruct -- time, event type, participants, location, encoding strength, how many times recalled, and a summary.
every tick the brain scores the current moment on encoding strength -- how arousing was it, how much did valence change, how surprising was it (prediction error), how relevant to current needs, was the character paying attention? if the score passes a threshold, the moment is saved and trained into the narrator network.
there's a cap of 1000 most recent records, with oldest/lowest-strength records pruned when space runs out. retrieval works by similarity between current chemicals and the chemicals stored alongside each memory, plus a recency bonus. top 5 candidates are returned and each is reconstructed by the narrator -- reconstruction differs slightly each time because the network weights have changed since encoding. this is reconsolidation, same as in real brains. old unpracticed memories come out blurry because new experiences have partially overwritten those weights. two characters who experienced the same event will remember it differently because their networks are different.
Thought formation: the narrator generates raw predictions -- numbers, error vectors, confidence values, attention targets, memory fragments. these arent directly usable as things to say or do. thought formation reads this raw output and structures it into concrete thoughts with a type, target, emotional tone, urgency (0-1), and content string.
seven thought types: need triggers when any need exceeds threshold ("i am hungry", "i need sleep"). confusion triggers from prediction error ("why did that happen"). observation triggers from novelty or attention ("a chair", "you look different"). memory triggers from strong memory retrieval ("i remember we ate pancakes"). social triggers from a partner nearby with a notable relationship ("you are nice", "i dont trust you"). idle is the fallback when nothing is above threshold (just "hm"). drift is random out-of-context thoughts that pop up with a small probability each tick -- "do fish get bored?", "what is a chair really thinking about" -- they dont need a reason.
thoughts feed two paths. the speech path goes through expressive impulse -> valve -> language department. the action path is indirect -- the thought's urgency can leak back into need pressure, making a character feel hungrier from a strong food memory. if no thought has urgency above 0.2, the character stays in default state (narrator runs, body updates, no output).
tracks relationships between characters. each relationship has a value from -100 to 200, starting at 0 for strangers. good interactions increase it (scaled by oxytocin release), bad interactions decrease it (scaled by cortisol). shared experiences add a small bump based on emotional valence. time apart slowly erodes it.
high relationship means more oxytocin release around that person, stronger impulse to approach them, warmer internal tone from the narrator, and lower valve inhibition (youre comfortable around friends). low relationship means the opposite.