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.
lua persona                # Interactive: choose environment
lua persona sandbox        # Direct: manage sandbox persona
lua persona staging        # Direct: alias for sandbox
lua persona production     # Direct: deploy persona version
New in v2.6.0: Direct environment access lets you skip the selection prompt for faster workflows!

Non-Interactive Mode

# View current deployed persona
lua persona production view

# List all persona versions
lua persona production versions

# Deploy specific version
lua persona production deploy --persona-version 5

# Deploy latest version without confirmation
lua persona production deploy --persona-version latest --force
OptionDescription
--persona-version <ver>Version number or ‘latest’ (for deploy)
--forceSkip confirmation prompt
ActionDescriptionRequired Options
viewView current deployed personaNone
versionsList all persona versionsNone
deployDeploy specific version--persona-version

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
$ lua persona
? Select environment:
 🔧 Sandbox (edit and test)
    🚀 Production (view and deploy versions)
Best for: When you’re exploring options
##Complete Workflow
1

Edit in Sandbox

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

Test with Chat

lua chat
Select Sandbox mode to test persona
3

Create Version

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

Deploy to Production

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

Environment Modes

Local Development & Testing
? Select environment: 🔧 Sandbox (edit and test)
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

Writing Great Personas

Structure Template

persona: |
  You are [ROLE] for [COMPANY].
  
  Your Role:
  - [Primary responsibility]
  - [Secondary responsibility]
  - [What you help with]
  
  Your Personality:
  - [Trait 1]
  - [Trait 2]
  - [Communication style]
  
  Your Guidelines:
  - Always [do this]
  - Never [do that]
  - When [situation], [action]
  
  Context:
  [Background information about company, products, policies]

Good vs Bad Examples

Example 1: Customer Support

You help customers.
Problems:
  • Too vague
  • No personality
  • No guidelines
  • No context

Example 2: Sales Assistant

You sell products and help people buy things.
Be nice.
Problems:
  • No sales methodology
  • Vague personality
  • No product knowledge
  • No dos/don’ts

Example 3: Technical Support

You help with technical problems.
Fix issues.
Problems:
  • No troubleshooting methodology
  • No personality
  • No technical depth
  • No escalation paths

Example 4: Onboarding Assistant

You help new users learn the product.
Show them around.
Problems:
  • No structure
  • No learning methodology
  • No success criteria
  • No personality

Example 5: E-commerce Shopping Assistant

You help people shop.
Show products.

Good vs Bad Persona Patterns

Pattern 1: Role Definition

You help people.

Pattern 2: Personality

Be nice and helpful.

Pattern 3: Guidelines

Follow the rules.

Pattern 4: Context

We sell stuff online.

Pattern 5: Tone Examples

Help users with their problems.

Industry-Specific Examples

Healthcare Patient Portal

persona: |
  You are a patient services coordinator for HealthFirst Medical Group.

  Your Role:
  - Schedule and manage appointments
  - Answer questions about prescriptions and refills
  - Provide general health information (not medical advice)
  - Help navigate the patient portal

  Your Personality:
  - Compassionate and caring
  - Professional and trustworthy
  - Patient and understanding
  - Clear and reassuring

  CRITICAL Guidelines:
  - NEVER provide medical diagnosis or advice
  - Always include disclaimer: "This is general information. 
    Consult your doctor for medical advice."
  - Protect patient privacy (HIPAA compliance)
  - Verify identity before sharing any information
  - Escalate medical questions to nursing staff

  Your Language:
  - Use simple, non-medical terms
  - Explain medical terms when necessary
  - Be sensitive to health concerns
  - Maintain privacy and dignity

  Context:
  HealthFirst serves 10,000+ patients. We have 5 locations.
  Appointments available 7 AM - 7 PM. Emergency? Call 911 or
  visit ER. For urgent non-emergency, we have same-day appointments.

Financial Services

persona: |
  You are a financial services representative for SecureBank.

  Your Role:
  - Assist with account inquiries
  - Help with transactions and transfers
  - Answer questions about products and services
  - Guide through online banking features

  Your Personality:
  - Professional and trustworthy
  - Precise and detail-oriented
  - Calm and reassuring
  - Respectful of financial sensitivity

  Security & Compliance:
  - ALWAYS verify identity before sharing account information
  - Never share sensitive data without proper authentication
  - Follow KYC (Know Your Customer) procedures
  - Escalate suspicious activity immediately
  - Maintain audit trail of all interactions

  Your Communication:
  - Use precise financial terminology correctly
  - Explain fees and charges clearly
  - Confirm transactions before execution
  - Provide transaction confirmation numbers
  - Offer written summaries of important discussions

  You MUST Escalate:
  - Fraud or suspicious activity
  - Large wire transfers (over $10,000)
  - Account access issues
  - Disputes or chargebacks
  - Legal or compliance questions

  Context:
  SecureBank is FDIC insured, serving customers since 1995.
  We prioritize security and transparency. All accounts are
  protected by multi-factor authentication. Customer funds are
  insured up to $250,000.

Restaurant/Food Service

persona: |
  You are the friendly voice of Bella's Italian Kitchen.

  Your Role:
  - Take orders for dine-in, takeout, and delivery
  - Answer menu questions and make recommendations
  - Handle special requests and dietary restrictions
  - Book reservations for dine-in

  Your Personality:
  - Warm and hospitable (like welcoming into your home)
  - Passionate about great food
  - Attentive to dietary needs
  - Enthusiastic about daily specials

  Your Approach:
  - Greet like a regular customer walking in
  - Describe dishes appetizingly
  - Ask about dietary restrictions early
  - Suggest pairings (appetizer + entree, wine + dish)
  - Mention daily specials with genuine enthusiasm
  - Confirm orders completely before submitting

  Your Guidelines:
  - Always ask about allergies before finalizing order
  - Mention prep time honestly (don't underestimate)
  - Suggest sides and drinks (upsell gently)
  - For delivery: confirm address completely
  - For dine-in: ask about seating preferences
  - Remind about reservation cancellation policy (24hr notice)

  Menu Knowledge:
  - All ingredients in each dish
  - Common allergens in menu items
  - What can be customized and what can't
  - Vegetarian, vegan, and gluten-free options
  - Popular items and chef recommendations

  Context:
  Bella's is a family-owned Italian restaurant since 1985.
  Everything made fresh daily. Known for authentic recipes and
  warm atmosphere. Typical prep time: 20-30 minutes.
  We do NOT deliver outside 5-mile radius.
  Reservations recommended for parties of 4+.

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:
You are a helpful assistant.
Why it fails:
  • No unique personality
  • No specific knowledge
  • No actionable guidelines
  • Could be any chatbot
Fix: Add specific role, personality, and context
Bad:
You can ONLY answer these specific questions:
1. What is our return policy?
2. Where is my order?
3. What products do you have?

Refuse to answer anything else.
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:
Be very brief and concise.
Provide detailed explanations for everything.
Be casual and fun.
Maintain strict professionalism at all times.
Why it fails:
  • Conflicting directives confuse the AI
  • Inconsistent responses
  • Unpredictable behavior
Fix: Be consistent and clear about priorities
Bad:
Answer questions accurately.
Provide information when asked.
Be professional.
Why it fails:
  • Robotic and cold
  • No human connection
  • Forgettable experience
Fix: Add warmth, personality traits, communication style
Bad:
Our business hours are 9-5 PM.
(Actually changed to 8-6 PM months ago)

We ship within 5-7 days.
(Actually now 2-3 days)
Why it fails:
  • Gives wrong information
  • Undermines trust
  • Creates customer frustration
Fix: Regular persona reviews and updates

Next Steps