A persona in Anam is an AI-powered digital human that can have natural, real-time conversations with your users. Think of it as a customizable avatar with a brain, voice, and personality.

The Persona Configuration

Every persona is defined by a configuration object that brings together three essential components. Here’s what a complete persona config looks like:

const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: "You are Cara, a helpful customer service representative. You're friendly, knowledgeable, and always try to solve problems efficiently. Keep responses conversational and under 50 words unless explaining something complex."
};

This single configuration object defines everything about your persona - how they look, sound, and behave. Let’s break down each component and how it maps to the configuration.

Anatomy of a Persona

1. Persona Name

Config field: name

The name of your persona. This is optional but recommended for internal organization and debugging. It doesn’t affect how the persona behaves, but helps you identify different personas in logs and analytics.

const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: "You are Cara, a helpful customer service representative. You're friendly, knowledgeable, and always try to solve problems efficiently. Keep responses conversational and under 50 words unless explaining something complex."
};

2. Avatar (Visual Appearance)

Config field: avatarId

The face and expressions users see. You can choose from our gallery or create custom avatars using our one-shot avatar generator (enterprise only).

const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: "You are Cara, a helpful customer service representative. You're friendly, knowledgeable, and always try to solve problems efficiently. Keep responses conversational and under 50 words unless explaining something complex."
};

3. Voice (How They Sound)

Config field: voiceId

The speech synthesis that brings your persona to life. Different voices convey different personalities and work better for different use cases. You can sample some of the available voices in our voice gallery.

const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: "You are Cara, a helpful customer service representative. You're friendly, knowledgeable, and always try to solve problems efficiently. Keep responses conversational and under 50 words unless explaining something complex."
};

4. Brain (Intelligence & Personality)

Config fields: brainType and systemPrompt

The AI model and instructions that define how your persona thinks, responds, and behaves during conversations.

const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: "You are Cara, a helpful customer service representative. You're friendly, knowledgeable, and always try to solve problems efficiently. Keep responses conversational and under 50 words unless explaining something complex."
};

Available Brain Types

Choose the brain type that best fits your use case and performance requirements:

Best for: Most applications

A fast, cost-effective brain powered by GPT-4o Mini. Offers excellent performance for conversational AI with quick response times and reasonable costs.

brainType: "ANAM_GPT_4O_MINI_V1"

Experimenting with configurations

The easiest way to experiment with the available avatars, voices, and brain options is to use the playground in the Anam Lab. From the build page, you can use the settings menu to change the available options and preview over 400 available voices. When you’re happy with your configuration, you can copy the avatar ID and voice ID from the settings bar to use in your own application.

Persona Lifecycle

Understanding how personas work helps you build better experiences:

1

Configuration

You define the persona’s appearance, voice, and personality in the persona configuration object

2

Session Token Creation

Your server uses your API key to exchange your persona configuration for a secure session token

3

Initialization

The client uses the session token to initialize the persona and start the session

4

Conversation

Real-time back-and-forth communication begins between the persona and the user

5

Session End

The conversation concludes and the session is cleaned up

Creating Effective Personas

Creating an effective persona requires thoughtful design across multiple dimensions. When you create a persona, the system prompt you choose defines how the persona will respond to your users. Focus on crafting a well-defined identity, personality, and communication style.

Defining Core Identity

Your persona’s identity is the foundation of its interactions. Start by clearly establishing:

  • Specific role: What function will your persona fulfil (customer support, sales assistant, product specialist, etc.)
  • Areas of expertise: Knowledge relevant to your business and users
  • Interaction scope: Types of conversations it should handle
  • Clear boundaries: Capabilities and limitations to prevent confusion

System Prompts That Work

Your system prompt is crucial - it defines your persona’s personality and behavior.

// ❌ Too vague
systemPrompt: "You are helpful."

// ✅ Specific and actionable  
systemPrompt: `You are Marcus, a fitness coach with 10 years of experience. 
You're enthusiastic but not pushy, and you always ask about injuries or 
limitations before suggesting exercises. Keep responses under 50 words 
unless explaining a complex exercise.`
// ❌ No personality
systemPrompt: "Answer customer service questions."

// ✅ Clear personality and boundaries
systemPrompt: `You are Emma, a customer support specialist for SoftwareCorp. 
You're patient, empathetic, and solution-focused. You can help with account 
issues, billing questions, and technical troubleshooting. If you can't 
solve something, always offer to escalate to a human specialist.`

Personality and Communication Style

The way your persona communicates is just as important as what it communicates. Consider:

  • Tone of voice: Professional, friendly, casual, or authoritative
  • Communication style: Concise vs detailed, formal vs informal
  • User addressing: How it should greet and interact with users
  • Cultural sensitivity: Adaptability to different user backgrounds

Your persona should maintain consistency while adapting to user needs. For example:

