Skip to main content

What is LuaAgent?

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.

Why LuaAgent?

Single Source of Truth

All agent configuration in one place instead of scattered exports

Better Organization

Clear separation between persona, skills, webhooks, jobs, and processors

State Tracking

Component IDs and versions auto-tracked in lua.skill.yaml (do not edit manually)

More Powerful

Support for webhooks, jobs, preprocessors, and postprocessors

Anatomy of an Agent

The Three Required Elements

1. Name

Unique identifier for your agent:
Best Practices:
  • Use lowercase with hyphens
  • Be descriptive and specific
  • Keep it short (2-4 words)

2. Persona

Defines your agent’s personality, behavior, and capabilities:
Best Practices:
  • Clearly define the role
  • List specific capabilities
  • Set boundaries and limitations
  • Define communication style
  • Include do’s and don’ts

3. Skills

At least one skill with tools:
Without skills, the agent has no capabilities!

Optional Components

Model

Which LLM your agent uses to generate responses:
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.

Welcome Message

First message users see:

Webhooks

HTTP endpoints for external events:
Use for: Stripe payments, Shopify orders, GitHub events

Jobs

Scheduled automated tasks:
Use for: Daily reports, cleanup tasks, monitoring

PreProcessors

Filter messages before they reach your agent:
Use for: Spam filtering, routing, validation

PostProcessors

Format responses after agent generation:
Use for: Disclaimers, branding, translation

Real-World Example

Complete agent with all features:

How It All Works Together

Try Your Agent

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:
A Lua agent running on its free hosted chat page
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.

Next Steps

Skills Concept

Learn about organizing tools into skills

Tools Concept

Understand individual tools

Webhooks Concept

Learn about HTTP endpoints

Jobs Concept

Understand scheduled tasks

Full API Reference

Complete LuaAgent API documentation

Build Your First Agent

Step-by-step tutorial