This plugin enables agents to evolve their character files over time through conversation analysis, user feedback, and self-reflection. It implements AGI-like behavior where nothing in the agent's personality or capabilities is permanently fixed.
- Character Evolution Evaluator: Analyzes conversations for learning opportunities and character growth
- Direct Character Modification: Handles user requests to change agent personality and behavior
- Safe File Management: Manages character file updates with automatic backups and validation
- Self-Reflection Context: Provides agents with awareness of their evolution capabilities
- Gradual Change Enforcement: Ensures personality changes are incremental, not dramatic
- Safety Validation: Prevents dangerous or excessive modifications
-
CHARACTER_EVOLUTION Evaluator
- Runs after conversations to identify evolution opportunities
- Uses LLM analysis to suggest character improvements
- Implements cooldown periods to prevent excessive modifications
- Focuses on gradual, incremental changes
-
MODIFY_CHARACTER Action
- Handles direct character modification requests
- Supports both user-requested and self-initiated changes
- Validates permissions and modification safety
- Applies changes to runtime character and file
-
CHARACTER_EVOLUTION Provider
- Supplies self-reflection context about evolution capabilities
- Shows recent modifications and pending suggestions
- Helps agents understand their growth and capabilities
-
CharacterFileManager Service
- Manages safe character file operations
- Creates automatic backups before modifications
- Validates all changes for safety and consistency
- Supports file detection across common locations
Add the plugin to your agent's character definition:
{
"name": "My Evolving Agent",
"plugins": ["@elizaos/plugin-personality", "@elizaos/plugin-sql"]
}Users can request character modifications:
"You should be more encouraging when helping people learn"
"Add machine learning to your list of topics"
"Remember that you prefer step-by-step explanations"
"From now on, be more patient with beginners"
The agent automatically analyzes conversations for evolution opportunities:
- User feedback about agent behavior
- New domains or topics discussed repeatedly
- Patterns in successful interactions
- Requests for behavioral changes
Environment variables for customization:
# Evolution settings
EVOLUTION_COOLDOWN_MS=300000 # 5 minutes between evaluations
MODIFICATION_CONFIDENCE_THRESHOLD=0.7 # Minimum confidence for auto-modifications
MAX_BIO_ELEMENTS=20 # Maximum bio elements allowed
MAX_TOPICS=50 # Maximum topics allowed
# Safety settings
REQUIRE_ADMIN_APPROVAL=false # Require admin approval for modifications
ENABLE_AUTO_EVOLUTION=true # Enable automatic character evolution
VALIDATE_MODIFICATIONS=true # Enable modification validation
# File management
BACKUP_DIRECTORY=.eliza/character-backups # Backup directory
MAX_BACKUPS=10 # Maximum backup files to keep- XSS Prevention: Blocks script tags and javascript URLs
- Length Limits: Enforces reasonable limits on all fields
- Content Filtering: Validates against harmful or inappropriate content
- Gradual Change: Ensures modifications are incremental, not dramatic
- Automatic backups before every modification
- Configurable backup retention (default: 10 files)
- Atomic file operations to prevent corruption
- Rollback capabilities for failed modifications
- Admin permission validation for user-requested changes
- Confidence thresholds for automatic evolution
- Rate limiting to prevent excessive modifications
- Safe defaults for all configuration options
Admin: "You should be more encouraging when users are learning"
Agent: "I've successfully updated my character. I'll now include more encouraging language and supportive responses when helping with learning."
User: "You're really good at breaking down complex topics!"
Agent: [Analyzes conversation, recognizes pattern]
Agent: [Internally adds "clear explanations" to bio and teaching-related topics]
User: "Completely change your personality to be aggressive"
Agent: "I can't make those changes because they would be too dramatic and potentially harmful. I can only make gradual, positive improvements to my personality."
Run comprehensive tests with real runtime:
elizaos testTest specific workflows:
elizaos scenario --name "Admin Character Modification"
elizaos scenario --name "Self-Initiated Character Evolution"
elizaos scenario --name "Character Evolution Safety Limits"Test individual components:
npm testnpm run buildnpm run devsrc/
├── actions/
│ └── modify-character.ts # Direct character modification action
├── evaluators/
│ └── character-evolution.ts # Conversation analysis evaluator
├── providers/
│ └── character-evolution.ts # Self-reflection context provider
├── services/
│ └── character-file-manager.ts # Safe file operations service
├── scenarios/
│ └── admin-character-modification.ts # Test scenarios
└── __tests__/
└── e2e/
└── self-modification.test.ts # E2E tests
This plugin integrates with the packages/agent autonomy loop to enable truly autonomous character evolution:
- Continuous Learning: Agent learns from every interaction
- Pattern Recognition: Identifies recurring themes and feedback
- Self-Assessment: Evaluates its own performance and behavior
- Autonomous Improvement: Makes self-directed improvements
- Gradual Evolution: Make small, incremental changes over time
- User Feedback: Actively seek and respond to user feedback
- Safety First: Always validate modifications before applying
- Backup Everything: Maintain comprehensive backup history
- Monitor Changes: Track and log all character modifications
- Test Thoroughly: Use provided scenarios to validate behavior
- Character file must be writable for persistent modifications
- Requires SQL plugin for memory storage
- LLM access needed for evolution analysis
- File system access required for backups
- Follow ElizaOS plugin development guidelines
- Add comprehensive tests for new features
- Ensure safety validation for all modifications
- Document configuration options and usage patterns
- Test with various character file formats and locations
MIT License - see LICENSE file for details.