Agents
Custom Agents

Custom Agents

Create specialized AI agents with custom prompts and tools.

Overview

Custom agents (subagents) are AI assistants configured for specific tasks. They combine system prompts, knowledge, and tools to handle specialized workflows.

Creating an Agent

Via Lux Studio

  1. Navigate to Agents
  2. Click New Agent
  3. Enter name and description
  4. Configure system prompt
  5. Add tools (optional)
  6. Save agent

Via CLI

lux agent create support-agent "Customer Support Agent"

System Prompts

The system prompt defines how your agent behaves. It's the instructions the AI follows when responding.

Setting a Prompt

lux agent prompt set agent_123 ./prompt.txt

Prompt Structure

# Role
You are a customer support agent for Acme Inc.
 
# Responsibilities
- Answer questions about our products
- Help with order issues
- Escalate complex problems to human agents
 
# Guidelines
- Be friendly and professional
- Use the knowledge base for accurate information
- If unsure, say "I'll need to check with our team"
 
# Available Information
- Product catalog: @knowledge/products.md
- FAQ: @knowledge/faq.md
- Policies: @knowledge/policies.md
 
# Response Format
Keep responses concise (2-3 sentences when possible).
Use bullet points for multiple items.

Prompt Best Practices

Be Specific:

❌ "Be helpful"
✅ "Help customers with billing questions. For refunds, collect order ID and reason."

Set Boundaries:

❌ (no boundaries)
✅ "Only discuss Acme products. Redirect off-topic questions politely."

Provide Examples:

User: "How do I return an item?"
Agent: "I can help with that! To start a return:
1. Go to Orders in your account
2. Select the item
3. Click 'Start Return'
Need help with a specific order?"

Adding Tools

Tools extend what your agent can do. Connect custom API tools for real-time data and actions.

Available Tool Types

  • API Tools - Call external APIs
  • Database Tools - Query your tables
  • Knowledge Tools - Search knowledge base
  • Action Tools - Trigger flows

Connecting Tools

  1. Create a tool in Integrations
  2. Open your agent settings
  3. Add the tool to your agent
  4. Reference in system prompt
# Tools Available
- check_order_status: Look up order details by order ID
- create_support_ticket: Create a ticket for complex issues
 
When a customer asks about their order, use check_order_status first.

Agent Chat

Test your agent in Lux Studio:

  1. Open the agent
  2. Click Chat tab
  3. Send test messages
  4. Review responses and adjust prompt

Using Agents in Flows

Reference agents in AI Transform nodes:

{
  "agentId": "agent_support",
  "input": "{{customerMessage}}",
  "context": {
    "customerId": "{{customerId}}",
    "orderHistory": "{{recentOrders}}"
  }
}

Managing Agents

List Agents

lux agent list

Get Agent Details

lux agent get agent_123

Update Prompt

lux agent prompt get agent_123 > current-prompt.txt
# Edit the file
lux agent prompt set agent_123 ./current-prompt.txt

Delete Agent

lux agent delete agent_123

Common Agent Types

Customer Support

  • Answer product questions
  • Handle order issues
  • Process returns

Sales Assistant

  • Qualify leads
  • Answer pricing questions
  • Schedule demos

Internal Helper

  • Answer employee questions
  • Look up policies
  • Process requests

Data Analyst

  • Answer questions about data
  • Generate reports
  • Explain metrics

Next: Voice Agents →