An AI-powered support ticket system where autonomous agents handle the entire triage workflow — from analyzing issues and extracting priorities to matching tickets with the right moderators and sending notifications. No manual routing needed.
TODO: Add screenshots and demo video. See the Media section for recommended assets.
┌─────────────────────────────────────────────────────────────────────┐
│ FRONTEND (React + Vite) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Signup │ │ Login │ │ Tokens │ │ Admin Panel │ │
│ │ Page │ │ Page │ │ Dashboard│ │ (User Mgmt) │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────────┘ │
│ │ │ │ │ │
│ └─────────────┴─────────────┴───────────────┘ │
│ │ REST API │
└──────────────────────────────┼──────────────────────────────────────┘
│
┌──────────────────────────────┼──────────────────────────────────────┐
│ BACKEND (Express + MongoDB) │
│ │ │
│ ┌──────────────────────────▼───────────────────────────────┐ │
│ │ Express API Server │ │
│ │ /api/auth/* /api/tokens/* /api/inngest │ │
│ └──────────────────────────┬───────────────────────────────┘ │
│ │ │
│ ┌───────────────────┼───────────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ MongoDB │ │ Inngest │ │ Mailtrap │ │
│ │ Database │ │ Workflows │ │ SMTP │ │
│ └─────────────┘ └──────┬──────┘ └─────────────┘ │
│ │ │
│ ┌────────────────────┼────────────────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌───────────┐ ┌───────────────┐ ┌──────────────┐ │
│ │ Agent 1 │ │ Agent 2 │ │ Google │ │
│ │ Welcome │ │ AI Triage │ │ Gemini │ │
│ │ Email │ │ Pipeline │ │ 2.5 Flash │ │
│ └───────────┘ └───────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
This system uses two autonomous AI agents built on Inngest's durable workflow engine:
Triggered when a new user signs up. Looks up the user in the database and sends a welcome email via Mailtrap SMTP.
Triggered when a support token is created. Runs a 6-step pipeline:
Token Created
│
▼
┌─────────────────┐
│ 1. Fetch Token │ Retrieve from MongoDB
└────────┬────────┘
▼
┌─────────────────┐
│ 2. Set Status │ Mark as "TODO"
└────────┬────────┘
▼
┌─────────────────────────────────────────┐
│ 3. AI Analysis (Google Gemini 2.5 Flash) │
│ • Summary extraction │
│ • Priority classification │
│ • Helpful notes generation │
│ • Related skills extraction │
└────────┬────────────────────────────────┘
▼
┌─────────────────┐
│ 4. Update Token │ Save AI results to DB
└────────┬────────┘
▼
┌─────────────────────────────────────────┐
│ 5. Auto-Assignment │
│ • Match skills → moderator │
│ • Fallback → admin │
└────────┬────────────────────────────────┘
▼
┌─────────────────┐
│ 6. Notify │ Email assigned moderator
└─────────────────┘
- Autonomous AI Triage — Google Gemini analyzes each ticket, extracts priority, summary, and required skills automatically
- Smart Assignment — Tickets are routed to moderators based on skill matching, with admin fallback
- Durable Workflows — Inngest ensures each pipeline step is retriable and fault-tolerant
- Role-Based Access — Three roles (user, moderator, admin) with distinct permissions
- Skill-Based Routing — Moderators have skill tags; AI matches ticket requirements to the right person
- Email Notifications — Assigned moderators receive automatic email alerts
- Admin Panel — Full user management: roles, skills, and search
| Layer | Technology | Purpose |
|---|---|---|
| AI Engine | Google Gemini 2.5 Flash | Ticket analysis, priority extraction, skill matching |
| Agent Framework | Inngest + @inngest/agent-kit | Durable multi-step workflows with retries |
| Backend | Express v5 + Node.js | REST API server |
| Database | MongoDB + Mongoose | User and token persistence |
| Auth | JWT + bcrypt | Token-based authentication with password hashing |
| Frontend | React 19 + Vite | Single-page application |
| Styling | Tailwind CSS v4 + DaisyUI v5 | UI components and responsive design |
| Nodemailer + Mailtrap | SMTP email delivery (dev sandbox) |
AI-Multi-Agents-v1/
├── ai-token-assistant/ # Backend API
│ ├── index.js # Express server entry point
│ ├── env.js # Environment config loader
│ ├── makeAdmin.js # CLI: promote user to admin
│ ├── controllers/
│ │ ├── token.js # Token CRUD + creation event
│ │ └── user.js # Auth + user management
│ ├── inngest/
│ │ ├── client.js # Inngest client setup
│ │ └── functions/
│ │ ├── onsignup.js # Agent 1: welcome email
│ │ └── ont-token-create.js # Agent 2: AI triage pipeline
│ ├── middlewares/
│ │ └── auth.js # JWT verification + role guards
│ ├── models/
│ │ ├── token.js # Token schema (title, priority, skills...)
│ │ └── user.js # User schema (email, role, skills)
│ ├── routes/
│ │ ├── token.js # /api/tokens/*
│ │ └── user.js # /api/auth/*
│ ├── scripts/
│ │ └── cleanDb.js # Database cleanup utility
│ └── utils/
│ ├── Ai.js # Gemini AI agent wrapper
│ └── mailer.js # Nodemailer SMTP config
│
├── ai-token-frontend/ # React SPA
│ ├── src/
│ │ ├── main.jsx # App entry point
│ │ ├── components/
│ │ │ ├── checkauth.jsx # Route guard (auth protection)
│ │ │ └── navbar.jsx # Dynamic navigation bar
│ │ ├── lib/
│ │ │ └── api.js # API client (axios)
│ │ └── pages/
│ │ ├── login.jsx # Login page
│ │ ├── Signup.jsx # Registration page
│ │ ├── tokens.jsx # Token list + creation
│ │ ├── token.jsx # Token detail view
│ │ └── admin.jsx # Admin user management
│ └── vite.config.js
│
└── README.md
- Node.js 18+
- MongoDB instance (local or Atlas)
- Google Gemini API key
- Mailtrap account (for email testing)
# Clone the repository
git clone https://github.com/your-username/AI-Multi-Agents-v1.git
cd AI-Multi-Agents-v1Backend setup:
cd ai-token-assistant
npm install
# Create environment file
cp .env.sample .env
# Edit .env with your credentialsFrontend setup:
cd ../ai-token-frontend
npm install
# Create environment file
cp .env.example .env
# Set VITE_SERVER_URL=http://localhost:3000/apiBackend (ai-token-assistant/.env):
| Variable | Description |
|---|---|
MONGO_URI |
MongoDB connection string |
JWT_SECRET |
Secret key for JWT signing |
GEMINI_API_KEY |
Google Gemini API key |
MAILTRAP_SMTP_HOST |
Mailtrap SMTP host |
MAILTRAP_SMTP_PORT |
Mailtrap SMTP port |
MAILTRAP_SMTP_USER |
Mailtrap SMTP username |
MAILTRAP_SMTP_PASS |
Mailtrap SMTP password |
APP_URL |
Frontend URL (http://localhost:5173) |
Frontend (ai-token-frontend/.env):
| Variable | Description |
|---|---|
VITE_SERVER_URL |
Backend API URL (http://localhost:3000/api) |
You need three terminals running simultaneously:
# Terminal 1 — Backend API
cd ai-token-assistant
npm run dev
# Terminal 2 — Inngest Dev Server
cd ai-token-assistant
npm run inngest-dev
# Terminal 3 — Frontend
cd ai-token-frontend
npm run dev- Open
http://localhost:5173and create an account - Promote your user to admin:
cd ai-token-assistant node makeAdmin.js your-email@example.com - Log in again — you now have access to the Admin panel
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/auth/signup |
— | Register a new user |
POST |
/api/auth/login |
— | Login, returns JWT |
POST |
/api/auth/logout |
User | Verify token (stateless) |
GET |
/api/auth/users |
Admin | List all users |
POST |
/api/auth/update-user |
Admin | Update user role & skills |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/api/tokens |
User | List tokens (own for users, all for mods/admins) |
GET |
/api/tokens/:id |
User | Get token details |
POST |
/api/tokens |
User | Create token (triggers AI triage) |
User:
email— Unique email addresspassword— Bcrypt-hashed passwordrole—user|moderator|adminskills— Array of skill tags (e.g.,["React", "MongoDB"])
Token:
title— Issue titledescription— Full issue descriptionstatus—TODO|IN_PROGRESSpriority—low|medium|high(AI-generated)helpfulNotes— AI-generated technical notesrelatedSkills— AI-extracted skill tagsassignedTo— Assigned moderator/admin referencecreatedBy— Token creator reference
| Component | What to Change |
|---|---|
| AI Model | Swap Gemini for any LLM in utils/Ai.js |
| Email Provider | Replace Mailtrap with any SMTP provider in utils/mailer.js |
| Skills Taxonomy | Update the AI prompt in utils/Ai.js to extract domain-specific skills |
| Assignment Logic | Modify the matching algorithm in ont-token-create.js |
| UI Theme | Change DaisyUI theme in Tailwind config |
- Inngest for the durable workflow engine and agent framework
- Google Gemini for the AI analysis capabilities
- DaisyUI for the UI component library
- Mailtrap for email testing infrastructure
Built with autonomous agents. Powered by intelligent automation.