Logo

dev-resources.site

for different kinds of informations.

How to Build an AI Agent to Automate Mobile Auto Repair Task Scheduling

Published at
10/17/2024
Categories
ai
powerfuldevs
api
learning
Author
alexcc522
Categories
4 categories in total
ai
open
powerfuldevs
open
api
open
learning
open
Author
9 person written this
alexcc522
open
How to Build an AI Agent to Automate Mobile Auto Repair Task Scheduling

Project Background

Inefficient scheduling in the service industry wastes time for both vendors and customers. To address this, our team developed an AI agent to streamline repair scheduling in the mobile auto sector.

Project Preview


This is an overview of the project. We'll walk through the essential steps of building it and cover some basic concepts related to AI agents along the way.

Business Logic

Here’s the business logic behind the template, which you can also view as its workflow. We have two AI agents in this template. A customer service that help to record user's car issues and a scheduling assistant that helps to make the schedule in vendor's calendar.

Customer Service

Image description

This is the logic of the customer service AI. This AI works mainly during the conversation. As the conversation progresses, the data table updates in real-time. Car models and locations are recorded as the user selects them, while the AI assesses and updates the car’s issues.

Scheduling Assistant

Image description

It operates after an order is created, handling the task of scheduling the event for the vendor.

The following is the explanation of different work order status.

  1. Pending – Conversation starts, gathering information.

  2. Chat to Issue – User inputs the information and AI assesses the issue.

  3. To Be Confirmed – The issue has been confirmed, waiting for staff to confirm the appointment.

  4. Confirmed – Appointment scheduled successfully.


Knowledge Breakdown

How Function Calls Works

  1. Need Identification: While handling tasks, the agent identifies when specific "tools or expert knowledge" might be required. For instance, if you mention "check today’s weather."

  2. Tool Selection: The agent picks the most suitable expert from a predefined list of tools.

  3. Parameter Preparation: The agent prepares the necessary input information by reviewing tool descriptions, such as the specific city and date required for a weather query.

  4. Tool Invocation: The agent generates and calls a tool (function) in the correct format.

  5. Information Integration: The agent uses the tool’s result and continues processing within the main workflow.

Autonomous Decision-Making vs. Workflow Orchestration

When developing agents, there are two main ways to equip them with capabilities:

  1. Autonomous Decision-Making (Function Call-Based): Agents can be given the ability to make decisions on their own. Imagine playing League of Legends, you can control the sequence of skills to be used, adapting the order based on the situation, even if some heroes have preset combos.

  2. Workflow Orchestration: This is akin to packaging fixed combos into mouse macros that trigger at specific times. The workflows of agents are pre-configured.

  3. For example, you need your agent to "send a notification to Slack." The first approach would package this task into a tool, allowing the agent to decide when to call it. The second approach adds logic to the workflow: "When the result is ***," triggers the API to send a Slack notification.

  • Advantage of Autonomous Decision-Making: Greater flexibility and adaptability, enabling real-time decisions that are effective in dynamic environments. However, this might increase costs (token usage) and introduce uncertainty.

  • Advantage of Workflow Orchestration: Predictability and efficient resource management, allowing developers to control exactly when notifications are triggered, which improves system stability and is ideal for repetitive tasks.


Data Model

Below is the basic data model setting in this project.

Image description

Image description

Image description

The relation between car maker and car model is 1:N, because one brand could have multiple car models. The relation between repair category and repair item is 1:N because 1 category could have different issues. Based on car model and repair issues, a cost estimate is generated.


Configuration Guide

AI Configuration

This section is the configuration of the AI.

Customer Service AI

Purpose

Gathers detailed descriptions of car issues from the user, organizes information for the mechanic, and estimates repair time and cost.

Tools:

  1. Find repair items based on user input.

  2. Retrieve quotes using car model and repair item details.

  3. Modify and query user work orders.

Input:

User messages, car_model_id, work_order_id.

Steps:

  1. Set up tools for the AI:
  • Search repair items.

  • Retrieve quotes based on car model and repair items.

  • Query and update work orders.

  1. Configure a knowledge base for car repair categories and specific issues for the AI to query.

Important Notes
Unlike hardcoding data directly into the prompt, a knowledge base is ideal for dynamic, frequently changing information. This approach prevents the need to update the prompt constantly, as the issues may vary each time.

Image description

Image description

  1. Configure your agent.

Scheduler AI

Purpose: Schedules appointments for mechanics.

Data: Google Calendar token.

Tools:

  • Time zone conversion.

  • Calculate distances between locations.

  • Query and create Google Calendar events.

Input: Location, preferences, date, time zone, duration.

