Skip to content

Latest commit

 

History

History
447 lines (339 loc) · 11.6 KB

File metadata and controls

447 lines (339 loc) · 11.6 KB
title Lua - Build AI Agents That Do Anything
description Create AI agents with custom capabilities by connecting to any API using TypeScript

Get started in 5 minutes

Lua is the Agent OS that abstracts the technical complexities and helps engineers focus on business logic. Ship your first agent without touching infra—just write TypeScript tools and go live.


1. Install the CLI

npm install -g lua-cli
yarn global add lua-cli
pnpm add -g lua-cli

Node 16+ recommended. Installation Guide →


2. Authenticate (one-time)

lua auth configure

Enter your email, confirm the 6-digit code, and we'll securely store your API key for you. Auth Guide →


3. Create your project

mkdir my-agent && cd my-agent
lua init

Pick Create new agent and follow the prompts. The template includes ready-to-run examples. Quick Start Guide →


4. Run it locally

lua test

Select a tool and try different inputs. The starter includes 30+ working tools (e.g., a no-API-key weather tool) so you can see the pattern right away. Template Overview →


5. Deploy & chat

lua push && lua deploy   # ship to production
lua chat                 # chat in sandbox or production

Use lua chat for an interactive CLI session; sandbox chat auto-bundles your local skills after a quick push. Chat Command →

<Card title="✨ Test on Real Channels Instantly" icon="mobile" href="/channels/quick-testing" horizontal

Test your agent on WhatsApp, Facebook, Instagram, Email, or Slack without setting up channels


Add your first business-logic tool

Here's all the code you need to add a custom capability:

import { LuaTool } from 'lua-cli';
import { z } from 'zod';

export class SayHello implements LuaTool {
  name = 'say_hello';
  description = 'Greets a user by name';
  inputSchema = z.object({ name: z.string() });
  
  async execute(input: { name: string }) {
    return { message: `Hello, ${input.name}!` };
  }
}
import { LuaAgent, LuaSkill } from 'lua-cli';
import { SayHello } from './tools/SayHello';

const helloSkill = new LuaSkill({
  name: 'hello-skill',
  description: 'Greeting capabilities',
  context: 'Use say_hello to greet users by name',
  tools: [new SayHello()]
});

export const agent = new LuaAgent({
  name: 'hello-agent',
  persona: 'You are a friendly assistant. Be warm and concise.',
  skills: [helloSkill]
});

That's it. This mirrors the agent/skill/tool pattern—focus purely on your domain logic. Build Your First Skill →


Add chat to your website (1 line)

<script src="https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js"></script>
<script>
  window.LuaPop.init({ 
    agentId: "your-agent-id", 
    position: "bottom-right"
  });
</script>

Drop this on any page to embed AI chat instantly. LuaPop Widget Guide →


Focus on Business Logic, Not Infrastructure

Lua abstracts away all the complexity so you can ship faster:

**We handle:** Hosting, auto-scaling, load balancing, CDN delivery, uptime monitoring
**You focus on:** Writing functions that solve business problems
**We handle:** Model selection, prompt engineering, token optimization, API rate limits, cost management
**You focus on:** What your agent should do, not how AI models work
**We handle:** Web, mobile, WhatsApp, Slack, Instagram, Facebook Messenger—all channels managed
**You focus on:** Building capabilities once, deploy everywhere instantly
**We handle:** Tool calling logic, context management, conversation flow, error recovery, retries
**You focus on:** Simple functions that fetch and return data
**Build in hours, not months.** Skip the months of infrastructure work, LLM integration complexity, and channel management. Just write TypeScript functions that connect to your APIs, and we handle everything else.

Integrate With ANY API

Connect to your existing systems or any third-party service:

**100% Custom Integration**
```typescript
class YourCustomTool implements LuaTool {
  async execute(input) {
    const response = await fetch('https://your-backend.com/api/endpoint', {
      headers: { 'X-API-Key': env('YOUR_API_KEY') }
    });
    return processYourData(await response.json());
  }
}
```

