3.9 KiB
3.9 KiB
Character Agent System
Character agents are the core AI entities that combine memory, personality, and conversational ability into believable characters that evolve through their experiences.
🎭 Agent Architecture
Core Components
- Memory Stream: Stanford-inspired memory architecture
- Character Data: Structured personality and relationship info
- LLM Integration: Natural language processing and generation
- Trait System: Dynamic personality development
- Response Generation: Context-aware conversation handling
Character Creation Process
- Template Loading: YAML files define initial memories
- Memory Initialization: Observations, reflections, and plans loaded
- Importance Scoring: All memories rated for significance
- Character Extraction: LLM generates structured character data
- Agent Ready: Fully functional roleplay partner
📝 Character Templates
YAML Structure
observations:
- "My name is Alice and I am 23 years old"
- "I study Victorian literature at university"
- "I spilled coffee yesterday and felt embarrassed"
reflections:
- "I have romantic feelings for Emma (evidence: daily visits, heart racing)"
- "I am naturally shy in social situations (evidence: nervous with strangers)"
plans:
- "I want to work up courage to talk to Emma"
- "I need to finish my thesis chapter this week"
Memory Types in Templates
Observations: Factual experiences and basic information
- Identity facts (name, age, occupation)
- Recent experiences and events
- Relationship interactions
- Physical descriptions and traits
Reflections: Character insights and self-understanding
- Personality trait recognition
- Relationship feelings and dynamics
- Behavioral pattern awareness
- Values and belief formation
Plans: Future intentions and goals
- Short-term objectives
- Long-term dreams and aspirations
- Relationship goals
- Personal development aims
🎯 Response Generation
Context Building Process
- Query Analysis: Understand what user is asking
- Memory Retrieval: Find relevant memories using smart scoring
- Context Assembly: Combine character info + relevant memories
- Prompt Construction: Use template system for consistency
- LLM Generation: Natural language response in character
- Memory Update: Store new experience from interaction
Response Style
- First Person Past Tense: "I looked up and smiled nervously..."
- Character Consistency: Responses match established personality
- Memory Integration: References past experiences naturally
- Emotional Authenticity: Shows appropriate feelings and reactions
🔄 Character Development
Dynamic Personality Growth
Characters evolve through experience:
- New Experiences: Each interaction creates memories
- Trait Analysis: System evaluates personality impact
- Trait Updates: Strengths/weaknesses adjust over time
- Reflection Generation: Insights emerge from patterns
- Behavioral Consistency: Future responses reflect growth
Trait System
- Incremental Development: Traits strengthen/weaken with evidence
- Evidence-Based: Every trait change linked to specific experiences
- Single-Word Names: Simple, clear personality descriptors
- Strength Ratings: 1-10 scale for trait intensity
- Dynamic Descriptions: How traits manifest in behavior
🔮 Future Vision: Multi-Agent Interactions
Planned Features
The system is designed with future multi-agent capabilities in mind:
- Characters will be able to interact with each other
- Conversations will create memories for all participants
- Relationship dynamics will develop naturally
- Information will spread through character networks
- Emergent social behaviors will arise from interactions
Currently, the focus is on perfecting single-agent character development and ensuring each character becomes genuinely complex and believable through their individual growth.