Skip to content

grave021999/it_ticket_intelligent_agent

Repository files navigation

banner # 🎟️ IT Ticket AI System

A multi-agent AI system for intelligent IT ticket management with natural language processing, trend analysis, and automated insights.


✨ Features

  • πŸ€– Multi-Agent Architecture - Specialized AI agents for different tasks
  • πŸ“Š Analytics Agent - Real-time trend analysis and pattern detection
  • πŸ—£οΈ Natural Language Interface - Conversational AI responses (no more JSON!)
  • πŸ”„ Agent-to-Agent Communication - Seamless task delegation via A2A protocol
  • πŸ› οΈ MCP Tools - Model Context Protocol for ticket operations
  • 🎯 Intelligent Routing - Queries automatically routed to the right agent

πŸš€ Quick Start

1. Prerequisites

  • Python 3.9+
  • OpenAI API key (set as environment variable OPENAI_API_KEY)
  • Required packages: pip install -r requirements.txt

2. Start the System

Option A: PowerShell Script (Recommended)

.\START_ALL.ps1

Option B: Manual Startup

# Start each service in order
Start-Process python -ArgumentList "a2a_protocol/real_a2a_server.py"
Start-Sleep -Seconds 2

Start-Process python -ArgumentList "mcp_server/real_mcp_server.py"
Start-Sleep -Seconds 2

Start-Process python -ArgumentList "agents/real_analytics_agent.py"
Start-Sleep -Seconds 2

Start-Process python -ArgumentList "agents/real_main_agent.py"
Start-Sleep -Seconds 2

Start-Process streamlit -ArgumentList "run ui/full_agent_app.py"

3. Access the Application

Open your browser to: http://localhost:8501


πŸ“‹ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Full Agent App (Streamlit)    β”‚  ← User Interface
β”‚        Port 8501                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
       β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚           β”‚               β”‚
   β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
   β”‚  A2A   β”‚  β”‚   MCP   β”‚  β”‚  OpenAI    β”‚
   β”‚ Server β”‚  β”‚  Server β”‚  β”‚    API     β”‚
   β”‚  9090  β”‚  β”‚  8080   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
    β”Œβ”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                 β”‚
β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Analytics   β”‚  β”‚  Main Agent   β”‚
β”‚   Agent      β”‚  β”‚               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components

  1. A2A Server (Port 9090)

    • Agent-to-Agent communication protocol
    • Task delegation and status management
    • Agent registration and discovery
  2. MCP Server (Port 8080)

    • Model Context Protocol implementation
    • Ticket search, analysis, and summarization tools
    • Direct access to ticket data
  3. Analytics Agent

    • Specialized in trend analysis and pattern detection
    • Processes complex analytical queries
    • Returns detailed insights and recommendations
  4. Main Agent

    • Query orchestration and routing
    • Handles general user interactions
    • Delegates to Analytics Agent when needed
  5. Full Agent App (Streamlit UI)

    • Web-based user interface
    • Natural language query processing
    • AI-powered response conversion

πŸ§ͺ Example Queries

Analytics Queries (Uses Analytics Agent)

βœ… "Show tickets assigned to Michael and give trend"
βœ… "Analyze trends in network issues"
βœ… "Generate a comprehensive report"
βœ… "What patterns do you see in high priority tickets?"
βœ… "Give me insight into hardware failures"

Search Queries (Uses MCP Tools)

βœ… "Show me all tickets"
βœ… "Find tickets assigned to Sarah"
βœ… "List high priority tickets"
βœ… "Search for network-related issues"

Summary Queries

βœ… "What's the ticket summary?"
βœ… "Give me an overview of all tickets"
βœ… "Show me statistics"

πŸ“Š Example Response

Query: "Show tickets assigned to Michael and give trend"

Response:

πŸ“Š Analytics Agent Response

Based on my analysis of the tickets assigned to Michael, I've reviewed 150 tickets 
and discovered some interesting patterns.

The most notable trend is that network issues are on the rise - we're seeing about 
a 15% increase compared to previous periods. This is something we should pay attention 
to.

