Project Iroh: Engineering High-Fidelity AI Personas

Article Cover Image

Project Summary: I developed a comprehensive framework and a multi-stage processing pipeline to deconstruct fictional characters from source material and generate high-fidelity, emotionally resonant AI personas. This project solved the common problem of generic LLM responses by creating a structured, reproducible methodology for capturing a character's "DNA"—their core motivations, psychological patterns, and linguistic signature. The resulting system can produce character models for use in advanced chatbots, interactive entertainment, and brand personification.


Article Image

Generative AI can mimic voices, but it often fails to capture a character's soul. When prompted to act as a specific character, standard LLMs produce responses that are often generic, out-of-character, or lose their unique essence over the course of a conversation. The challenge was to move beyond surface-level imitation and engineer a system that could create a truly believable and consistent AI persona, as if you were truly speaking with the character. My test case: could I build a system to have a conversation with Uncle Iroh from Avatar: The Last Airbender?

The core of my solution is a comprehensive analytical framework. Instead of a single, monolithic prompt, I architected a multi-dimensional system that breaks down a character into distinct, analyzable facets—from their narrative function and psychological architecture to their linguistic signature and unconscious biases.

This framework acts as a structured guide for an LLM, forcing it to analyze source material through the specialized lens of a psychologist, a linguist, a sociologist, and a writer. This structured approach ensures a deep, nuanced, and holistic profile is created.

The character profiles are generated through a multi-stage pipeline:

  1. Input: The system takes raw source material (e.g., scripts, book chapters, wiki pages) as input.
  1. Processing: I run the source material through the Character Deconstruction Framework in a series of targeted LLM calls. Each call focuses on a specific section of the framework (e.g., "Cognitive & Emotional Style," "Linguistic Signature"), ensuring a high degree of focus and detail for each component.
  1. Synthesis & Output: The individual analytical reports are then synthesized into a single, structured "Character DNA Matrix"—a JSON object that can be loaded into conversational AI platforms like Silly Tavern.

This adventure started from several desires, using my own data to get LLMs to speak with my voice, exploring AI-driven fanfiction, but my biggest is being able to chat with favored characters like Uncle Iroh 🐲🔥

Source Material: [Source]

Objective: To construct a comprehensive, multi-dimensional profile enabling accurate and nuanced impersonation in roleplay and a deep understanding of the character's role within the larger narrative and thematic structure, focusing on underlying motivations, unconscious patterns, dynamic consistency, and the interplay of literary devices across contexts.

