Skip to content

muhammadali493/Support-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Support Ticket Resolution Agent – Modular Agentic System

This project implements a modular, agentic AI workflow for automated support ticket handling using LangGraph.
It uses RAG for context retrieval and an iterative review loop to ensure high-quality, compliant responses — escalating to human review if necessary.


📂 Project Overview

Features

  • Ticket Classification: Classify the ticket based on subject + description.
  • Retrieval: Fetch relevant info for that category.
  • Response Generation: Generate a draft response based on context and ticket details.
  • Reviewer Feedback Loop: Reviews the draft for:
    • Relevance & accuracy
    • Helpfulness
    • Compliance with support guidelines
  • Max 2 Review Attempts: If both fail, escalate to a human agent.
  • Escalation Logging: Failing drafts + feedback stored in escalation_log.csv.

⚙️ 1. Setup Instructions

1.1 Prerequisites

Ensure you have installed:

  • Python 3.10+
  • pip
  • LangGraph
  • An OpenAI API key

1.2 Environment Setup

# Clone repository
git clone https://github.com/your-username/support-ticket-agent.git
cd support-ticket-agent

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
.venv\Scripts\activate     # Windows

# Install dependencies
pip install langgraph langchain langchain-openai python-dotenv openai

1.3 Environment Variables

# Create a `.env` file in the root directory:

OPENAI_API_KEY=your_openai_api_key_here

2. Running the Agent

2.1 Start the workflow

python main.py

3. Project Structure

support_ticket_system/
│
├── main.py                       # Entry point to run the workflow
├── graph.py                      # Entry point to run the workflow
│
├── nodes/
│   ├── classifier.py             # Category classification node
│   ├── rag.py                    # Category-specific RAG retrieval
│   ├── generator.py              # Generates draft responses
│   ├── reviewer.py               # Reviews drafts, gives feedback
│   ├── escalate.py               # Handles escalation logging
│
├── utils/
│   ├── formatters.py             # Formates the context
│   ├── logger.py                 # Escalation CSV logging
│
└── logs/
└── escalation_log.csv            # Where escalations are stored

4. Design & Architecture

4.1 Nodes

rag nodes

Fetch relevant knowledge snippets based on the ticket content.


generator node

An LLM-based node that uses retrieved context + ticket details to draft a response.


Reviewer node

Checks the draft for:

  • Relevance & Accuracy
  • Helpfulness
  • Compliance
    • No overpromises
    • No unauthorized refunds
    • No sensitive security advice

EscalationHandlerNode

Logs the following into escalation_log.csv:

  • Original ticket
  • Failed drafts
  • Reviewer feedback

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages