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
New in v3.0.0: 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- Create support tickets when needed- Provide accurate informationCommunication style:- Patient and empathetic- Clear and professional- Proactive with solutions`, // 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:
Copy
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`