LuaAgent is the main configuration object for your entire AI agent. It brings together your persona, skills, webhooks, jobs, and message processors in one unified structure.
Think of it as:
The “brain” of your AI - where you define who the agent is, what it can do, and how it behaves
LuaAgent replaces the old pattern of exporting individual skills. It’s now the recommended way to configure agents.
import { LuaAgent } from 'lua-cli';export const agent = new LuaAgent({ // Required: Who is this agent? name: "customer-support-agent", // Required: What's its personality and behavior? persona: `You are a friendly customer support specialist.Your role:- Help customers with orders and inquiries- Use inquiry forms or your knowledge base when structured intake is needed- Provide accurate informationCommunication style:- Patient and empathetic- Clear and professional- Proactive with solutions`, // Optional: Which LLM to use (default: google/gemini-2.5-flash) model: 'openai/gpt-4o', // Optional: Skills with tools skills: [customerServiceSkill, productSkill], // Optional: HTTP endpoints for external events webhooks: [stripeWebhook, shopifyWebhook], // Optional: Scheduled automated tasks jobs: [dailyReportJob, cleanupJob], // Optional: Filter messages before processing preProcessors: [profanityFilter, rateLimiter], // Optional: Format responses before sending postProcessors: [addDisclaimer, addBranding]});
Defines your agent’s personality, behavior, and capabilities:
persona: `You are Dr. Health, a medical information assistant.Role: Provide general health information and wellness tips.Guidelines:- Always clarify you're not a licensed doctor- Recommend seeing professionals for serious concerns- Use clear, non-technical language- Be empathetic and supportiveTone: Professional, caring, informative`
Use for: Choosing a model with different capabilities, context window, or cost profile. You can also select models dynamically per user or channel.See:Model Selection for available models and dynamic selection patterns.
Every agent gets a free, hosted chat page on HeyLua — no setup, no embedding, no code. It’s the fastest way to talk to your agent, share it with teammates, or demo it to others.Just open the agent chat page and pass your agent’s ID:
https://heylua.ai/agent?agentId=<your-agent-id>
The hosted page is fully branded with your agent’s name, icon, and welcome message, and shows starter prompts to help users begin the conversation.
This also works for Spaces — pass a Space ID as the agentId and the hosted page will coordinate all of the Space’s supervised agents in one conversation.