A modern ticketing system built with Next.js, Supabase, and a queue-cron classification worker.
This project enables seamless support ticket management, automated classification, and intelligent response generation for customer queries.
- AI Embedding & Classification Pipeline:
- Incoming tickets are enqueued for processing via a queue system.
- Edge function workers pick up jobs from the queue to perform semantic embedding (using external models like OpenAI or HuggingFace).
- Embeddings are stored in Supabase for similarity search and retrieval.
- Classification models analyze ticket content for:
- Topic tags
- Sentiment
- Priority
- A cron job service regularly triggers edge function workers to process new or pending tickets, ensuring timely embedding and classification.
- AI-generated responses are created using LLMs, with references and confidence scores.
This section describes the backend pipeline for ticket embeddings and classification, detailing the workflow from ticket submission to AI-powered classification and reference retrieval.
- Users or admins submit tickets via the UI or batch upload.
- Each ticket contains metadata (id, subject, description, name, email).
- Upon creation, tickets are immediately added to a processing queue.
- A queue system (a pgmq queue) tracks tickets awaiting embedding and classification.
- Each new ticket is enqueued with its metadata and status.
- Edge function workers or serverless jobs monitor the queue for new tickets.
- For each ticket, the worker:
- Generates a semantic vector embedding for the ticket description using external AI models (e.g., OpenAI, HuggingFace).
- Stores the embedding in Supabase for fast similarity search and retrieval and enqueue a job for classification queue once embeddings are generated.
- The worker analyzes the ticket text using AI models to assign:
- Topic tags (e.g., "Snowflake", "Lineage", "Integration")
- Sentiment (e.g., "frustrated", "curious", "neutral")
- Priority (e.g., "high", "medium", "low")
- Classification results are saved with the ticket record for downstream use.
- Using the generated embedding, the system performs a similarity search against a corpus of reference documents stored in Supabase.
- The most relevant documents are retrieved and attached to the ticket for context and support.
- The embedding is also used to search for similar tickets in the database.
- Similar tickets are surfaced to help admins identify recurring issues and leverage previous solutions.
- A cron job service runs at regular intervals to trigger edge function workers.
- Ensures all new or pending tickets are picked up for embedding, classification, and reference retrieval.
- Triggers update ticket status as processing progresses.
- For each ticket, an LLM generates a suggested response, including:
- Answer text
- Source references (from similarity search)
- Confidence score
- Admins view ticket details, AI analysis, suggested responses, references, and similar tickets.
- Responses can be edited, references selected, and sent to the user.
- Ticket status is updated accordingly.
To provide high-quality references for ticket responses, the platform includes a documentation scraper pipeline:
- A custom scraper crawls all links from the Atlan documentation and developer website.
- The scraper recursively discovers and visits all internal documentation pages.
- For each page, it extracts the main content, filtering out navigation, ads, and irrelevant sections.
- The scraper parses each page to extract relevant text, such as guides, API docs, troubleshooting steps, and FAQs.
- Extracted text is cleaned and segmented into logical chunks (e.g., paragraphs, sections).
- Each text chunk is processed using an AI model (e.g., OpenAI, HuggingFace) to generate a semantic vector embedding.
- Embeddings, along with metadata (URL, title, section), are stored in Supabase.
- When a ticket is processed, its embedding is used to perform a similarity search against the documentation embeddings.
- The most relevant documentation chunks are retrieved and attached to the ticket as references.
- These references help generate accurate, context-aware AI responses for users.
-
Batch Ticket Creation:
Easily upload multiple tickets via JSON input, assigning a common name and email. -
AI-Powered Classification:
Automated tagging, sentiment analysis, and priority assessment for every ticket. -
Intelligent Response Generation:
LLM-generated answers with relevant references and confidence scores. -
Admin Dashboard:
Manage tickets, review AI analysis, and send responses with reference selection. -
Secure & Scalable:
Supabase handles authentication, data storage, and vector embeddings.
-
Clone the repository:
git clone <your-repo-url> cd atlan
-
Configure environment variables:
- Copy
.env.exampleto.env.local - Set your Supabase project URL, anon key, and service role key.
- Copy
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Access the admin dashboard:
- Visit
/admin/ticketsfor ticket management. - Visit
/admin/tickets/batchfor batch ticket upload.
- Visit
Please open issues or feature requests in this repository.
MIT

