TL;DR
Most LLM multi-agent systems are good at tasks (write code, analyze a stock) but bad at people — they don’t model the irrational, emotional, script-driven way humans actually interact. This paper borrows a 1960s psychotherapy framework, Transactional Analysis (TA), and wires it into agent architecture: every agent is split into three sub-agents (Parent / Adult / Child “ego states”), each with a separate memory bank, and a fourth “decision” agent chooses whose response wins based on the agent’s hidden “life script.” They test it by scripting a classic TA mind-game called Stupid between two coworkers and show the agents naturally fall into the predictable helpless-victim / compulsive-rescuer loop the theory predicts. It’s a small proof-of-concept (one scenario, two agents, no quantitative baseline), but the architecture — parallel persona-sub-agents fused by a context-aware arbiter — is a genuinely useful pattern for anyone building believable simulated humans.
Problem & Motivation
The concrete pain: LLM agents make terrible fake humans. If you spin up a multi-agent system to simulate a negotiation, a classroom, a customer dispute, or a focus group, the agents are too reasonable. They cooperate, they stay on-task, they don’t sulk, manipulate, deflect blame, or repeat the same self-defeating pattern for the fifth time the way real people do. Existing MAS frameworks lean on rule-based logic or pure task-reasoning (ReAct loops, planners) and, as the authors put it, “fail to capture authentic social dynamics and the underlying psychological drivers.”
Why prior approaches fall short:
- Task-MAS (stock analysis, software engineering swarms) optimizes for getting the right answer, not for behaving like a flawed person.
- Generative-agent simulations (think Generative Agents / Smallville) give agents memory and routines, but the personality is flat — there’s no internal conflict, no competing impulses fighting over the same response.
- Classic cognitive architectures (SOAR, ACT-R) model rational cognition well but weren’t built to model emotional, unconscious, script-driven social behavior.
The gap the paper attacks: an agent that has an interior life — multiple conflicting drives that produce one observable behavior — and that exhibits stable personality patterns over time. That’s exactly what Transactional Analysis was designed to describe in humans, so they import it.
What’s New (Core Contribution)
1. Ego states as parallel sub-agents.
- Before: an agent is one prompt/loop with one personality string.
- Now: each agent is three ReAct sub-agents — Parent, Adult, Child — that each independently produce a candidate response to the same situation. Personality becomes an internal competition, not a fixed trait.
2. Per-ego-state memory partitioning.
- Before: an agent has one memory store; retrieval pulls “relevant past stuff.”
- Now: each ego state has its own FAISS vector store with its own kind of memory — the Parent remembers rules and authority, the Adult remembers facts, the Child remembers emotional reactions. The same query retrieves different memories depending on which ego is asking. This is the clever bit: memory routing is personality.
3. A “life script” arbiter for decision-making.
- Before: response selection (if any) is by task-success or simple voting.
- Now: a fourth agent picks among Parent/Adult/Child responses by weighing four criteria — relevance, progress toward resolution, social appropriateness, and alignment with the agent’s life script (its unconscious childhood plan). The script is what makes the agent consistently dysfunctional in the same way, which is what makes it feel human.
4. TA “games” as a validation target.
- They don’t just claim realism — they pick a named, well-documented human pattern (the Stupid game) and check whether the architecture reproduces it spontaneously. The behavioral theory provides a falsifiable prediction.
Honest read: the components (ReAct, FAISS, LangGraph, GPT-4o) are all off-the-shelf. The novelty is the composition — using a psychological theory to dictate the sub-agent decomposition, the memory partition, and the arbitration rule. That’s repackaging in the best sense: a known toolkit arranged to a new and well-motivated blueprint.
How It Works (Technically)
Think of one Trans-ACT agent as a tiny committee. A situation comes in (e.g., “Alex just told you the financial report has a critical error”). Three committee members — Parent, Adult, Child — each go look up their own memories, each draft a reply, and then a chairperson picks one reply to actually say, guided by the agent’s life script.
Let’s trace one real turn for Jordan (scripted to play helpless), reacting to Alex pointing out his mistake.
Step 1 — The situation is broadcast to all three ego states. Each ego state is a ReAct agent: it can reason (“is this a threat? do I have a memory for this?”) and act (call the memory-search tool, up to 5 times).
Step 2 — Each ego state retrieves from its own memory. Memories are stored as JSON objects with fields {context, reaction, emotions, tone}. The context text is embedded with an OpenAI embedding model and indexed in a FAISS vector store — one store per ego state. Retrieval is a cosine-similarity top-k search.
What cosine similarity actually computes: embed the current situation into a vector q, embed each stored memory’s context into a vector m. The score is
cos(q, m) = (q · m) / (‖q‖ · ‖m‖)
In plain English: it measures the angle between two meaning-vectors, ignoring their length. Score near 1 = “these two situations mean almost the same thing”; near 0 = unrelated. “Top-k” just means “hand back the k most-similar memories.” Because Jordan’s Child store is full of panicky childhood memories and his Adult store has factual problem-solving memories, the same error-report query lights up totally different memories in each ego — and that divergence is the whole point.
The agent decides for itself whether a retrieved memory is relevant; if not, it can re-query (different search terms) or, after the 5-call cap, just invent an original response. The cap is a deliberate guard against agents looping forever hunting for a perfect memory — a real failure mode in retrieval-augmented agents.
Step 3 — Three candidate responses exist. Parent-Jordan might draft a self-critical “you idiot, you always do this.” Adult-Jordan might draft “let me check the data entries.” Child-Jordan might draft “My head is spinning! I wish I was smart like you!”
Step 4 — The decision agent picks one. It scores each candidate on four axes: relevance, progress-toward-resolution, social-appropriateness, and life-script alignment. Jordan’s life script is “I need others to solve my problems.” So the Child’s helpless plea scores highest on script-alignment and gets selected — even though the Adult’s answer would actually resolve the problem. That tension (script beats competence) is what produces believable dysfunction.
Step 5 — Output goes to the other agent, whose own three-ego committee then reacts. Alex is scripted with the opposite script (“I prove my worth by fixing others’ mistakes”), so Alex’s committee keeps selecting the rescuer response (“I’ll handle this…”). The two scripts interlock into a self-reinforcing game: helplessness → rescue → more helplessness. Exactly what TA predicts.
Architecture & data flow
flowchart TB
S[Incoming situation / other agent's message] --> P
S --> A
S --> C
subgraph Agent["One Trans-ACT agent (e.g. Jordan)"]
P[Parent ego<br/>ReAct sub-agent] --> PM[(Parent<br/>FAISS store)]
A[Adult ego<br/>ReAct sub-agent] --> AM[(Adult<br/>FAISS store)]
C[Child ego<br/>ReAct sub-agent] --> CM[(Child<br/>FAISS store)]
PM -.top-k memories.-> P
AM -.top-k memories.-> A
CM -.top-k memories.-> C
P --> D{Decision agent}
A --> D
C --> D
LS[Life script] --> D
end
D -->|selected response| OUT[Spoken reply]
OUT --> OTHER[Other agent's committee]
Schematic of one turn: a situation hits all three ego states, each retrieves from its own memory and drafts a reply, then the decision agent scores the three drafts on four criteria. Drag the "life-script bias" slider to see how shifting script-alignment weight changes which ego wins — and watch the helpless/rescuer game lock in.
The algorithm, simplified
# One Trans-ACT agent taking one turn. Models stubbed; the structure is the contribution.
EGOS = ["parent", "adult", "child"]
def ego_state_turn(ego, situation, store, max_searches=5):
# Each ego is a ReAct loop: reason -> (maybe) search memory -> respond.
memories, query = [], situation
for _ in range(max_searches):
hits = store[ego].search(embed(query), top_k=3) # cosine sim in THIS ego's FAISS
if llm_says_relevant(ego, situation, hits):
memories = hits
break
query = llm_reformulate(ego, situation, hits) # agent decides to re-query
# Draft a reply colored by this ego's retrieved memories (or invent if none fit).
return llm_respond(ego, situation, memories) # {parent: scold, adult: fix, child: plea}
def decide(situation, candidates, life_script):
# The arbiter. Note: script-alignment can OUTWEIGH actually solving the problem.
def score(ego, reply):
return llm_judge(reply,
relevance=situation, resolution=situation,
social_fit=situation, script_fit=life_script) # 4 criteria, script is decisive
return max(candidates, key=lambda ego: score(ego, candidates[ego]))
def agent_turn(situation, stores, life_script):
candidates = {ego: ego_state_turn(ego, situation, stores) for ego in EGOS}
return decide(situation, candidates, life_script) # one voice gets to speak
The thing to internalize: personality is not a prompt string here — it’s an architecture. It lives in (a) what each memory store contains, and (b) how the arbiter weights script-alignment. Change those two and you get a different person.
Built on Prior Work
| Prior idea | What it gave | What this paper changes |
|---|---|---|
| ReAct (Yao et al. 2023) | Interleave reasoning + tool-use in an LLM loop | Used as the internal engine of each ego state, not the whole agent — three ReAct loops per agent |
| FAISS (Johnson et al. 2021) | Fast billion-scale vector similarity search | Run one store per ego state so retrieval routes by personality, not just by topic |
| Generative Agents (Park et al. 2023) | Memory + retrieval + reflection for believable agents | Adds internal conflict (competing egos) and a script-driven arbiter on top of memory |
| CoALA (Sumers et al. 2024) | Language-agent blueprint: memory / action / decision | Same three-part skeleton, but the decision module is psychodynamic (life script), not task-utility |
| SOAR / ACT-R (Laird 2022) | Symbolic cognitive architectures for rational cognition | Targets social/emotional cognition instead; positions TA as a complementary layer |
| Transactional Analysis (Berne 1958–1972) | Parent/Adult/Child ego states, life scripts, “games” | First (per the authors) to operationalize TA as an LLM agent’s actual control structure |
The lineage is “generative agents meet cognitive architectures, with a psychotherapy theory as the wiring diagram.”
Results & Evidence
What they tested: a single scripted scenario. Two agents — Jordan (helpless) and Alex (rescuer) — in a workplace setting where Alex flags an error in Jordan’s financial report. Each agent has 3 ego states and 10 memories (5 problem-related, 5 unrelated, to test whether retrieval picks the right ones). Underlying model: GPT-4o. Orchestration: LangGraph.
Headline qualitative findings:
- The game emerged. Jordan repeatedly performed helplessness (“My head is spinning! I wish I was smart like you!”) and Alex repeatedly took control (“I will handle this…”). The architecture reproduced the Stupid game’s victim/rescuer loop without being explicitly told to.
- Contextual grounding worked. Alex referenced specific errors (e.g., incorrect data entries), not generic commands — evidence the memory retrieval actually shaped responses.
- Ego differentiation was visible. Jordan responded mostly from Child (defensive, dependent); Alex mixed Parent authority with Adult empathy.
- The 5-search cap prevented retrieval loops — agents adapted to imperfect memory instead of searching endlessly.
What the evidence does NOT establish (be honest with clients about this):
- No quantitative metrics, no baseline. There’s no ablation showing the three-ego split beats a single well-prompted persona, no human-rating study, no statistical claim. It’s a demonstration, not a measurement.
- n = 1 scenario, 2 agents. Reproducing one game once is suggestive, not robust. The behavior was partly scripted in (Jordan was told to be helpless), so “the game emerged” is weaker than it sounds.
- Confounded with prompting. The authors themselves note “adjusting the prompts could significantly influence more nuanced state selection” — i.e., the result may be sensitive to prompt wording rather than to the architecture per se.
- Citation hygiene wobble. The text says GPT-4o but the reference points at a GPT-4.1 announcement URL — a small sign of an early-stage preprint.
Verdict: treat this as a well-motivated architecture pattern with an existence proof, not as validated science. The idea is the value; the experiment is a sketch.
How You’d Use It
This maps directly onto an AI-services offering around believable simulated humans — a category that’s underserved and that clients will pay for.
- Training simulators. Sales-rep, customer-support, manager-feedback, de-escalation, and clinical-interview practice. A trainee talks to a Trans-ACT agent scripted as “the defensive employee” or “the angry customer running the Why Don’t You / Yes But game,” and the agent stays believably difficult across the whole conversation instead of caving after one good reply. The per-ego memory + script arbiter is exactly what keeps a roleplay character from breaking character.
- Synthetic user research / focus groups. Spin up a population of agents with varied life scripts to pressure-test messaging, pricing, or policy. (The paper explicitly flags “predict how different populations react to a new policy.”) Caveat: validity is unproven — sell it as idea generation and stress-testing, not as a replacement for real respondents.
- Conflict-resolution / mediation tooling. The standout commercial angle: an agent that detects a transactional game in an ongoing human conversation (victim↔rescuer, persecutor↔victim) and suggests an intervention to break the loop. That’s a thin, high-value wrapper you could build on top of the same ego-classification machinery.
- NPC / interactive-fiction depth. Game and narrative studios want characters with consistent flaws. This is a clean recipe for “an NPC who is reliably the same kind of broken.”
Where it slots into an existing stack: it’s a drop-in pattern for any LangGraph/LangChain agent system. You’re adding a sub-graph per persona and a partitioned vector store — no model training required. Effort to a demo: days. Effort to a robust product: the validation work the paper skipped.
Build Your Own (Minimal Recipe)
Smallest version that captures ~80% of the value:
Components
- One LLM (GPT-4o / Claude / a strong open model) behind a single
llm(prompt)helper. - One embedding model + one vector store (FAISS locally, or pgvector/Chroma). Create three namespaces/collections per agent —
parent,adult,child. - A memory schema:
{context, reaction, emotions, tone}JSON. Hand-author ~5–10 per ego to start; the contents are where the personality lives, so this is worth real effort. - An orchestration graph (LangGraph or just a Python function) that fans a situation out to three ego-state calls and into one decision call.
Build order
- Stand up one ego state as a ReAct agent with a memory-search tool and the 5-call cap. Get it producing in-character replies.
- Clone it to three; give each its own collection. Verify the same query returns different memories per ego.
- Write the decision agent: a single LLM call that takes the three drafts + the life-script string and returns the chosen one with a one-line rationale. Make script-alignment explicitly one of the scored criteria.
- Loop two agents against each other; watch for an emergent pattern.
The 1–2 genuinely hard parts
- Authoring memories and scripts that actually produce distinct behavior. Garbage-in here gives you three identical egos. This is content design, not engineering, and it’s the real moat.
- Making the arbiter trustworthy. An LLM judge scoring four soft criteria is noisy; you’ll want a structured-output format and probably a few-shot rubric so “script alignment” doesn’t collapse into “just pick the most sensible reply” (which kills the whole effect).
Reach for: LangGraph (sub-graphs per agent), FAISS/Chroma, OpenAI/Cohere embeddings, and structured outputs (JSON mode / function calling) for the decision step.
How to Improve It
- Add an ablation + a judge. The biggest gap is evidence. Run single-persona vs. three-ego head-to-head, have humans (or an LLM rubric) rate “psychological realism” and “stays in character,” and measure how often a named game emerges. This turns a demo into a sellable claim.
- Reinforcement learning over ego selection (the authors’ own pitch). Treat the decision agent as a policy: state = conversation so far, action = which ego speaks, reward = some signal of social outcome (de-escalation, goal progress, staying in-script-or-not depending on your aim). Even bandit-style or DPO-from-preferences updating of the arbiter would let agents evolve their scripts — e.g., a Child-dominant agent learning to let the Adult take over, modeling real personal growth. Start with offline preference data before anything online.
- Dynamic, writable memory. Right now memories are static. Let conversations write back new memories (with emotional tagging), so the agent accumulates experience — and add TA “trading stamps” (stored unexpressed negative feelings) that build up and trigger a disproportionate Child outburst once a threshold is crossed. That single mechanic would add a lot of believable volatility.
- A game-detection classifier as a standalone product. Decouple the recognizer from the simulator: train/prompt a model to label ongoing human dialogue with the TA game being played and the ego-state of each utterance. That’s independently useful for coaching, mediation, and QA on support transcripts.
- Scale the cast and add structure. Two agents is a duet; social dynamics need a crowd. Combine with an environment (rooms, roles, hierarchy) and test whether group-level patterns (scapegoating, coalition-forming) emerge — and whether they match what social psychology predicts. That’s the path from “cute demo” to “research instrument.”
- Second-order ego structure. TA itself has finer structure (P2/A2/C2 sub-states). Modeling a “Child within the Parent” as nested sub-agents could capture contradictions like a harsh-but-frightened authority figure — richer characters at the cost of more LLM calls.
Glossary
- Transactional Analysis (TA) — A 1960s theory of personality and social interaction (Eric Berne) built on ego states, life scripts, and “games.”
- Ego state (Parent / Adult / Child) — Three modes a person operates from: internalized authority (Parent), rational here-and-now processing (Adult), and childhood-rooted emotion (Child). Here, each is a separate sub-agent.
- Life script — An unconscious “plan for life” formed in childhood that drives repetitive, self-confirming behavior; here, a string the arbiter optimizes responses against.
- Game (in TA) — A repetitive, semi-conscious sequence of transactions with a hidden motive and a predictable payoff (e.g., Stupid: act helpless to get rescued).
- ReAct — An agent loop that interleaves chain-of-thought Reasoning with Acting (tool calls); each ego state runs one.
- FAISS — Facebook AI Similarity Search; a library for fast nearest-neighbor lookup over embedding vectors.
- Embedding — A numeric vector that captures the meaning of a piece of text so similar meanings sit close together.
- Cosine similarity — A score (0–1ish) for how aligned two vectors point, used to find the most relevant stored memories regardless of text length.
- Top-k retrieval — Returning the k most similar stored items for a query.
- LangGraph — A framework for building agent workflows as graphs of nodes (used here to wire ego sub-agents into each agent’s turn).
- Cognitive architecture — A structured model of how cognition works (SOAR, ACT-R, CoALA); TA is being used here as a social-cognitive one.
- Agent-based modeling (ABM) — Simulating a system by modeling many individual interacting agents to study emergent group behavior.
- Reinforcement learning (RL) — Learning a behavior policy from reward signals; proposed (not implemented) to let agents adapt their ego selection and scripts over time.