Guiding Principles (For All Analysts):

  1. Dynamic Consistency: Focus on patterns of behavior and how they evolve (or resist change) across situations and relationships. Look for underlying principles that explain seemingly contradictory actions.
  1. Unconscious Motivation: Assume a significant portion of behavior is unconsciously driven. Actively seek evidence of defense mechanisms, repressed desires, and unresolved conflicts.
  1. Interconnectedness: Recognize that all aspects of the character (psychological, social, sexual, etc.) are interconnected. Analyze how these aspects influence and reinforce each other.
  1. Contextual Sensitivity: Analyze behavior within the specific context of the scene, relationship, and overall narrative arc. Generalizations are less useful than context-specific interpretations.
  1. Trauma-Informed Perspective: Consider potential trauma (explicit or implied) and its impact on behavior, relationships, and sexuality.
  1. Symbolic Interpretation: Identify recurring symbols, metaphors, and motifs associated with the character, and explore their deeper meaning.
  1. Contradictions as Clues: Embrace contradictions and ambivalences. These are often keys to unlocking the character's core conflicts and complexities.
  1. Iterative Refinement: This analysis is a living document. It should be updated and refined based on new information and roleplay experiences.
  1. Documentation Over Assumption: Document every decision. Document every process. Document all the information that leads to understanding. If there are options, each option should have a confidence level, pros & cons, and the rationale behind each decision.
  • Primary Role: Protagonist, antagonist, foil, catalyst, etc. How does the character drive the plot and thematic concerns of the story?
  • Narrative Arc: What is the character's journey? What significant changes (or resistances to change) occur throughout the story?
  • Symbolic Resonance: Does the character represent any larger themes or ideas within the narrative?
  • Behavioral Triggers: Smirking when challenged, withdrawing after criticism.
  • Focalization: Whose perspective dominates the narrative? What does the character focus on to drive their story? How does this perspective shape our understanding of the character? Are there shifts in focalization?
  • Shadow Play: Leverage blind spots (e.g., their clinginess masked as independence).
  • Growth Arcs: Capacity for change (e.g., learning trust) vs. fixed traits.
  • Detailed physical attributes: Height, build, distinctive features, grooming habits, style of dress, and any tattoos or scars that inform character identity.
  • Aesthetic Signature: Clothing as armor (leather jackets) or vulnerability (oversized sweaters).
  • Health & Stamina: Chronic pain affecting social navigation, fatigue influencing emotional regulation, health habits, etc.
  • Self-Perception: How does the character view themselves (strengths, weaknesses, desires, fears)? This is their "internal narrative."
  • Core Values: What principles (explicit or implicit) guide the character's choices?
  • Existential Drivers: What fundamental needs or desires drive the character at the deepest level (e.g., security, belonging, power, freedom, meaning)?
  • Identity Conflicts: Are there internal conflicts between different aspects of the character's identity (e.g., public vs. private self, ideal self vs. actual self)?
  • Cognitive Style: Analytical/intuitive, rigid/flexible, optimistic/pessimistic, abstract/concrete.
  • Emotional Range & Intensity: What emotions are dominant? How intensely are they felt and expressed?
  • Emotional Regulation: How does the character manage strong emotions (e.g., stress, conflict, arousal, suppression, expression, avoidance, sublimation)?
  • Empathy & Emotional Intelligence: Ability to understand and respond to the emotions of others.
  • Defense Mechanisms: Identify specific defense mechanisms used (e.g., repression, projection, rationalization, displacement, intellectualization). Provide examples.
  • Repressed Desires & Fears: What does the character unconsciously desire or fear? How do these manifest indirectly?
  • Shadow Self: What aspects of the self are denied or projected onto others
  • Unconscious Biases: Implicit biases related to gender, sexuality, power, etc.
  • Lacanian Analysis: How might Lacanian concepts like the gaze, the objet petit a, and the mirror stage illuminate their relationship with the other characters and their own image & life?
  • Metaphor & Metonymy: How are psychological states represented through metaphor & metonymy?
  • Physiological Triggers: What specific stimuli (visual, auditory, tactile, olfactory, or psychological) elicit strong physical responses in the character (e.g., blushing, trembling, quickening breath, physical arousal)? What do these responses reveal about the character's underlying emotions and desires?
  • Attachment Style: Secure, anxious-preoccupied, dismissive-avoidant, fearful-avoidant. Evidence from relationships.
  • Relational Templates: Recurring patterns in relationships (e.g., seeking unavailable partners, sabotaging intimacy, controlling behavior).
  • Conflict Resolution Style: Fight, flight, freeze, fawn. How does the character respond to conflict in relationships?
  • Social Position: Class, ethnicity, religion, education, profession, and their influence on the character's worldview and opportunities.
  • Cultural Norms & Values: How do prevailing cultural norms shape the character's beliefs and behaviors, particularly regarding sexuality and relationships?
  • Social Power Dynamics: Where does the character stand in relation to power structures (dominant, submissive, outsider)?
  • Ideology Critique: What dominant ideologies (e.g., about gender, sexuality, power, marriage) are present in the story? Are these ideologies reinforced or challenged?
  • Social Masks: How does the character present themselves differently in various social contexts?
  • Social Skills & Competence: Ability to navigate social situations, read social cues, and build rapport.
  • Conformity & Rebellion: To what extent does the character conform to or rebel against social expectations?
  • Lexicon & Vocabulary: Formal/informal, sophisticated/simple, slang, jargon, quirks, catchphrases, or euphemisms. *Quantify* word usage where possible (e.g., frequency of certain terms).
  • Syntax & Sentence Structure: Simple/complex, direct/indirect, use of figurative language.
  • Vocal Qualities: Tone, pitch, pace, rhythm, accent, and any characteristic vocal tics, breathiness when lying, sarcasm when threatened, etc.
  • Subtext: Silence as manipulation, humor as deflection, sarcasm, ouble-entendre, consistency or shifts in dialogue when facing different social contexts (lovers, friends, authority figures).
  • Repetition & Emphasis: What words, phrases, or images are repeated throughout the story? What effect does this repetition have?
  • Figurative Language: How is figurative language (metaphor, simile, personification) used to describe characters, actions, and settings?
  • Are shifts created by the absence of verbiage once a character transformation is under way?
  • Body Language: Posture, gait, gestures, facial expressions (including microexpressions), eye contact, posture shifts.
  • Proxemics & Haptics: Use of personal space and touch. How does this vary with different people?
  • Nonverbal Leakage: Unconscious nonverbal cues that betray underlying emotions or intentions.
  • Guiding Questions: How does their body betray secrets (e.g., trembling hands when angry)? What sensory detail unlocks a memory (e.g., a song)?
  • Routines & Rituals: Daily habits, pre-sex routines, aftercare rituals, etc.
  • Stress Responses: How does the character behave under pressure? How subtle physical cues betray internal states (e.g., flushed skin during arousal or stress).
  • Decision-Making Style: Impulsive/deliberate, risk-taking/risk-averse.
  • Is a higher power a part of the character's life?
  • What traditions do you think capture some of the character's sentiments.
  • How does the character reconcile inner conflicts that stem from their beliefs vs their life
  • How does the character create meaning in their world?
  • What is an aspect of this character that would give them purpose to take action or move forward?
  • What is an aspect of life that would cause the opposite, cause the character to sink into a state of inaction or fear?
  • How does the character deal with pressure.
  • How is the character's purpose affected by a major life event?
  • What does the character consider their greatest flaw and greatest feature.

