STRIDE_Assistant

STRIDE – Intelligent Complaint Resolution System


Problem Statement

Footwear companies often face high volumes of customer complaints related to returns, repairs, replacements, or refunds. Managing these requests manually is time-consuming, error-prone, and inconsistent across outlets. STRIDE requires a policy-aware, automated complaint handling system that can enforce warranty rules, detect eligibility, and assist staff in decision-making while maintaining complete auditability.


Project Overview

This project implements a Retrieval-Augmented Generation (RAG) pipeline for STRIDE’s complaint management, combining:

The system ensures strict adherence to company policy, automates repetitive checks, and provides staff with clear next steps.


Key Features

1. RAG Pipeline

2. Policy Management

3. Complaint Categories

4. Staff & Admin APIs

5. Logging & Observability

6. LLM Response Generation


Architecture

                 +-------------------+
                 | Customer Message  |
                 +---------+---------+
                           |
                           v
                  +-------------------+
                  | Semantic Analyzer | <--- INTENT Detection
                  +---------+---------+
                           |
                           v
                 +--------------------+
                 | Policy Retriever   | <--- Fetch relevant policy chunk
                 +---------+----------+
                           |
                           v
                 +--------------------+
                 | Decision Engine    | <--- Enforce policy rules
                 +---------+----------+
                           |
               +-----------+-----------+
               |                       |
               v                       v
      +----------------+       +------------------+
      | APPROVED / REJECT |     | MANUAL REVIEW   |
      +--------+---------+     +--------+---------+
               |                        |
               v                        v
         Staff Notification         Ticket Created
               |                        |
               +-----------+------------+
                           v
                   Customer Response

Project Structure

./
├── api/               # FastAPI routers (chat, staff, admin)
├── db/                # PostgreSQL interactions, staff audit, tickets
├── ingest/            # Policy ingestion scripts
├── Logs/              # General and error logs
├── main.py            # FastAPI entry point
├── Models/            # LLM models
├── policies/          # Policy documents
├── rag/               # RAG pipeline components
├── Scripts/           # Model initialization, utilities
├── Services/          # Prompt builder, embedder, pipeline, logger config
└── Web/               # Placeholder for frontend if needed

Database Setup

  1. PostgreSQL required.
  2. Run schema creation scripts in db/.
  3. Create .env with:
# --- Environment Variables for Model Configuration ---
MODEL_PATH=PATH_TO_LLM_MODEL.gguf

# --- MODEL Setup ---
CONTEXT_SIZE=CONTEXT_SIZE
BATCH_SIZE=BATCH_SIZE
UPDATE_BATCH_SIZE=UPDATE_BATCH_SIZE
VERBOSE=TRUE/FALSE

# --- Connection Parameters ---
DB_NAME=<DB_NAME>
DB_USER=<DB_USER>
DB_PASSWORD=<DB_PASSWORD>
DB_HOST=<DB_HOST>
DB_PORT=<DB_PORT>

# ----------------JWT KEY----------------------------
JWT_SECRET_KEY=YOUR_JWT_SECRET_KEY
  1. Tables:

    • sales_schema.tickets
    • staff_schema.staff
    • staff_schema.staff_action_log
    • Inventory, orders, and sales tables

Recommendation: Use Alembic for production migrations.


Quick Start

# Clone repository
git clone <repo_url>
cd stride_complaint_system

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows

# Install dependencies
pip install -r requirements.txt

# Place LLM model
Models/LLM_MODEL.gguf

# Run FastAPI
uvicorn main:app --reload

# Health check
curl http://localhost:8000/

Logging


Error Handling & Observability


Production Readiness Considerations


Deployment

Docker

The application can be containerized using Docker for consistent local development and deployment environments.

Prerequisites

Build Image

docker build -t stride-complaint-system .

Run Container

docker run -d \
  --name stride-api \
  -p 8000:8000 \
  --env-file .env \
  -v $(pwd)/Models:/app/Models \
  stride-complaint-system

Notes:

Example Dockerfile (Reference)

FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Areas for Future Improvement

  1. Multi-Model Ensemble for Better Decision-Making

    • Integrate multiple LLMs for intent detection, policy retrieval, and response generation.
  2. Enhanced Analytics & Insights

    • Dashboards for complaint trends, staff performance, and product quality.
  3. Automated Policy Updates

    • Versioned ingestion pipeline to automatically reflect updated company policies.
  4. Proactive Complaint Prevention

    • ML models predicting potential issues and reducing complaint volume.
  5. Scalable Model Hosting

    • GPU-backed inference or cloud endpoints to support high traffic.
  6. Intelligent Ticket Prioritization

    • Prioritize tickets based on urgency, complaint type, and customer history.

Contribution Guidelines


Contributions & Support

Contributions, issues, and feature requests are welcome. Feel free to open an issue or submit a pull request.


Contact