SmartLine is an advanced AI-powered automation platform designed to replace traditional human call center agents with intelligent AI agents. These agents can handle a wide range of business tasks, including customer support, lead generation, order confirmation, and more. Built with Django (backend), React.js (frontend), and MySQL (database), for Inbound & outbound call agents built with Twilio, OpenAI API, and LangChain, SmartLine is a scalable and efficient solution for businesses looking to automate their operations.
- Project Overview
- Inbound and Outbound Call System
- Unique Features
- Live Demo
- Key Features
- Technologies Used
- Prerequisites
- Installation
- Deployment
- AI Agent Workflow
- License
- Key Pages
- Project Context
- Screenshots
SmartLine is designed to streamline and automate call center operations, reducing the need for human intervention while maintaining high levels of customer satisfaction. By leveraging AI technologies, SmartLine provides a cost-efficient and scalable solution for businesses of all sizes.
The Inbound Call System is designed to handle incoming customer support calls. It uses Twilio's WebSocket API to stream audio in real-time and OpenAI's GPT model to generate responses.
- Real-time audio streaming using Twilio WebSocket.
- Integration with OpenAI for natural language processing.
- Automated responses for customer queries.
- Transcript logging for each call.
- When a call is received, Twilio sends a request to the
/stream/incoming-call
endpoint. - The system establishes a WebSocket connection with Twilio and OpenAI.
- Audio is streamed in real-time, and OpenAI generates responses based on the conversation.
- The call transcript is logged for future reference.
The Outbound Call System is used for making automated calls for:
- Order confirmations.
- Lead generation.
- Order status updates.
- Automated outbound calls using Twilio.
- Real-time interaction with customers using OpenAI.
- Customizable initial messages for different use cases.
- Transcript logging for each call.
- The system initiates an outbound call using Twilio's API.
- A WebSocket connection is established with Twilio and OpenAI.
- The AI introduces itself and interacts with the customer based on predefined prompts.
- The call transcript is logged for future reference.
- Inbound and Outbound Calls: Handle both incoming and outgoing calls seamlessly.
- Multilingual Support: Communicate with customers in multiple languages.
- Order Status Checking: Automatically check and update order statuses.
- Item Search: Search for products or services during customer interactions.
- Smart Hangup: Detect when a call ends and automatically hang up.
- Transcript and Summary: Provide a full transcript and summary of each call.
- Post-Call Processing (Google Sheets Integration): Add and edit data in Google Sheets for order confirmations and lead generation.
Explore the live demo of SmartLine:
š SmartLine Live Demo
š¹ Video of the AI agent doing order confirmation
š¹ Video of the AI agent doing lead generation
š¹ Video of the AI agent receiving customer inquiries
- AI-Powered Agents: Intelligent agents capable of handling customer interactions, sales, and support tasks.
- Task Automation: Automate repetitive tasks such as appointment scheduling, order tracking, and FAQs.
- Edits on Spreadsheets: Puts the output of the call (summary, transcript, and order name) on a spreadsheet for the owner to see.
- Real-Time Analytics: Monitor agent performance, customer satisfaction, and task completion rates.
- Customizable Workflows: Tailor AI agents to suit specific business needs.
Before running the project, ensure you have the following installed:
- Python 3.12
- Node.js and npm
- MySQL Server
- Django
- React.js
-
Clone the repository:
git clone https://github.com/redaelkate/smartline.git cd smartline/backend
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up the MySQL database:
- Create a database in MySQL.
- Update the
settings.py
file with your database credentials:DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'your_database_name', 'USER': 'your_database_user', 'PASSWORD': 'your_database_password', 'HOST': 'localhost', 'PORT': '3306', } }
-
Run migrations:
python manage.py migrate
-
Start the Django development server:
python manage.py runserver
-
Navigate to the frontend directory:
cd ../frontend
-
Install dependencies:
npm install
-
Start the React development server:
npm run dev
The frontend is deployed on Vercel. To deploy your own version:
- Install the Vercel CLI:
npm install -g vercel
- Deploy the frontend:
cd frontend vercel
The backend can be deployed on PythonAnywhere. To deploy:
- Create a new WebApp on PythonAnywhere.
- Upload your Django files.
- Set environment variables for your database and Django settings.
- Deploy!
SmartLine's AI agents are designed to handle the following tasks:
- Customer Support: Answer FAQs, resolve issues, and escalate complex queries.
- Sales: Recommend products, process orders, and upsell/cross-sell.
- Appointment Scheduling: Book, reschedule, and cancel appointments.
- Data Collection: Gather customer feedback and insights for analytics.
The system uses Twilio for call automation and FastAPI for real-time audio streaming and AI integration. Hereās how the workflow operates:
-
Initiate Outbound Call:
- The system initiates an outbound call using the Twilio Service.
- The Twilio Agent handles the call setup and connection.
-
Play Audio to Customer:
- Once the call is connected, the system plays pre-recorded or dynamically generated audio to the customer.
-
Customer Responds:
- The customerās response is captured and streamed to the FastAPI Application.
-
Stream Audio to AI Model:
- The FastAPI Agent streams the customerās audio to the AI Model Service for processing.
-
Generate Response:
- The AI Model Agent analyzes the audio and generates an appropriate response.
- The response is sent back to the FastAPI Agent.
-
Stream Response to Twilio:
- The generated response is streamed back to the customer via the Twilio Service.
-
Handle Hangup:
- The Hangup Check Agent continuously monitors the call for a hangup signal.
- If a hangup is detected, the Handle Hangup Agent terminates the call and triggers post-call processing.
-
Post-Call Processing:
- The Data Collection Agent collects call data and updates the Excel Sheet for reporting and analytics.
This project is licensed under the Apache License. See the LICENSE file for details.
- Dashboard: Overview of AI agent performance, task completion rates, and customer satisfaction.
- Agents: Customize AI agent behavior, workflows, and integrations.
- Call Logs: View detailed logs of all outbound and inbound calls.
- Analytics: Monitor key metrics such as call duration, customer satisfaction, and agent performance.
This project, SmartLine, was developed as part of a hackathon organized by AI Crafters. The hackathon focused on building voice bots, and SmartLine emerged as a promising solution designed to streamline call center operations.