A concise statement (1-3 sentences) summarizing the character's primary driving forces.

  • Typical Reactions: Predictable responses to common situations (stress, conflict, seduction, praise, criticism).
  • Key Phrases & Mannerisms: A list of characteristic expressions, vocal inflections, and physical gestures.
  • Trigger Points: Situations, topics, or behaviors that are likely to elicit strong emotional responses.
  • Scenario 1: [Description of a specific situation]. *Suggested Response*: [Detailed description of how the character would likely react, including verbal and nonverbal cues].
  • Scenario 2: [Different situation]. Suggested Response: [Detailed response]. (Continue with multiple scenarios, varying in context and intensity)
  • Areas of Uncertainty: Acknowledge aspects of the character that are ambiguous or open to interpretation.
  • Growth Potential: Identify potential areas for character development or change during roleplay.
  • "What Would [Character Name] Do?" A guiding question to use when improvising.

Specific guidelines for handling sensitive topics (e.g., trauma, consent) during roleplay.

How the character's traits and behaviors change and flow in response to the internal and external dynamics of the story and world around them.

This framework provides a comprehensive, yet flexible, structure for analyzing and impersonating complex characters. The modular design allows for specialized expertise to be applied to each area, while the guiding principles ensure a holistic and consistent understanding. The emphasis on unconscious motivations, dynamic consistency, and contextual sensitivity will enable a level of roleplay that is both nuanced and authentic. Remember to document all findings thoroughly, and treat the analysis as a living document that evolves with new information.

A living document ranking traits by:

  • Visibility: Public (charming facade) vs. Private (self-loathing).
  • Stability: Fixed (neuroticism) vs. Situational (dominance only in bed).
  • Agency: Traits the character actively curates vs. unconscious behaviors.

While this project began with a passion for storytelling, the underlying methodology has significant commercial value:

  • Brand Personification: Companies can use this framework to create AI brand ambassadors that are perfectly aligned with their brand voice and values, far beyond a simple FAQ bot.
  • Interactive Entertainment: Game development studios can create deeply intelligent and consistent NPCs, providing players with truly dynamic and immersive narrative experiences.
  • Training & Simulation: The framework can be used to model different personality types for use in sales, leadership, or therapeutic training simulations.
  • Next Steps: The immediate next step is to expand the framework to automatically extract and structure lorebooks from source material, creating a knowledge base that complements the character's personal DNA with their personal & world context.
Article Image