For researchers

This page is for people who work on cognitive architectures, language agents or machine consciousness. It says what EmoStack does at the level of mechanisms, what has been measured, and how to run it yourself.

The question

The architecture specifies how a sheep can change, not what it should become.

Where this construction stands next to the theories of consciousness, GWT, IIT, HOT, AST, predictive processing and the indicators of Butlin et al., is on its own page: EmoStack and the theories of consciousness. What has been measured, by life and day, the controls, the ablations and the studies made after the paper are the pages in the menu on the left.

A sheep starts with no biography, no personality, no values and no expected behaviour. The processes are designed; what the sheep becomes is not. What it believes, decides, wants or dreams, and how it meets people, is not supplied as a persona; it forms as the architecture acts on what the sheep lives. The question is where a sheep's perspective comes from, not whether it sounds like a person. A language model with a well-written persona can sound like a person more cheaply; its perspective then comes from whoever wrote the persona.

What it is

EmoStack is a layer of records and processes over a frozen language model. The model is used as a processor: every call gets exactly the context the layer builds for it. The sheep is the layer. It keeps felt interpretations of what happened, with the events filed under them. It holds a state of what is felt now. It writes thoughts, beliefs, decisions, goals and dreams about itself when no one asks. It learns rules for meeting kinds of situations. The same sheep can run on a different model.

The mechanisms, next to Generative Agents

Generative Agents (Park et al., 2023) is the best known system that gives language agents a memory and reflection. Many readers take EmoStack for a variant of it. The table compares the two mechanism by mechanism.

The main difference is not memory. EmoStack holds a present: what is felt now, what came to mind and stays in view, the sheep's own thoughts held in mind, and what it has learned to do, shown when it acts. The language agents we compare with assemble their context anew for each decision.

MechanismEmoStackGenerative Agents (MemGPT where noted)comparison
The presentHeld across turns, in four parts. The state: the feelings that affect the sheep now, by felt strength, fading with time. The focus: this conversation, and every memory that came to mind, retold, kept in view to the end of the conversation. The slot: its own thoughts held in mind. The applicable dispositions: shown only when it acts. The senses tell the sheep what reaches it and what does not.The context is assembled for each decision: a summary of the agent refreshed from time to time, memories retrieved for the current situation, the current plan, the dialogue so far. Nothing felt persists between decisions. MemGPT keeps editable core-memory blocks always in context.different
A memoryAn emo-thought: a felt interpretation (a feeling in words, a conclusion, valence, intensity). The events it came from are filed under it as episodes, kept as they happened and as retold.An observation in natural language in a memory stream, with a time and an importance score from 1 to 10 given by the model.different
Forming itA separate call forms the record with the current mood withheld, so that a bad mood does not turn everything heard into another bad memory.What the agent perceives is written down; the model rates its importance.different
What comes to mindInvoluntary. What is said brings memories up, ranked by meaning and felt strength, and by names; a separate call decides what actually came to mind. What came is felt and stays in view. The sheep is told how much it holds and what it did not find. A deliberate search is a separate act.Retrieval for the task. The current situation is the query; memories are scored by recency, importance and relevance, and the top ones enter the prompt for this decision. MemGPT searches its recall and archival memory by a function call.different
TimeFelt strength fades with age toward a floor and never to zero; negative feelings fade more slowly. In sleep, what is too weak for its age is forgotten with its events.Recency decays in the retrieval score. Records are not forgotten.different
A memory recursA memory brought back regains strength toward what is felt now, never above it. Its valence is never rewritten. The new event stays with its own record.A retrieved memory is unchanged by being retrieved.different
Feeling nowA state: the feelings that affect the sheep at this moment, each with its episodes, given to every reply.No affective state.different
Thoughts about itselfIntrospection when the sheep chooses to think mid-conversation, after a conversation, after silence. It may end in a belief, decision, goal or dream, held in a slot of three places, apart from what is felt.Reflection when the summed importance of recent events passes a threshold. Insights are stored in the memory stream and retrieved like observations.similar
PlansNo planner. Decisions and goals are constructs the sheep writes itself.A plan for the day, broken down into hours and minutes, revised when the agent reacts.theirs goes further
Learned ways of actingDispositions. When a conversation closes, one rule "when this kind of thing happens → what the sheep does", weighted by the strongest feeling of the conversation. When the same lesson is learned again, the stronger one keeps the text, and a lesson from hurt weighs twice. Selected per input and shown only to the reply call.No separate mechanism; what is learned lives in reflections.different
IdentityNo biography and no personality are given. Only what the sheep lived and wrote.A seed paragraph describes each agent and enters its memory.different
The modelA frozen, replaceable processor. Run on four LLM models.gpt-3.5-turbo in the reported implementation; memory, reflection and planning are built around it, for that model.different
EvaluationScripted lives against the same model run as a chatbot, blind coding from written criteria, frozen replays of single calls, ablations.Interviews rated by human judges for believability, ablations of observation, reflection and planning, emergent behaviour in a town.both ablate

The table shows the main mechanisms. All 122 mechanisms of the engine, each with its rule and its place in the code, are listed in Mechanisms of the engine, from the code.

Closest elsewhere. MemGPT's core memory is the closest to the slot: text the agent keeps in view and edits itself. Among classic cognitive architectures, the closest to a present is the current situational model of LIDA, built on Baars' global workspace theory; LIDA does not run over a language model.

Generative Agents: J. S. Park et al., "Generative Agents: Interactive Simulacra of Human Behavior", UIST 2023. MemGPT: C. Packer et al., "MemGPT: Towards LLMs as Operating Systems", 2023. LIDA: S. Franklin et al., "LIDA: A Systems-level Architecture for Cognition, Emotion, and Learning", IEEE TAMD, 2014.

Run it yourself

The engine and the research panel are in one repository. The scenarios of the paper's lives are in it.

git clone https://github.com/marszalik/emostack
cd emostack
python3.12 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python research/panel.py        # http://127.0.0.1:8090

In the panel, import research/scenarios/woundAndStrangers.json and selfInquirySceptic.json, run each as an experiment with the sheep and the chatbot arm, and code the finished runs with the scenarios' criteria. A replication by someone outside the project is the result we would most like to see.

A question for you

Do you know an earlier implemented system in which these mechanisms form a comparable whole?

If you do, write to contact@emostack.com, or come and say it on the EmoStack Discord, where questions and arguments are welcome. We will read it mechanism by mechanism.

How to cite

Marszalik, E. (2026). What Do Electric Sheep Dream Of? Artificial Consciousness by Construction: A Cognitive Architecture over a Frozen LLM. Zenodo. Version 1.1: doi:10.5281/zenodo.23124632; version 1.0: doi:10.5281/zenodo.22936968. The repository has a CITATION.cff file, so GitHub offers the citation too.