Tutorials & Guides
Learn how to build, configure, and deploy AI agents. From beginner guides to advanced techniques, find the knowledge you need.
Tutorials & Guides
Code Examples
Learning Content
Browse Tutorials
Getting Started
Learn the basics and create your first AI agent in minutes
Creating Your First Bot
Step-by-step guide to build a functional bot
Advanced Features
Explore advanced configuration and customization
Building Workflows
Create complex multi-step conversations and workflows
Real-World Use Cases
Learn from real-world examples and best practices
Deployment Guide
Deploy your agents to production
Getting Started
Welcome to One Last AI! This guide will help you create your first AI agent in just a few minutes.
Step 1: Sign Up & Get API Key
Create an account on One Last AI
Visit the dashboard and sign up with your email
Navigate to API Settings
Go to Settings ā Developer ā API Keys
Generate your API key
Click "Create New Key" and keep it secure
Step 2: Choose Your SDK
Install the SDK for your programming language:
JavaScript:
npm install @One Last AI/sdkPython:
pip install One Last AI-sdkGo:
go get github.com/One Last AI/sdk-goStep 3: Create Your First Agent
import { One Last AI } from '@One Last AI/sdk';
// Initialize client
const client = new One Last AI({
apiKey: process.env.One Last AI_API_KEY
});
// Create an agent
const agent = await client.agents.create({
name: 'My First Bot',
personality: 'friendly',
model: 'gpt-4',
systemPrompt: 'You are a helpful AI assistant'
});
console.log('Agent created:', agent.id);Creating Your First Bot
Overview
In this tutorial, we'll create a helpful customer support bot that can:
- āAnswer frequently asked questions
- āCollect customer information
- āEscalate complex issues to humans
- āMaintain conversation context
Complete Example
import { One Last AI } from '@One Last AI/sdk';
const client = new One Last AI({
apiKey: process.env.One Last AI_API_KEY
});
// Create the support bot
const bot = await client.agents.create({
name: 'Support Bot',
personality: 'professional and helpful',
model: 'gpt-4',
systemPrompt: `You are a customer support agent.
Your role is to:
1. Answer customer questions helpfully
2. Collect information needed for support tickets
3. Provide order and account information
4. Escalate complex issues to human agents
Be polite, professional, and efficient.`,
knowledge_base: {
faqs: [
{
question: 'How do I reset my password?',
answer: 'Go to login, click "Forgot Password", and follow the steps'
},
{
question: 'What are your business hours?',
answer: 'We\'re available 24/7 for support'
}
]
}
});
// Test the bot
const conversation = await client.conversations.send({
agent_id: bot.id,
message: 'I forgot my password, how do I reset it?'
});
console.log('Bot response:', conversation.reply);Key Configuration Options
name
A unique name for your agent
personality
The persona of your agent (e.g., "professional", "friendly", "expert")
model
AI model to use (gpt-4, gpt-3.5-turbo, etc.)
systemPrompt
Instructions that define the agent's behavior
Advanced Features
Context & Memory
Keep track of conversation context across multiple messages:
// Start a conversation with context
const conversation = await client.conversations.create({
agent_id: bot.id,
context: {
user_id: 'user_123',
customer_name: 'John Doe',
account_type: 'premium',
previous_issues: ['billing', 'login']
}
});
// Send messages (context is maintained)
const response1 = await client.conversations.send({
conversation_id: conversation.id,
message: 'I have a billing issue'
});
// Agent remembers previous issues
const response2 = await client.conversations.send({
conversation_id: conversation.id,
message: 'Can you help me with this?'
});Custom Actions
Let your agent take actions like creating tickets or updating data:
// Define custom actions
const bot = await client.agents.create({
name: 'Advanced Bot',
actions: [
{
name: 'create_ticket',
description: 'Create a support ticket',
parameters: {
title: 'string',
description: 'string',
priority: 'low|medium|high'
}
},
{
name: 'get_order_info',
description: 'Retrieve order information',
parameters: {
order_id: 'string'
}
}
]
});
// Agent can now use these actions
const response = await client.conversations.send({
agent_id: bot.id,
message: 'I need to create a support ticket'
});
// Check if action was triggered
if (response.actions.length > 0) {
const action = response.actions[0];
console.log('Action:', action.name);
console.log('Parameters:', action.parameters);
}Streaming Responses
Get real-time streaming for long responses:
// Stream response in real-time
const stream = await client.conversations.stream({
agent_id: bot.id,
message: 'Tell me about your services',
stream: true
});
// Process chunks as they arrive
for await (const chunk of stream) {
process.stdout.write(chunk.data);
}
console.log('\nā Complete');Building Workflows
Multi-Step Workflows
Create complex conversations with multiple steps and conditions:
// Define a workflow
const workflow = {
name: 'Support Workflow',
steps: [
{
id: 'greeting',
prompt: 'Greet the user and ask what they need help with',
next: 'analyze'
},
{
id: 'analyze',
prompt: 'Analyze the issue and determine if it requires escalation',
next_if: {
'requires_escalation': 'escalate',
'default': 'solve'
}
},
{
id: 'solve',
prompt: 'Provide a solution to the issue',
next: 'satisfaction'
},
{
id: 'escalate',
prompt: 'Explain that this needs human review and collect info',
next: 'satisfaction'
},
{
id: 'satisfaction',
prompt: 'Ask if the user is satisfied with the resolution',
next: 'end'
}
]
};
// Execute workflow
const bot = await client.agents.create({
name: 'Workflow Bot',
workflow: workflow
});This creates a natural, multi-step conversation flow that guides both the agent and user through a complete support interaction.
Real-World Use Cases
E-Commerce
- ā Product recommendations
- ā Order tracking
- ā Return processing
- ā Customer support
Healthcare
- ā Appointment scheduling
- ā Symptom checking
- ā Medication reminders
- ā Patient triage
Banking
- ā Account inquiries
- ā Fraud detection
- ā Loan applications
- ā Customer onboarding
Education
- ā Tutoring & mentoring
- ā Course information
- ā Student support
- ā Assignment help
Deployment Guide
Pre-Deployment Checklist
Environment Setup
# .env.production
One Last AI_API_KEY=your-production-key
One Last AI_ENV=production
NODE_ENV=production
LOG_LEVEL=info
# Optional: Enable monitoring
SENTRY_DSN=your-sentry-dsn
DATADOG_API_KEY=your-datadog-keyMonitoring & Logging
// Set up logging
const client = new One Last AI({
apiKey: process.env.One Last AI_API_KEY,
logLevel: 'info',
onError: (error) => {
console.error('Agent Error:', error);
// Send to monitoring service
captureException(error);
},
onEvent: (event) => {
console.log('Event:', event.type);
// Track metrics
trackMetric(event.type);
}
});Recommended Learning Path
Beginner (Week 1-2)
Start with Getting Started guide, create first bot, explore basic features
Intermediate (Week 3-4)
Learn integrations, SDKs, and build your first real application
Advanced (Week 5-6)
Master workflows, custom actions, and deployment strategies
Production (Week 7+)
Deploy to production, monitor performance, and optimize
Ready to Build?
Start with the Getting Started guide and create your first AI agent today. Our team is here to help every step of the way.