Overview
The character schema defines the personality, knowledge, and behavior of your AI agent. Character files are JSON documents that configure how the agent communicates, what it knows, and how it interacts on social media.Schema Structure
Basic Information
The character’s name. Used as the agent’s identity.
Twitter/X account ID for social media integration.
Array of client platforms the agent will use.
LLM provider. Currently supports “anthropic”.
System-level instruction for the agent’s primary function.
Personality Configuration
Array of strings describing the character’s background, roles, and identity.
Array of strings defining the character’s beliefs, vision, and worldview.
Array of strings describing the character’s expertise and areas of knowledge.
Array of adjectives describing the character’s personality traits.
Communication Style
Object containing style guidelines.
Array of strings defining writing style, tone, and communication patterns for all contexts.
Array of example posts demonstrating the character’s writing style. Can contain thousands of examples.
Array of conversation examples showing interaction patterns. Each example is an array of message objects.
Topics and Interests
Array of topics the character is interested in or knowledgeable about.
Social Media Configuration
Array of Key Opinion Leaders (KOLs) for the agent to interact with.Each KOL object contains:
username: Twitter handleuser_id: Twitter user ID
Complete Example
Usage
Setting Character File
Specify the character file in your.env:
Loading Characters
Theinitialize_agent() function automatically loads the character:
Multiple Characters
You can specify multiple character files (comma-separated):Character Processing
Theprocess_character_config() function transforms the JSON into an agent personality prompt:
- Extracts bio, lore, knowledge, and style guidelines
- Selects random post examples (up to 10)
- Formats everything into a structured prompt
- Returns a personality string used as the agent’s
state_modifier
Best Practices
Bio
- Keep entries concise (one line each)
- Focus on roles, affiliations, and identity
- Include relevant credentials and expertise
Lore
- Define beliefs and worldview
- Establish philosophical positions
- Show what the character cares about
Knowledge
- List specific areas of expertise
- Include both technical and soft skills
- Mention personality traits (humor, etc.)
Style Guidelines
- Be specific about writing patterns
- Include length preferences (character counts)
- Define tone and voice characteristics
- Specify emoji usage preferences
- Note any special formatting or vocabulary
Post Examples
- Provide many examples (10-1000+)
- Show variety in topics and formats
- Demonstrate the actual voice and style
- Can be scraped from existing Twitter accounts
KOL List
- Include relevant influencers in your domain
- Both username and user_id are required
- Used for automated social media interactions
Template File
A template character file is available at:Related Documentation
- Agent Initialization - How characters are loaded
- Environment Variables - CHARACTER_FILE configuration