A production-ready reference implementation for enterprise customer support ticket classification, automated intent routing, PII data sanitization, and human-in-the-loop escalation built on the LangGraph state graph architecture.
Incoming Customer Query
(REST / Webhook / Chatbot)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββ
β Security & Guardrails Layer β
β β’ Prompt Injection Heuristics β
β β’ PII Masking (CC, SSN, Phone, Mail)β
βββββββββββββββββββββ¬ββββββββββββββββββββ
β Sanitized State
βΌ
βββββββββββββββββββββββββββββββββββββββββ
β Supervisor Router Node β
β β’ Intent Classification β
β β’ Sentiment Analysis (Frustration) β
β β’ Dynamic Priority Assignment β
βββββββββ¬ββββββββββββΌββββββββββββ¬ββββββββ
β β β
βββββββββββββββββββββ β βββββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββββββββββββ βββββββββββββββββββββββββ βββββββββββββββββββββββββ
β Technical Specialist β β Billing Specialist β β Human Escalation β
β β’ API / SDK Errors β β β’ Tax Invoices (VAT) β β β’ Priority Ticket ID β
β β’ Latency & Timeouts β β β’ Refund Policies β β β’ CRM Handoff (Lead) β
β β’ Webhook Validation β β β’ Plan Upgrades β β β’ SLA < 30 min Alert β
βββββββββββββ¬ββββββββββββ βββββββββββββ¬ββββββββββββ βββββββββββββ¬ββββββββββββ
β β β
βββββββββββββββββββββββββ¬ββββββββ΄ββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββ
β Final State Resolutionβ
β β’ Audit Trail β
β β’ Response Payload β
βββββββββββββββββββββββββ
- Multi-Agent State Graph: Deterministic and LLM-driven graph routing with state persistence across conversational turns.
- Enterprise PII Guardrails: Pre-execution sanitization redacting credit cards, social security numbers, phone numbers, and emails to prevent unauthorized sensitive data leakage into downstream LLM inference logs.
- Prompt Injection Defense: Pre-flight heuristic detection catching adversarial overrides (
ignore previous instructions,jailbreak,developer mode). - Sentiment & Priority Analysis: Automatically escalates angry, urgent, or litigious inquiries to human supervisors with dedicated priority SLAs.
- FastAPI Webhook & REST Server: Out-of-the-box endpoints for
/api/v1/chatand/api/v1/tickets/route(integrates directly with Zendesk, Freshdesk, and HubSpot webhooks). - Interactive CLI Console: Test support queries and live agent triage from the terminal.
- 100% Type-Safe & Tested: Pydantic V2 models, strict typing, and comprehensive unit test coverage.
# Clone repository
git clone https://github.com/adaptnxt/langgraph-multiagent-support-starter.git
cd langgraph-multiagent-support-starter
# Install with core dependencies
pip install -e .
# Or install with optional LangChain/LangGraph LLM providers
pip install -e ".[llm,dev]"adaptnxt-support route "Where can I download the VAT tax invoice for last month?"Output:
[Agent Network Route Summary]
Assigned Agent: billing
Priority: medium
Sentiment: neutral
Response:
You can view and download all past VAT/GST compliant PDF tax invoices directly from your Account Portal under Settings > Billing & Invoices.
adaptnxt-support route "I am furious! My card 4532 1122 3344 5566 was charged twice! I demand to speak to a manager right now!"Output:
[Agent Network Route Summary]
Assigned Agent: human_escalation
Priority: critical
Sentiment: angry
Redacted PII: credit_card
Escalation ID: TICKET-ESC-9F81E3B2
Response:
Your request has been prioritized and escalated directly to an AdaptNXT Tier-3 Support Lead. Escalation Ticket ID: TICKET-ESC-9F81E3B2 (Priority: CRITICAL). A dedicated team member will contact you within 30 minutes.
adaptnxt-support interactiveLaunch the REST server locally:
adaptnxt-support serve --host 0.0.0.0 --port 8000Interactive Swagger API documentation will be available at:
π http://localhost:8000/docs
curl -X POST "http://localhost:8000/api/v1/chat" \
-H "Content-Type: application/json" \
-d '{"query": "Why am I getting HTTP 401 code on the webhook endpoint?", "session_id": "sess_102"}'docker build -t adaptnxt/support-agents .
docker run -p 8000:8000 adaptnxt/support-agentsdocker compose up -dRun the automated test suite:
pytest tests/ -vMaintained by the Enterprise AI & Cloud Chatbot engineering team at AdaptNXT Technology Solutions.
For custom fine-tuned multi-agent architectures (CrewAI, AutoGen, LangGraph) integrated with internal enterprise databases (PostgreSQL, SAP, Salesforce, Pinecone), visit our specialized service practices:
- Cloud AI Chatbot Integration Services
- Open Source LLM Chatbot Development
- Enterprise RAG Chatbot Development
This project is licensed under the Apache-2.0 License.