The Problem: Manual Ticket Triage in a Swiss Professional Services Firm
You run a 501-2000 employee professional services firm in Switzerland. Your operations team spends 12-18 hours per week manually triaging client tickets, routing them to the wrong queue, and re-keying data into the CRM. The EU AI Act does not directly apply to Swiss firms, but your EU-based clients will contractually demand Article 50 transparency for any AI system that touches their data. You have already automated one back-office process (invoice processing), and now you want to extend AI to customer-facing channels. The specific use case is ticket triage and routing: classify incoming tickets, extract key entities, route to the correct queue, and draft a first response. The constraint is a 4-week fixed-scope pilot with a measurable before/after baseline on cycle time and error rate. The architecture must plug into your existing helpdesk and CRM via custom REST API and webhooks, not replace them.
Prerequisites Before Step 1
- Helpdesk API access: Your helpdesk (e.g., Zendesk, Freshdesk, or a custom system) must expose a REST API with endpoints for: listing tickets, fetching ticket details, updating ticket status, and creating webhooks for new ticket events. You need OAuth 2.0 or API key authentication.
- CRM integration: Your CRM (e.g., Salesforce, HubSpot, or a custom system) must expose a REST API for reading and writing client records. The agent will need to fetch client context (contract type, SLA tier, historical tickets) to inform routing decisions.
- Model access: You need API keys for at least one LLM provider (OpenAI, Anthropic, or a self-hosted open-weight model). For the pilot, one model is sufficient; the architecture should support swapping models later.
- Human approval UI: A simple web interface where a human can review the agent’s proposed classification, extracted entities, and draft response, then approve, edit, or escalate. This can be a lightweight React app or a form in your existing internal tool.
- Baseline data: At least 200 historical tickets with timestamps, queue assignments, and resolution notes. This is your before/after measurement set.
- Legal review: A 1-hour consultation with your legal team to confirm EU AI Act applicability and any Swiss-specific data protection requirements under the FADP (Federal Act on Data Protection).
Step 1: Process Audit and Baseline Measurement
Spend 3-4 days mapping the current triage workflow. Document: (1) the average cycle time from ticket creation to first human response, (2) the error rate (tickets misrouted or requiring rework), (3) the top 5 ticket categories by volume, and (4) the decision rules humans use to route tickets. For a 501-2000 employee firm, you should sample at least 200 tickets over 2 weeks. Record the baseline metrics in a spreadsheet: ticket_id, created_at, first_response_at, assigned_queue, final_queue, rework_flag. This baseline is the primary deliverable that justifies the pilot. Without it, you cannot measure improvement. The audit also identifies which ticket categories are worth automating: focus on the top 2-3 categories that account for 60-70% of volume and have clear, rule-based routing logic.
Step 2: Build the LangGraph Agent with Intent Classification
Set up the LangGraph agent with 3-5 intent classes corresponding to your top ticket categories. Each node in the graph represents a discrete action: classify_intent, extract_entities, fetch_client_context, route_to_queue, draft_response. The classify_intent node calls the LLM with a system prompt that defines each intent class and few-shot examples from your historical tickets. The extract_entities node pulls out key fields: client name, ticket ID, issue type, urgency. The fetch_client_context node calls your CRM REST API to get the client’s contract type and SLA tier. The route_to_queue node uses conditional edges: if urgency == 'high' or contract_type == 'enterprise', route to the human queue; otherwise, route to the automated queue. The draft_response node generates a first response using the client context and ticket details. The entire graph should be under 500 lines of Python code.
Step 3: Integrate with Helpdesk via REST API and Webhooks
Integrate the agent with your helpdesk via custom REST API and webhooks. The helpdesk sends a webhook to your agent’s endpoint when a new ticket is created. The agent’s endpoint receives the ticket ID, fetches the full ticket details via the helpdesk REST API, runs the LangGraph agent, and returns the proposed classification, extracted entities, and draft response. The agent then calls the helpdesk REST API to update the ticket status to ‘awaiting_human_approval’ and creates a task in your human approval UI. The human reviews the task, clicks ‘Approve’, ‘Edit’, or ‘Escalate’. If approved, the agent calls the helpdesk REST API to assign the ticket to the correct queue and post the draft response. If escalated, the agent assigns the ticket to a senior agent and logs the escalation reason. All API calls should be logged with timestamps for audit.
Step 4: Implement Human-in-the-Loop Approval Workflow
The human approval UI is a simple web app with three actions: ‘Approve’, ‘Edit’, ‘Escalate’. The UI displays: (1) the proposed intent classification with confidence score, (2) the extracted entities (client name, ticket ID, issue type, urgency), (3) the client context fetched from the CRM (contract type, SLA tier, historical tickets), (4) the draft response. The human can edit any field before approving. Every action is logged: ticket_id, action, timestamp, user_id, edited_fields. This log is your audit trail for EU AI Act compliance. The UI should be accessible from the helpdesk: add a ‘View AI Suggestion’ button on the ticket detail page that opens the approval UI in a new tab. The approval workflow adds 15-30 seconds per ticket, but it ensures accountability and builds trust during the pilot. For the 4-week pilot, target a 90% approval rate (humans approve without editing) as a success metric.
Step 5: Measure Before/After Baseline and Ship the Report
Run the pilot for 2 weeks with the agent in shadow mode: the agent processes every ticket, but the human approval workflow is the only path to action. After 2 weeks, measure the same 200 tickets (or an equivalent sample) with the agent in place. Compare: (1) cycle time from ticket creation to first human response, (2) error rate (misrouted tickets or rework), (3) human effort saved (hours per day). The before/after report should show: cycle time reduction (target: 40-60%), error rate change (target: <5% misclassification), and human effort saved (target: 3.5 hours per day). This report is the primary deliverable that justifies rollout to additional ticket categories. If the pilot meets the targets, the next step is a 6-week rollout to the remaining ticket categories, with the same human-in-the-loop workflow and baseline measurement. If the pilot misses the targets, iterate on the intent classification prompt or the routing rules before proceeding.
Leave a Reply