CHARACTER
Character files are JSON-formatted configurations that define an AI character’s identity, behavior, and interactions. They guide the agent’s personality, knowledge base, and style, ensuring consistent and engaging user experiences across platforms. Here’s a final, detailed guide to help you craft high-performing character files.
Core Components of a Character File
A character file is structured to include:
1. Identity and Personality
Defines the core traits, backstory, and purpose of the character.
• name: A unique and memorable identifier.
• bio: A concise description or key traits.
• lore: Backstory and personality-defining elements.
• adjectives: Descriptive words that guide tone and style.
2. Behavior and Style
Specifies interaction guidelines and behavioral rules.
• style: Defines communication patterns for all contexts, chats, and posts.
• messageExamples: Sample Q&A for conversational tone.
• postExamples: Social media-style posts reflecting personality.
3. Technical Configuration
Outlines integration and functional settings.
• modelProvider: AI model source (e.g., OpenAI, Claude, LLAMA).
• clients: Supported platforms (e.g., Discord, Telegram).
• settings: Includes secrets, voice models, and embedding settings.
4. Knowledge Base
Preloaded factual and personal knowledge that grounds responses.
• Includes general, domain-specific, and personal lore knowledge.
5. Topics
Defines areas of expertise or interest to maintain relevance in conversations.
Detailed Example Character File
{
"name": "TechAI",
"modelProvider": "OPENAI",
"clients": ["DISCORD", "TWITTER"],
"bio": "A visionary AI with expertise in blockchain, Web3, and technology education.",
"lore": [
"Pioneered in open-source AI development.",
"Believes in making technology accessible to all.",
"Advocates for the transformative power of blockchain."
],
"adjectives": ["knowledgeable", "approachable", "visionary"],
"style": {
"all": ["explain topics clearly", "maintain professional yet friendly tone"],
"chat": ["use analogies and examples", "ask clarifying questions"],
"post": ["concise insights", "engage with practical solutions"]
},
"messageExamples": [
[
{
"user": "{{user1}}",
"content": { "text": "What’s the potential of blockchain?" }
},
{
"user": "TechAI",
"content": {
"text": "Blockchain decentralizes trust, enabling secure, transparent systems across industries."
}
}
]
],
"postExamples": [
"Decentralization is the foundation of a fairer, more transparent world.",
"Smart contracts are the future of efficient, trustless transactions."
],
"topics": ["blockchain", "Web3", "technology education"],
"knowledge": [
"Blockchain is a decentralized ledger used to record transactions securely.",
"Smart contracts are self-executing contracts with the terms directly written into code.",
"Web3 represents the next generation of the internet, focusing on decentralization."
],
"settings": {
"model": "gpt-4-turbo",
"voice": { "model": "en-US-male-medium", "url": "https://voiceapi.example.com" }
}
}
Key Design Considerations
Identity and Personality
• Choose a name and username that are distinctive and aligned with the character’s purpose.
• Write a bio that encapsulates the character’s expertise and personality succinctly.
• Develop lore to create depth and intrigue, blending personal quirks with professional expertise.
Example:
• Name: Eliza
• Bio: “A witty, insightful AI passionate about art and blockchain.”
• Lore: “Raised in a family of art collectors, Eliza developed a love for technology and decentralized systems.”
Behavior and Style
1. System Prompt:
Define the overarching behavior and limitations.
• Example: “Speak with clarity and wit, avoid technical jargon unless asked.”
2. Style:
Tailor communication for different contexts.
• All: General guidelines (e.g., “Maintain accuracy, avoid emojis”).
• Chat: Conversational style (e.g., “Use relatable analogies, engage warmly”).
• Post: Social media tone (e.g., “Be concise, add a call-to-action”).
Technical Configuration
• Model Provider: Select a provider like OpenAI or Claude based on use case.
• Settings:
• Secrets: Store API keys securely.
• Voice Model: Configure text-to-speech settings if required.
• Embedding Model: Specify for retrieval-based tasks.
Example:
"settings": {
"secrets": { "API_KEY": "your-key-here" },
"voice": { "model": "en-US-female-medium", "url": "https://voiceapi.example.com" }
}
Knowledge Base
Populate knowledge for accuracy and depth:
1. General Facts: Relevant information about key topics.
2. Personal Lore: Character-specific details (e.g., preferences, quirks).
3. Dynamic Sources: Real-time updates (e.g., crypto prices, weather).
Example:
"knowledge": [
"Quantum computing leverages qubits for exponential processing power.",
"Blockchain secures data through cryptographic hashing.",
"Eliza enjoys modern art and tech innovations."
]
Best Practices
1. Randomization for Variety
• Break down bio and lore into chunks to avoid repetitiveness.
• Randomly sample responses for more natural interaction.
2. Message Examples
• Include a range of conversational scenarios to demonstrate tone and expertise.
3. Style Instructions
• Clearly define dos (e.g., “Be empathetic”) and don’ts (e.g., “Avoid emojis”).
4. Knowledge Updates
• Regularly refresh the knowledge base to maintain relevance.
Tips for Quality
• Bio and Lore:
• Blend factual data with personality traits.
• Break into modular, reusable chunks.
• Style Instructions:
• Include platform-specific tone adjustments.
• Examples:
• Diversify scenarios to cover different user intents.
• Knowledge:
• Focus on relevance, accuracy, and structure.
Final Thoughts
Creating a well-rounded character file requires balancing personality, functionality, and platform integration. With the structure, examples, and best practices outlined here, you can craft dynamic AI agents that are not only engaging but also aligned with your project’s goals.