01 · INGEST
Webhook receives ticket
n8n accepts JSON, validates required fields, extracts subject + body for downstream embedding.
02 · EMBED
Semantic search
Flask embedder (all-MiniLM-L6-v2, 384-dim) encodes the ticket. ChromaDB returns top-k matching SOPs.
03 · CLASSIFY
Primary LLM
Groq Llama 3.3 70B classifies across 8 dimensions: category, urgency, sentiment, routing team, confidence score, SOP citations, reasoning, and draft reply — returned as structured JSON.
04 · AUDIT
Confidence gate
If confidence < threshold, the Critic LLM diagnoses the failure reason and rewrites the retrieval query.
05 · RECOVER
Agentic re-retrieval
ChromaDB re-retrieves using the refined query. Primary LLM reclassifies. Path logged as agentic recovery.
06 · CONVERGE
Audit + route
All 6 paths converge into a single Supabase audit log. Conditional Slack alert fires for human review.