Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Support Triage Agent

RAG-based support triage agent for HackerRank Orchestrate (May 2026).

Architecture

support_tickets.csv
      │
      ▼
 Domain Router (inferred from company field or ticket content)
      │
      ▼
 Retriever (ChromaDB + sentence-transformers)
   → searches 774 local markdown docs
   → returns top-3 most relevant excerpts
      │
      ▼
 TriageAgent (Claude claude-sonnet-4-6 via Anthropic API)
   → hard-coded escalation rules (fraud, legal, account suspension, etc.)
   → LLM classification + response grounded in retrieved corpus
   → structured JSON output (status, product_area, response, justification, request_type)
      │
      ▼
 output.csv

Install

pip3 install chromadb sentence-transformers anthropic pandas python-dotenv

Setup

cp ../.env.example ../.env
# Edit .env and add your ANTHROPIC_API_KEY

Run

# Process support_tickets.csv → output.csv
python3 main.py

# Or with explicit paths
python3 main.py --tickets ../support_tickets/support_tickets.csv \
                --output  ../support_tickets/output.csv \
                --data    ../data \
                --db      ../.chromadb

# Run on sample file (for development/testing)
python3 main.py --sample

The first run builds the ChromaDB vector index (~30 seconds). Subsequent runs reuse the cached index.

Design decisions

  • RAG over full-context stuffing: 774 docs would exceed practical context limits and add noise. Retrieving the top-3 most relevant docs keeps each API call focused and cheap.
  • Hard escalation rules before LLM: Fraud, legal, and account-suspension keywords always escalate, regardless of LLM output. This prevents the model from trying to answer sensitive cases it shouldn't.
  • Temperature=0: Deterministic output for reproducibility.
  • ChromaDB + all-MiniLM-L6-v2: Lightweight, runs locally, no external API needed for embeddings.
  • Corpus-only grounding: The system prompt explicitly forbids using parametric knowledge; the LLM must cite only the retrieved excerpts.