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
- Navigate to Agents
- Click New Agent
- Enter name and description
- Configure system prompt
- Add tools (optional)
- 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.txtPrompt 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
- Create a tool in Integrations
- Open your agent settings
- Add the tool to your agent
- 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:
- Open the agent
- Click Chat tab
- Send test messages
- 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 listGet Agent Details
lux agent get agent_123Update Prompt
lux agent prompt get agent_123 > current-prompt.txt
# Edit the file
lux agent prompt set agent_123 ./current-prompt.txtDelete Agent
lux agent delete agent_123Common 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 →