- AI-Powered Ticket Processing:
- Automatic ticket categorization.
- Smart priority assignment.
- Skill-based moderator matching.
- AI-generated helpful notes for moderators.
- Smart Moderator Assignment:
- Automatic matching of tickets to moderators based on their skills.
- Fallback to admin assignment if no suitable moderator is found.
- Skill-based routing system to ensure tickets are handled by the most qualified personnel.
- User Management:
- Role-based access control (User, Moderator, Admin).
- Skill management for moderators.
- User authentication using JWT (JSON Web Tokens).
- Background Processing:
- Event-driven architecture facilitated by Inngest for background jobs.
- Automated email notifications.
- Asynchronous ticket processing for improved performance.
The project is built with a modern stack, combining robust backend services with powerful AI capabilities:
- Backend: Node.js with Express
- Database: MongoDB
- Authentication: JWT
- Background Jobs: Inngest (for event-driven workflows and durable functions)
- AI Integration: Google Gemini API (for intelligent ticket analysis and processing)
- Email: Nodemailer with Mailtrap (for email testing)
- Development: Nodemon (for hot reloading)
The AI Ticket Agent operates through a streamlined process:
- Ticket Creation: A user submits a support ticket with a title and description. The system records the initial ticket.
- AI Processing: An
on-ticket-created
event is triggered via Inngest. An AI agent (powered by Google Gemini) analyzes the ticket content to generate:- Required skills for resolution.
- A priority level.
- Helpful notes for the assigned moderator.
- Moderator Assignment: The system searches for moderators with skills matching the ticket's requirements. If a match is found, the ticket is assigned; otherwise, it falls back to administrator assignment.
- Notification: An email notification containing ticket details and AI-generated notes is sent to the assigned moderator.
- Resolution: The moderator addresses the ticket and resolves it, updating the system accordingly.
- Clone the Repository:
git clone https://github.com/Vedant224/aiticketagent.git
cd aiticketagent
-
Install Dependencies: Navigate into both
ai-ticket-assistant
andai-ticket-frontend
directories and install their respective dependencies: -
Environment Variables: Create a
.env
file in theai-ticket-assistant
directory and configure the following:
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
MAILTRAP_SMTP_HOST=your_mailtrap_host
MAILTRAP_SMTP_PORT=your_mailtrap_port
MAILTRAP_SMTP_USER=your_mailtrap_user
MAILTRAP_SMTP_PASS=your_mailtrap_password
GEMINI_API_KEY=your_gemini_api_key
APP_URL=http://localhost:your_frontend_port
-
Run the Application:
Start the backend server:
bash npm run dev npm run inngest-dev
- Access the application through your web browser at the specified
APP_URL
.
- Access the application through your web browser at the specified
-
Register a new user or log in with existing credentials.
-
Submit a new support ticket with a descriptive title and detailed description.
-
Monitor the ticket's progress as it is processed by the AI and assigned to a moderator.
-
Admins can manage users, roles, and skills via the admin interface.
Authentication:
POST /api/auth/signup
: Register a new user.POST /api/auth/login
: Login and receive a JWT token.
Tickets:
POST /api/tickets/create-ticket
: Create a new ticket.GET /api/tickets/get-tickets
: Get all tickets for the logged-in user.GET /api/tickets/get-ticket/:id
: Get details for a specific ticket.
Admin (Admin Only):
GET /api/auth/users
: Get a list of all users.POST /api/auth/update-user
: Update user roles and skills.
AI Processing Errors:
- Verify your
GEMINI_API_KEY
in the.env
file. - Check your Google Gemini API quota and limits.
- Validate the request format being sent to the AI API.
Email Issues:
- Verify your Mailtrap credentials and SMTP settings.
- Monitor Mailtrap's email delivery logs for any errors.