Perfect for existing infrastructure, custom business requirements, or any industry
**Optional Built-In Helpers**
```typescript
import { Products, Baskets, Data } from 'lua-cli';

const products = await Products.search('laptop');
const basket = await Baskets.create({ currency: 'USD' });
const results = await Data.search('docs', 'query');
```

Great for rapid prototyping, e-commerce MVPs, or when you don't have a backend yet
**Third-Party Integrations**
```typescript
// Stripe, SendGrid, Shopify, Zendesk, etc.
const stripe = await fetch('https://api.stripe.com/v1/charges', {
  headers: { 'Authorization': `Bearer ${env('STRIPE_KEY')}` }
});
```

Connect to any REST/GraphQL API—Stripe, SendGrid, weather, maps, anything
**Platform APIs are completely optional!** They're convenience helpers for common e-commerce and data tasks. You can build agents that integrate with ANY system using standard HTTP/REST/GraphQL calls.

What You Can Build

Shopping assistants that integrate with Shopify, WooCommerce, or your custom store 24/7 AI support agents connected to your ticketing system and knowledge base In-app assistants that access your product APIs and user management AI-powered operations connecting to your ERP, CRM, and databases Account management, transactions, and reporting with your banking systems Patient portals integrated with your EMR and appointment systems

Advanced Features (v3.0.0)

Beyond basic tools and skills, Lua provides enterprise-grade automation:

**HTTP endpoints** for external events
Stripe payments, Shopify orders, GitHub deployments—react to events in real-time

[Learn More →](/overview/webhooks)
**Automated tasks** with cron patterns
Daily reports, cleanup tasks, monitoring—automate recurring operations

[Learn More →](/overview/jobs)
**Message filtering** before your agent
Spam detection, profanity filters, routing, validation—control what reaches your agent

[Learn More →](/overview/preprocessors)
**Response formatting** after generation
Disclaimers, branding, translation—enhance every response automatically

[Learn More →](/overview/postprocessors)

Production-Ready Examples

See complete implementations across business, healthcare, and IoT/edge computing:

Shopping experience with cart and checkout using Platform APIs

<Card title="Customer Support" icon="headset" href="/demos/customer-support"

Zendesk integration with AI knowledge base + webhooks + jobs

<Card title="Financial Onboarding" icon="building-columns" href="/demos/financial-onboarding"

KYC verification with Stripe Identity + webhooks + processors

<Card title="HR Assistant" icon="user-tie" href="/demos/hr-assistant"

Employee management with BambooHR + scheduled reports

<Card title="IoT Smart Light" icon="lightbulb" href="/demos/iot-smart-light"

Control GPIO relays on Raspberry Pi via chat + automation

<Card title="View All 15 Demos" icon="layer-group" href="/demos/overview"

Business, healthcare, logistics, and IoT/edge computing

Why Developers Choose Lua

Integrate with any API you choose. Your infrastructure, your choice. Not tied to our Platform APIs—they're completely optional. Your data stays with your systems. Live reload during development means instant feedback. TypeScript autocomplete guides you. Test with `lua chat` immediately. Deploy with one command. Skip months of infrastructure work. Your code, your logic, your data. Complete control over authentication, business rules, error handling, and integrations. Not limited by platform constraints. Version management built-in. Sandbox for testing. Environment variables for secrets. One-command deployment. Monitoring and logs. Everything you need for enterprise production use.

Helpful Resources

Complete tutorial—install to deploy in 5 minutes Understand agents, skills, tools, webhooks, and jobs Complete API documentation with examples Working code for external APIs, Platform APIs, and hybrid Complete command reference Add AI chat to your website

Join the Community

<Card title="Discord Community" icon="discord" href="https://discord.gg/SRPEuwCzaD" horizontal

Connect with other Lua builders! Get help, share your projects, report bugs, and stay up to date with announcements.


<Card title="Ready to Build Your First Agent?" icon="rocket" href="/getting-started/quick-start" horizontal

Complete tutorial with step-by-step instructions →