Key Concepts
- Appointment reminder voice AI agent
- NAN (n8n) workflow automation platform
- Google Calendar integration
- AI Agent configuration (OpenAI, GPT-4)
- System message and prompt engineering
- Structured output parser
- Retail AI API for phone calls
- Retail AI agent creation and configuration
- Function calling (end call, transfer call)
- Knowledge base integration (RAG)
- Outbound call setup
- API key authentication
Building an Appointment Reminder Voice AI Agent: A Step-by-Step Guide
1. Setting up the NAN Workflow
- Trigger: A schedule trigger is used to initiate the workflow daily at a specific time (e.g., 8:00 AM). This trigger monitors the Google Calendar for upcoming appointments.
- Google Calendar Integration: The workflow connects to Google Calendar using the "Get Many Events" operation.
- Credentials: New credentials are created to access the Google Calendar.
- Event Retrieval: The workflow retrieves events from "now" until "now + 24 hours" to capture appointments for the next day.
- Example: The video uses an example appointment with "Zubat Zada" including name, phone number, reason for the meeting, and email in the description.
- Testing: The "Test Step" function verifies that the Google Calendar integration correctly retrieves the appointment details in JSON format.
2. Configuring the AI Agent
- AI Agent Node: An AI Agent node is added to the workflow, configured to "Define Below" instead of connecting to a chat trigger.
- Chat Model: OpenAI's GPT-4 model is selected as the chat model.
- System Message: A system message is crucial for defining the AI agent's behavior and role.
- Role: The agent is defined as an AI-powered voice assistant for an AI agency, responsible for reminding clients about upcoming consultations.
- Instructions: The system message instructs the agent to generate a structured JSON object with fields like name, phone number, reason for the appointment, start time, end time, and email.
- User Message: The user message includes the appointment description, start time, and end time, extracted from the Google Calendar event.
- Structured Output Parser: This parser ensures that the AI agent's output is in a specific JSON format.
- Schema: A schema is defined to specify the data types and required parameters for the JSON output (name, email, phone number, reason, start time, end time).
- Testing: The "Test Step" function verifies that the AI agent correctly extracts and formats the appointment details according to the defined schema.
3. Integrating with Retail AI API
- HTTP Request Node: An HTTP Request node is used to interact with the Retail AI API.
- Method: The method is set to "POST".
- URL: The URL is set to the Retail AI API endpoint for creating phone calls:
retailai.com/api/v1/agent/create_phone_call. - Authentication: Generic credential types with a custom OAuth are used to authenticate with the Retail AI API.
- API Key: The API key is obtained from the Retail AI dashboard and included in the header as "Authorization: Bearer YOUR_RETAIL_API_KEY".
- Body: The request body is formatted as JSON and includes the following parameters:
from: The outbound phone number from Retail AI.to: The phone number of the appointment attendee, extracted from the AI agent's output.agentId: The ID of the Retail AI agent, obtained from the Retail AI dashboard.
- Retail AI Agent Creation:
- Single Prompt Agent: A single prompt agent is created in Retail AI.
- Universal Prompt: A universal prompt is defined to give the agent a persona, role, and instructions.
- Identity: The agent is given an identity (e.g., "Jarvis") and a role as an AI-powered voice assistant.
- Style: The agent is instructed to be concise, professional, and friendly.
- Task Breakdown: A detailed task breakdown is provided, including how to confirm the identity of the person, remind them about the appointment, and handle different responses.
- Functions: Two functions are added: "end call" and "transfer to a human".
- Transfer Call: The "transfer call" function is configured to transfer the call to a specific phone number if the agent cannot answer a question or if the client requests to reschedule or cancel.
- Knowledge Base: A knowledge base is optionally added to provide the agent with additional information and context.
- Welcome Message: The welcome message is set to "AI initiates" to ensure that the AI agent starts the conversation with a dynamic message.
- Model and Voice Selection: A suitable model (e.g., GPT-4.1) and voice are selected for the agent.
- Outbound Call Configuration:
- Phone Number: A phone number is purchased from Twilio through Retail AI.
- Outbound Call Agent: The outbound call agent is configured to use the created Retail AI agent.
- Identity Verification: Identity verification is completed to enable outbound calls.
4. Testing and Deployment
- Testing: The "Test Step" function in the NAN workflow is used to test the entire flow, including the Retail AI API integration.
- Activation: The workflow is activated to run automatically based on the schedule trigger.
5. Key Arguments and Perspectives
- Efficiency: The AI agent automates the process of reminding clients about appointments, saving time and reducing no-shows.
- Customization: The AI agent can be customized with different personas, roles, and instructions to fit specific business needs.
- Scalability: The AI agent can handle a large number of appointments simultaneously, making it suitable for businesses of all sizes.
- Human Intervention: The "transfer call" function ensures that a human agent is always available to handle complex or unexpected situations.
6. Notable Quotes
- "You can use this and sell it to service for existing businesses, you can use it in your own business or in your own personal life."
- "It's a huge waste of time when people actually schedule appointment and they don't show up."
7. Technical Terms and Concepts
- NAN (n8n): A workflow automation platform that allows users to connect different applications and services.
- AI Agent: A software program that uses artificial intelligence to perform tasks autonomously.
- System Message: A message that defines the behavior and role of an AI agent.
- Prompt Engineering: The process of designing and crafting effective prompts for AI models.
- Structured Output Parser: A tool that ensures that the output of an AI model is in a specific format.
- Retail AI API: An API that allows developers to integrate AI-powered voice agents into their applications.
- Function Calling: A feature that allows AI agents to call external functions to perform specific tasks.
- Knowledge Base: A repository of information that an AI agent can use to answer questions and provide context.
- RAG (Retrieval-Augmented Generation): A technique that combines information retrieval with text generation to improve the accuracy and relevance of AI-generated content.
8. Conclusion
The video provides a comprehensive guide to building an appointment reminder voice AI agent using NAN, Google Calendar, and Retail AI. By following the step-by-step instructions, users can automate the process of reminding clients about appointments, saving time and improving efficiency. The AI agent can be customized to fit specific business needs and can be integrated with other applications and services. The "transfer call" function ensures that a human agent is always available to handle complex or unexpected situations. This solution is valuable for businesses looking to streamline their operations and improve customer service.
AI summaries can miss context or contain errors. Check important details against the original video.