Skills & Actions
Extend your chatbot's capabilities with custom skills and actions.
Overview
Skills allow your chatbot to:
- 🔍 Search external databases
- 📧 Send emails
- 📅 Check calendars
- 🌤️ Get real-time data (weather, stock prices)
- 🔗 Call external APIs
- ⚡ Execute custom logic
Built-in Skills
Document Retrieval (Default)
Automatically searches uploaded documents:
How it works:
- User asks question
- AI generates search query
- Retrieves relevant document chunks
- Generates answer with citations
Configuration:
Max chunks: 5-10
Similarity threshold: 0.7Web Search
Search the internet for current information:
Setup:
- Skills tab → Add Skill → Web Search
- Configure:
- Search engine: Google, Bing, DuckDuckGo
- Max results: 3-5
- Safe search: On/Off
- Save
Example use:
User: "What's the current weather in Tokyo?"
Bot: [Searches web] "The current temperature in Tokyo is 18°C with partly cloudy skies."Calendar Integration
Check availability and schedule meetings:
Setup:
- Skills → Add Skill → Calendar
- Connect calendar:
- Google Calendar
- Microsoft Outlook
- Apple Calendar (via CalDAV)
- Set permissions (read/write)
- Save
Example use:
User: "Am I free at 2pm tomorrow?"
Bot: [Checks calendar] "Yes, you're available at 2pm tomorrow."
User: "Schedule a meeting at 2pm tomorrow"
Bot: [Creates event] "Meeting scheduled for 2pm tomorrow."Send emails on behalf of users:
Setup:
- Skills → Email
- Configure SMTP:
- Server: smtp.gmail.com
- Port: 587
- Username: your-email@gmail.com
- Password: app-specific password
- Save
Example use:
User: "Email support about my order #12345"
Bot: [Composes email]
"Subject: Order #12345 Inquiry
Body: [Generated based on conversation]
Send this email? (Yes/No)"Database Query
Query your databases:
Setup:
- Skills → Database
- Connection:
- Type: PostgreSQL, MySQL, MongoDB
- Host: your-db.com
- Credentials: username/password
- Allowed operations: SELECT only (recommended)
- Save
Example use:
User: "How many orders did we receive today?"
Bot: [Queries database] "You received 47 orders today."Security: Use read-only credentials, limit to specific tables.
Creating Custom Skills
Simple Function Skill
Define custom JavaScript/Python functions:
Example: Calculate Shipping Cost
JavaScript:
// Skill Definition
{
name: "calculateShipping",
description: "Calculate shipping cost based on weight and destination",
parameters: {
weight_kg: "number",
destination_country: "string",
express: "boolean (optional)"
},
execute: async (params) => {
const { weight_kg, destination_country, express = false } = params
// Base rate
let cost = weight_kg * 5
// International surcharge
if (destination_country !== "US") {
cost += 15
}
// Express shipping
if (express) {
cost *= 1.5
}
return {
cost: cost.toFixed(2),
currency: "USD",
estimated_days: express ? "2-3" : "5-7"
}
}
}Usage:
User: "How much to ship 5kg to Canada?"
Bot: [Calls calculateShipping(5, "Canada", false)]
"Shipping 5kg to Canada will cost $40.00 USD and take 5-7 days."Example: Get Stock Price
{
name: "getStockPrice",
description: "Get current stock price",
parameters: {
symbol: "string"
},
execute: async ({ symbol }) => {
const response = await fetch(
`https://api.example.com/stock/${symbol}`
)
const data = await response.json()
return {
symbol: data.symbol,
price: data.price,
change: data.change,
percent_change: data.percent_change
}
}
}API Integration Skill
Connect to external APIs:
Example: Weather API
{
name: "getWeather",
description: "Get current weather for a location",
parameters: {
location: "string",
units: "metric | imperial (optional)"
},
execute: async ({ location, units = "metric" }) => {
const apiKey = process.env.WEATHER_API_KEY
const response = await fetch(
`https://api.openweathermap.org/data/2.5/weather?q=${location}&units=${units}&appid=${apiKey}`
)
const data = await response.json()
return {
temperature: data.main.temp,
condition: data.weather[0].description,
humidity: data.main.humidity,
wind_speed: data.wind.speed
}
}
}Example: CRM Integration
{
name: "searchCustomer",
description: "Search for customer in CRM",
parameters: {
email: "string (optional)",
phone: "string (optional)",
customer_id: "string (optional)"
},
execute: async (params) => {
const response = await fetch(
`https://your-crm.com/api/customers/search`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.CRM_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}
)
const customer = await response.json()
return {
name: customer.name,
email: customer.email,
status: customer.status,
total_orders: customer.orders.length,
lifetime_value: customer.lifetime_value
}
}
}Skill Configuration
Access Control
Control who can use skills:
Public skills:
- Available to all users
- No authentication required
- Rate limited
Authenticated skills:
- Requires user login
- Access based on user role
- User-specific data
Admin skills:
- Admin users only
- Sensitive operations
- Audit logged
Rate Limiting
Prevent abuse:
{
name: "sendEmail",
rate_limit: {
calls_per_minute: 5,
calls_per_hour: 20,
calls_per_day: 50
}
}Caching
Cache results for performance:
{
name: "getProductInfo",
cache: {
enabled: true,
ttl_seconds: 3600, // Cache for 1 hour
key_params: ["product_id"] // Cache per product
}
}Error Handling
Graceful error handling:
execute: async (params) => {
try {
// Skill logic
return result
} catch (error) {
return {
error: true,
message: "Failed to fetch data. Please try again.",
user_friendly: true
}
}
}Testing Skills
Test Console
- Skills tab → Select skill → Test
- Input parameters:
{ "weight_kg": 5, "destination_country": "Canada" } - Click Run Test
- View result:
{ "cost": "40.00", "currency": "USD", "estimated_days": "5-7" }
Integration Testing
Test in chat interface:
1. Create test chatbot
2. Enable skill
3. Try sample queries
4. Verify responses
5. Check error casesSkill Marketplace (Coming Soon)
Browse and install community skills:
Categories:
- 📧 Communication (Email, SMS)
- 📊 Data & Analytics
- 💰 E-commerce
- 🎓 Education
- 🏥 Healthcare
- 🏢 Business
Example skills:
- Stripe payment processing
- Shopify order lookup
- Zendesk ticket creation
- Google Sheets integration
- HubSpot CRM sync
Advanced: Multi-Step Skills
Execute multiple steps:
{
name: "bookAppointment",
description: "Book an appointment with availability check",
steps: [
{
name: "checkAvailability",
execute: async ({ date, time }) => {
// Check calendar
const available = await checkCalendar(date, time)
return { available }
}
},
{
name: "createAppointment",
condition: (prev) => prev.available,
execute: async ({ date, time, user_email }) => {
// Create appointment
const appointment = await createEvent(date, time, user_email)
return { appointment_id: appointment.id }
}
},
{
name: "sendConfirmation",
execute: async ({ appointment_id, user_email }) => {
// Send confirmation email
await sendEmail(user_email, "Appointment Confirmed", ...)
return { confirmed: true }
}
}
]
}Best Practices
Design
✅ Do:
- Clear, descriptive names
- Detailed descriptions
- Validate input parameters
- Return structured data
- Handle errors gracefully
❌ Don't:
- Vague skill names
- Missing parameter descriptions
- Assume valid input
- Return raw API responses
- Expose error stack traces
Security
✅ Do:
- Use environment variables for API keys
- Validate all inputs
- Rate limit sensitive operations
- Log skill usage
- Sanitize outputs
❌ Don't:
- Hardcode credentials
- Trust user input
- Allow unlimited API calls
- Expose sensitive data
- Skip authentication
Performance
✅ Do:
- Cache when possible
- Set reasonable timeouts
- Batch operations
- Use async/await
- Monitor execution time
❌ Don't:
- Make unnecessary API calls
- Block on slow operations
- Retry failed requests indefinitely
- Load large datasets
Troubleshooting
Skill Not Being Called
Check:
- Skill is enabled
- Description is clear
- Parameters are well-defined
- AI model supports function calling
- No syntax errors in skill code
Skill Returns Error
Debug:
- Check skill logs
- Verify API credentials
- Test with skill console
- Check parameter types
- Validate API endpoint
Slow Response Times
Optimize:
- Enable caching
- Reduce API calls
- Batch requests
- Use faster endpoints
- Implement timeouts
Next Steps
- Analytics - Monitor skill usage
- API Reference - Programmatic access
- Backend Architecture - Technical details
- Troubleshooting - Common issues