Tutorials & Guides

Learn how to build, configure, and deploy AI agents. From beginner guides to advanced techniques, find the knowledge you need.

50+

Tutorials & Guides

100+

Code Examples

10+ hrs

Learning Content

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

1

Create an account on One Last AI

Visit the dashboard and sign up with your email

2

Navigate to API Settings

Go to Settings → Developer → API Keys

3

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/sdk

Python:

pip install One Last AI-sdk

Go:

go get github.com/One Last AI/sdk-go

Step 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

ā–”All agent configurations are finalized
ā–”Thoroughly tested all conversation flows
ā–”API keys are secure and not hardcoded
ā–”Error handling is implemented
ā–”Monitoring and logging are in place
ā–”Rate limits are understood

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-key

Monitoring & 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

1

Beginner (Week 1-2)

Start with Getting Started guide, create first bot, explore basic features

2

Intermediate (Week 3-4)

Learn integrations, SDKs, and build your first real application

3

Advanced (Week 5-6)

Master workflows, custom actions, and deployment strategies

4

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.