Steps:

  1. Set up tools for the AI:
  • Retrieve Google Calendar info.

  • Calculate distances and travel time.

  • Create calendar events.

  • Configure your AI agent.

Important Notes:

  1. When configuring agent tools, clearly define the tool’s capabilities and requirements for each input and output.

  2. Based on the scenario, set appropriate limits on the number of calls and token usage to prevent resource waste.

Integrating ZAI into the Front-End Page

In this section, we'll walk through the frontend page building and how to configure AI agents on the frontend.

Usage Guide

Before using this template, you'll need to configure your own API so the AI can schedule events in your calendar. Additionally, you’ll need to adjust the permission settings to ensure that only you and your staff can manage the dashboard, while users only have access to the conversation page.

You'll also need to set up the permission setting so that only you and your staff can manage the dashboard, while your users can only access the conversation page.

Google Calendar Setup

  1. Log in to Google Cloud Console: https://console.cloud.google.com/

  2. Create a new project.

Image description

  1. Enable the Google Calendar API.

Image description

  1. Create credentials (redirect URI: https://developers.google.com/oauthplayground).

Image description

Image description

Image description

  1. Download the credentials JSON file to get your client_id and client_secret.

Image description

  1. Add your Google account as a test user.

Image description

  1. Get the refresh token:

Image description

  1. Click "Authorize APIs" and log in with your Google account.

Image description

  1. Obtain the refresh_token.

Image description

Image description

  1. In Momen’s API module, set the client_id, refresh_token, and client_secret as default values.

Image description

Image description

Google Maps Platform Setup

  1. Enable the Distance Matrix API in Google Cloud Console.

Image description

  1. Follow the instructions to get your API key.

Image description

  1. Add the API key to the AI's description in Momen.

Image description

Permission Setup

Permission is crucial because it ensures that only authorized roles can access specific data. For example, access to the dashboard, customer details, and the API will be restricted to staff members, keeping sensitive information secure. When using this project, we'll need to configure the permission.

  1. Register a new account.

Image description

  1. Grant the permissions for this account in the editor.

Conclusion

This concludes our showcase. To explore how it functions within the editor, feel free to check it out here:https://editor.momen.app/tool/jnPx685BLNJ/WEB?code=rsYe0aqvVVR9u .

powerfuldevs Article's
30 articles in total
Favicon
The Rise of AI Agents: Understanding the Revolution and Adapting to Change
Favicon
Google and Anthropic are working on AI agents - so I made an open source alternative
Favicon
Power BI vs Tableau vs Looker vs Qlik: A detailed comparison between top data visualization tools
Favicon
Finding the Right Microsoft Platform for Your Applications
Favicon
Top Advanced Power BI Features for Your Business
Favicon
Decoding Microsoft Integration Tools:Which One is Right for You?
Favicon
For A Despicably Good Cause : Small Steps, Big Impact!
Favicon
From Template to Tailored:The Power Platform Way
Favicon
Why You Should Hire a Power BI Developer for Your Business
Favicon
Never code lines on the HTML canvas again
Favicon
From Vanar Sena to Low Code Champions: Lessons from the Ramayana for Digital Transformation
Favicon
From Scribbles to Spells: Perfecting Instructions in Copilot Studio
Favicon
Securing Plain Text using SHA hashing: SHA-256 Sorcery
Favicon
Transforming Inventory Management with Power BI Dashboards in 2024
Favicon
Guía Paso a Paso para Realizar una Portabilidad Telefónica Empresarial
Favicon
Low-Code, Big Risks: Why Security Awareness is Crucial for Citizen Developers
Favicon
How to Build an AI Agent to Automate Mobile Auto Repair Task Scheduling
Favicon
💸 Make Money with Your AI Agent
Favicon
Writing Clean Code in Ruby on Rails Applications 🧼💻
Favicon
ALWAYS A DATA NERD
Favicon
Dataverse Solution Checker doesn't like PCFs
Favicon
Permission and Data Security in No-Code: Why it matters and How to control
Favicon
Best Tool for Query anything with SQL
Favicon
Unveiling the Mysteries: Dataverse API
Favicon
Guide: How to add Write-Back capabilities to Power BI reports with Power Apps — Part 2
Favicon
Guide: How to add Write-Back capabilities to your Power BI reports with Power Apps - Part 1
Favicon
Draw on the HTML canvas without code
Favicon
The Impact of Low-Code/No-Code Tools on Traditional Software Development
Favicon
Microsoft Power BI Consulting & Development Services
Favicon
🚀 Embed Formbricks Forms in Webflow in Minutes — No Code, Just Magic! 💻✨

Featured ones: