This project automates the classification of customer tickets into different areas and levels of support and determines ticket priority using AI. The system integrates with Intercom to receive customer inputs, classifies them based on area, and routes them accordingly. It determines if a ticket falls under support, sales, or finance, and takes actions like creating deals in Pipedrive, adding records to an ERP system, sending messages via Slack and generating tickets in Intercom.
- Intercom
- Pipedrive
- Slack
To customize this template for your team and build a lot more, book a demonstration here.
To use this project, some initial configurations are necessary:
-
Python Version: Ensure Python version 3.9 or higher is installed on your system.
-
Integrations: This template uses the Pipedrive, Intercom, and Slack APIs. You need to have API keys to these services.
-
Environment Variables: The following environment variables are required for both local development and online deployment:
INTERCOM_API_KEY
: API key for Intercom;PIPEDRIVE_API_KEY
: API key for Pipedrive;SLACK_BOT_TOKEN
: Token for Slack bot;SLACK_CHANNEL_SUPPORT
: Slack channel ID for support;SLACK_CHANNEL_CS
: Slack channel ID for customer success;SLACK_CHANNEL_DEV
: Slack channel ID for development.
For local development, create a
.env
file at the root of the project and add the variables listed above (refer to.env.examples
). For online deployment, configure these variables in your environment settings. -
Dependencies: To install the necessary dependencies for this project, a
requirements.txt
file is provided. This file includes all the required libraries.Follow these steps to install the dependencies:
-
Open your terminal and navigate to the project directory.
-
Run the following command to install the dependencies from
requirements.txt
:pip install -r requirements.txt
-
-
Local Usage: To access the local editor with the project, use the following command:
abstra editor path/to/your/project/folder/
The following workflows automate the process of classifying customer tickets based on area and support level.
The system receives messages from Intercom through a webhook integration with the platform.
- intercom_new_message.py: Hook to receive and handle incoming conversations from Intercom.
AI is used to classify tickets by determining the appropriate area and priority level.
- classify_tickets.py: Script to classify the area (e.g., sales, finance, support) and the ticket's priority.
For tickets related to the finance area, the system automatically adds the details to the ERP.
- add_finance_tickets_to_erp.py: Script to add finance-related ticket data to the ERP system.
For sales-related tickets, a deal is automatically created in Pipedrive.
- create_deal_pipedrive.py: Script to create a deal in Pipedrive for sales-related tickets.
The system determines the appropriate support level (N1, N2, or N3) using AI.
- classify_support_level.py: Script to decide between N1, N2, or N3 support levels.
The conversation is converted into an open ticket within Intercom.
- convert_conversation_to_ticket.py: Script to create a formal ticket in Intercom based on the conversation.
A message containing the problem description is sent to the appropriate Slack channel, depending on the support level.
- send_conversation_to_slack.py: Script to send a Slack message to the corresponding channel based on the ticket's support level.
If you're interested in customizing this template for your team in under 30 minutes, book a customization session here.