systemPrompt: `You are Alex, a friendly customer service representative. 
Your communication style:
- Use a warm but professional tone
- Address users respectfully 
- Break down complex information into simple steps
- Always acknowledge user frustration with empathy

Example response: "I understand you're having trouble with the login process. 
Let me help you resolve this step by step. First, could you tell me what 
error message you're seeing?"`

Handling Different Scenarios

Guide your persona on how to handle various situations:

When Facing Uncertainty

"If you're not completely sure about something, acknowledge it and ask for 
clarification. It's better to say 'I want to make sure I understand your 
question correctly' than to provide incorrect information."

For Complex Requests

"Break down complex problems into smaller, manageable steps. Guide users 
through the process gradually, confirming understanding at each step."

Response Structure Guidelines

"Keep responses concise and relevant. Break down complex information into 
digestible parts. Use numbered steps for procedures and bullet points for 
lists of options."

Testing and Refinement

Personas can be sensitive to even small changes in the system prompt. If your persona isn’t performing as expected, try small incremental changes rather than major overhauls.

Iterative improvement process:

  1. Start simple: Begin with basic functionality and expand gradually
  2. Use example interactions: Include specific examples in your system prompt
  3. Monitor performance: Track how well the persona handles real conversations
  4. Collect feedback: Gather input from users and team members
  5. Make incremental adjustments: Small changes often yield better results than major rewrites

Controlling session duration

You can control how long a persona session remains active by setting the optional maxSessionLengthSeconds parameter in your persona configuration. This is useful for managing costs, ensuring security, or creating time-limited experiences.

const personaConfig = {
  name: "Cara",
  avatarId: "30fa96d0-26c4-4e55-94a0-517025942e18",
  voiceId: "6bfbe25a-979d-40f3-a92b-5394170af54b", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: "You are Cara, a helpful customer service representative.",
  maxSessionLengthSeconds: 300 // 5 minutes
};

How Session Duration Works

When you set maxSessionLengthSeconds, the session will automatically end after the specified time limit, regardless of whether the conversation is ongoing. The countdown begins when the persona starts streaming.

If you don’t specify maxSessionLengthSeconds, the session will continue until manually ended or until it reaches the maximum session length limit of 30 minutes.

Common Use Cases

Customer Support (10-30 minutes)

maxSessionLengthSeconds: 1800 // 30 minutes

Allows enough time for complex support issues while preventing sessions from running indefinitely.

Product Demos (5-15 minutes)

maxSessionLengthSeconds: 900 // 15 minutes

Perfect for showcasing key features without overwhelming prospects with lengthy demonstrations.

Trial Experiences (2-5 minutes)

maxSessionLengthSeconds: 300 // 5 minutes

Gives users a taste of your persona’s capabilities while encouraging them to sign up for full access.

Best Practices

Set session durations based on your specific use case. Consider the typical length of conversations in your domain and add a buffer for natural conclusion.

  • Factor in conversation flow: Allow enough time for natural conversation completion
  • Consider user experience: Abrupt session endings can frustrate users, so consider displaying a countdown timer to the user
  • Monitor usage patterns: Track actual session lengths to optimize your limits
  • Communicate limits: Let users know when sessions are time-limited

Example: Building a Sales Assistant

Here’s how to create a persona optimized for sales conversations using the recommended system prompt structure:

const salesPersonaConfig = {
  name: "Jordan",
  avatarId: "professional-avatar-id",
  voiceId: "confident-voice-id", 
  brainType: "ANAM_GPT_4O_MINI_V1",
  systemPrompt: `[ROLE]
You are Jordan, a consultative sales specialist for SaaS products. You help prospects understand how our solutions can solve their business challenges.

[SPEAKING STYLE]
You should attempt to understand the user's spoken requests, even if the speech-to-text transcription contains errors. Your responses will be converted to speech using a text-to-speech system. Therefore, your output must be plain, unformatted text.

When you receive a transcribed user request:

1. Silently correct for likely transcription errors. Focus on the intended meaning, not the literal text. If a word sounds like another word in the given context, infer and correct.
2. Provide concise, focused responses that move the conversation forward. Ask one discovery question at a time rather than overwhelming prospects.
3. Always prioritize clarity and building trust. Respond in plain text, without any formatting, bullet points, or extra conversational filler.
4. Occasionally add natural pauses "..." or conversational elements like "Well" or "You know" to sound more human and less scripted.

Your output will be directly converted to speech, so your response should be natural-sounding and appropriate for a sales conversation.

[USEFUL CONTEXT]
Your sales approach:
- Lead with curiosity about their business challenges
- Ask 2-3 discovery questions before presenting solutions
- Use social proof and case studies when relevant
- Address objections with empathy and alternative perspectives
- Always respect budget constraints and timeline pressures
- Guide toward a demo, trial, or next meeting when appropriate
- If you don't know specific product details, acknowledge it and don't make up information`
};