Managing customer complaints in footwear retail is complex. Orders, warranties, product defects, and outlet-specific policies intersect, creating a challenging decision space. STRIDE Assistant is an AI-driven system that automates complaint handling while ensuring policy compliance, accountability, and human oversight.
This post walks you through why STRIDE Assistant exists, how it works, and how it combines AI with deterministic policy logic to deliver reliable, auditable decisions.
Why STRIDE Assistant Exists
A customer messages support: "My shoe tore 4 days after purchase." Without automation, staff must manually check order date, warranty, policies, and inventory. Multiply that by hundreds of tickets daily — it's slow and error-prone.
STRIDE Assistant solves this by combining:
- AI-driven semantic analysis to interpret customer complaints.
- Deterministic policy enforcement to validate actions based on rules, orders, and inventory.
- Human-in-the-loop escalation for ambiguous cases.
- Immutable audit logging for compliance and traceability.
This ensures fast, accurate, and accountable customer service.
Architecture Overview
Customer Message
|
Session Verification (Order + Phone + JWT)
|
Semantic Analysis (Intent Detection)
|
Clarification Step (if needed)
|
Policy Retrieval
|
Decision Engine (Policy + Order Data + Inventory)
|
+----------------------+
| FINAL DECISION / TICKET |
+----------------------+
|
OR Manual Review -> Ticket Created
Tools and Models Used
| Component | Tool / Model | Purpose |
|---|---|---|
| Semantic Analysis & RAG Retriever | Mistral-7B-Instruct |
Main LLM model for intent detection and generating human-readable responses. Chosen for high instruction-following capability and reasonable compute requirements. |
| Embeddings | SentenceTransformer("all-MiniLM-L6-v2") |
Converts policy chunks and messages into vectors for semantic search. Enables efficient and accurate retrieval of relevant policy segments. |
| API Layer | FastAPI | Provides endpoints for customers, staff, and admin with JWT authentication. |
| Database | PostgreSQL | Stores orders, tickets, staff actions, and audit logs. Supports transactions and versioning. |
| Logging | Python logging with structured configuration | Captures all AI decisions, system errors, and staff actions. |
Why these models:
-
Mistral-7B-Instructprovides strong instruction-following capability for generating safe, professional responses. -
all-MiniLM-L6-v2embedding model allows retrieval of relevant policy content efficiently, ensuring decisions respect company rules.
Dual-Logic Workflow
STRIDE Assistant combines two complementary logic layers:
- Policy Retriever: Interprets the customer complaint and maps it to relevant policy rules. Generates an initial suggested action.
-
Decision Engine: Validates the suggested action using order history, warranty periods, inventory, and past interactions. Produces an authoritative recommendation, which can approve, suggest repair, or reject a complaint if:
- Damage is intentional or product is too old.
- Customer repeatedly requests refunds/replacements outside policy limits even after suggesting a free repair.
- Policy rules are not met with an order.
The RAG pipeline orchestrates the process:
- Collects outputs from both logic layers.
- Requests clarification from customers if signals are ambiguous.
- Aggregates signals across multiple turns to generate the final ticket.
- Escalates to manual inspection when needed.
Code Snippet: Combining Logic Outputs
# Example: Combining outputs from policy retriever and decision engine
policy_signal = retriever.get_policy_signal(user_text, order)
decision_signal = engine.make_decision(user_text, order, inventory_available)
# Aggregate signals
signals = [policy_signal, decision_signal]
final_ticket = resolve_final_ticket(signals)
This aggregation ensures that policy compliance, historical data, and customer behavior are all considered before creating a ticket.
Authentication & Access Control
STRIDE Assistant uses JWT-based authentication across all layers:
| User Type | Credentials | JWT Purpose |
|---|---|---|
| Customer | order_id + phone |
Submit complaints, check status |
| Staff | user_id + password |
Handle tickets, log actions |
| Admin | user_id + password + role |
Review logs, manage tickets |
Benefits:
- Stateless and scalable across services
- Role-based enforcement for security and accountability
- Every action is logged and traceable
Staff & Admin Logging
- Staff endpoint: Handles ticket actions (approve, reject, escalate) securely. As well as allows staff to close a ticket or add a note for delay or any issue.
-
Immutable audit logs: All actions are stored in
staff_action_log; admins have read-only access.
log_staff_action(staff.id, ticket_id, action, remarks)
This ensures that all decisions, AI-generated or human-verified, are auditable.
Example Workflow
- Customer: "My shoe tore after 4 days of purchase." → policy retriever suggests
REPLACEMENT, decision engine validates it. - RAG asks for clarification if needed.
- Customer provides details: "The sole peeled off completely." → signals are aggregated.
-
resolve_final_ticket()determines the final ticket:RETURN,PAID REPAIRREPLACEMENT,REPAIR,INSPECTION, orREJECTif the complaint violates policy. - Inventory check ensures replacements are feasible; otherwise, escalates to inspection.
- Inspection tickets are generated if signals are too ambiguous and rag cant decide which policy to infer.
- The system makes sure to add a note for every ticket generated so that the staff know why the system generated a ticket without reviewing the chat data for the ticket.
- Staff action logs any manual interventions for auditability.
Production Considerations
- Thread-safe model access for concurrent requests.
- Database transactions for ticket creation and logging.
- JWT authentication for all users.
- Role-based access control for staff vs admin.
- Structured logs and metrics for monitoring.
Future Improvements
- Multi-model ensembles for higher signal accuracy
- Dashboard for analytics and staff performance
- Automated policy ingestion with versioning
- Predictive ticket prioritization
- GPU-backed inference endpoints for scalability
Conclusion
STRIDE Assistant shows how AI can assist human decision-making without replacing it, providing policy-compliant, auditable, and explainable complaint resolution. By combining semantic analysis, deterministic logic, and structured human oversight, STRIDE Assistant can approve, repair, reject, or escalate complaints safely, making it a reliable tool for footwear customer support.
Author: Shushant Rishav
Repository & contact: Github
Top comments (0)