Looking at the categories, the top three areas are Network issues, Email problems, 
and Hardware-related requests. The priority distribution shows that 60% are Medium 
priority, 25% are High priority (needing immediate attention), and 15% are Low priority.

Here are my recommendations:

1. Focus on network infrastructure improvements - With the 15% increase in network 
   issues, we should investigate the root cause.

2. Consider additional email support resources - Email is a top category, so evaluate 
   if more support is needed.

3. Monitor hardware failure patterns - Keep an eye on hardware issues to identify 
   any patterns.

Let me know if you'd like me to dive deeper into any of these areas!

πŸ”§ Troubleshooting

Services Won't Start

# Check if ports are in use
netstat -ano | findstr ":9090"
netstat -ano | findstr ":8080"

# Stop all Python processes
Get-Process python,streamlit -ErrorAction SilentlyContinue | Stop-Process -Force

# Restart services
.\START_ALL.ps1

Connection Issues

  • Ensure all services start in order (A2A β†’ MCP β†’ Agents β†’ UI)
  • Wait 2-3 seconds between starting each service
  • Check that OPENAI_API_KEY environment variable is set

πŸ“ Project Structure

it_tickets_project/
β”œβ”€β”€ a2a_protocol/
β”‚   └── real_a2a_server.py      # Agent-to-Agent server
β”œβ”€β”€ agents/
β”‚   β”œβ”€β”€ real_analytics_agent.py  # Analytics specialist
β”‚   └── real_main_agent.py       # Main orchestrator
β”œβ”€β”€ mcp_server/
β”‚   └── real_mcp_server.py       # MCP tools server
β”œβ”€β”€ ui/
β”‚   └── full_agent_app.py        # Main Streamlit app
β”œβ”€β”€ data/
β”‚   └── dummy_it_tickets.csv     # Sample ticket data
β”œβ”€β”€ START_ALL.ps1                # PowerShell startup script
β”œβ”€β”€ requirements.txt             # Python dependencies
└── README.md                    # This file

πŸ“š Additional Documentation

  • FINAL_SOLUTION.md - Technical details of the complete solution
  • NATURAL_LANGUAGE_RESPONSE.md - How natural language conversion works
  • QUICK_START_GUIDE.md - Detailed startup instructions
  • SYSTEM_SETUP.md - Comprehensive system setup guide

πŸ›‘ Stopping the System

# Stop all services
Get-Process python,streamlit -ErrorAction SilentlyContinue | Stop-Process -Force

🎯 Key Features Explained

1. Natural Language Processing

The system uses GPT-4o-mini to convert technical JSON responses into conversational, human-friendly explanations.

2. Intelligent Agent Routing

Queries containing keywords like "trend", "analysis", "pattern", or "insight" are automatically routed to the Analytics Agent.

3. Multi-Layer Fallback

If the Analytics Agent is unavailable, the system falls back to:

  1. MCP trend analysis tools
  2. MCP search tools
  3. Direct AI response

4. Real-Time Analytics

The Analytics Agent processes queries in real-time and provides:

  • Trend analysis
  • Pattern detection
  • Statistical summaries
  • Actionable recommendations

πŸ’‘ Tips

  • Start queries with action words: "Show", "Analyze", "Find", "Generate"
  • Be specific: "Network issues in Q4" vs "issues"
  • Use natural language: Ask as you would ask a colleague
  • Try different phrasings if results aren't what you expect

πŸŽ‰ System Status

βœ… Multi-Agent Architecture - Working
βœ… Natural Language Responses - Working
βœ… Analytics Agent - Working
βœ… Task Delegation - Working
βœ… Real-Time Analysis - Working
βœ… Fallback Mechanisms - Working

πŸ“„ License

This project is for internal use and demonstration purposes.


🀝 Support

For issues or questions, refer to the documentation files or check the troubleshooting section above.


Enjoy your intelligent IT ticket management system! 🎊

About

🎫 A multi-agent AI system for intelligent IT ticket management with NLP-powered trend analysis, A2A protocol communication, and MCP tools β€” built with Python and Streamlit

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors