Skip to main content

Overview

The lua persona command manages your AI agent’s personality, behavior, and response style with separate workflows for sandbox and production environments.
Direct environment access lets you skip the selection prompt for faster workflows!

Non-Interactive Mode

lua persona sandbox view prints the persona text and exits (no interactive menu) - perfect for CI/CD and scripts.

Sandbox Mode

Edit and test persona locally

Production Mode

Deploy persona versions

Version Control

Track all persona changes

Safe Deployment

Confirmation required

Usage Modes

Default behavior - prompts for environment
Best for: When you’re exploring options
##Complete Workflow
1

Edit in Sandbox

Select “Edit persona” → Opens your editor with current persona
2

Test with Chat

Select Sandbox mode to test persona
3

Create Version

Select “Create version” → Uploads persona as new version
4

Deploy to Production

Select “Deploy persona version” → Choose version and confirm deployment

Environment Modes

Local Development & Testing
Actions:
  • 👁️ View full persona
  • ✏️ Edit persona
  • 📦 Create version (push to production)
  • 📋 List versions
Storage: Code (LuaAgent in src/index.ts)Use for:
  • Writing and editing persona
  • Testing before deployment
  • Iterating on personality

Channel-Aware Personas

Personas can be split per channel using an object form. The previous string form keeps working — adopt the object form only when a channel needs its own phrasing.
Resolution rules:
  • voice channel → uses voice if defined, else base.
  • text (chat) channel → uses text if defined, else base.
  • A channel-agnostic operation (e.g. lua init source write, the agent description fallback) flattens all defined branches.
Common patterns:
  • Voice-only override — Keep your existing string persona, add voice only when voice needs different phrasing:
  • Voice-only persona — A voice agent that only needs a voice prompt:
Pushing a voice-only persona (no base, no text) now correctly applies on the server. lua sync --pull round-trips the object form back to your source file with all channel branches preserved.The PersonaText type is exported from lua-cli if you need it in your own typings.

Writing Great Personas

Structure Template

Good vs Bad Examples

Example 1: Customer Support

Problems:
  • Too vague
  • No personality
  • No guidelines
  • No context

Example 2: Sales Assistant

Problems:
  • No sales methodology
  • Vague personality
  • No product knowledge
  • No dos/don’ts

Example 3: Technical Support

Problems:
  • No troubleshooting methodology
  • No personality
  • No technical depth
  • No escalation paths

Example 4: Onboarding Assistant

Problems:
  • No structure
  • No learning methodology
  • No success criteria
  • No personality

Example 5: E-commerce Shopping Assistant

Good vs Bad Persona Patterns

Pattern 1: Role Definition

Pattern 2: Personality

Pattern 3: Guidelines

Pattern 4: Context

Pattern 5: Tone Examples

Industry-Specific Examples

Healthcare Patient Portal

Financial Services

Restaurant/Food Service

Persona Testing Checklist

Before deploying, test your persona:
  • Role is clearly defined
  • Responsibilities are specific
  • Boundaries are set
  • Escalation paths are clear
  • Tone is consistent across conversations
  • Personality traits come through naturally
  • Communication style matches brand
  • Appropriate for target audience
  • “Always” rules are followed
  • “Never” rules are respected
  • Conditional guidelines work (“When X, do Y”)
  • Edge cases are handled appropriately
  • Company information is correct
  • Policies are accurate
  • Product details are up-to-date
  • Contact information is current
  • Conversations feel natural
  • Users get helpful responses
  • Tone is appropriate
  • Problems are solved effectively

Common Mistakes to Avoid

Bad:
Why it fails:
  • No unique personality
  • No specific knowledge
  • No actionable guidelines
  • Could be any chatbot
Fix: Add specific role, personality, and context
Bad:
Why it fails:
  • Users ask in different ways
  • Blocks natural conversation
  • Frustrating user experience
  • Misses opportunities to help
Fix: Define what you DO, not just what you DON’T
Bad:
Why it fails:
  • Conflicting directives confuse the AI
  • Inconsistent responses
  • Unpredictable behavior
Fix: Be consistent and clear about priorities
Bad:
Why it fails:
  • Robotic and cold
  • No human connection
  • Forgettable experience
Fix: Add warmth, personality traits, communication style
Bad:
Why it fails:
  • Gives wrong information
  • Undermines trust
  • Creates customer frustration
Fix: Regular persona reviews and updates

Next Steps

Test Your Persona

Use lua chat to test persona in sandbox

Environment Variables

Configure API keys and settings

Development Workflows

See persona in complete workflows

Skill Management

Deploy skills that persona uses