Autonomous, AI-driven Returns and RMA SaaS platform with real-time fraud detection and intelligent claim processing.
ClaimNova transforms the massive headache of e-commerce returns into a seamless, fully automated, zero-touch process. Built with Amazon Nova's High-Thinking models for multimodal reasoning and orchestrated by Airia's Active Agents, wrapped in a premium glassmorphic UI.
- π€ Autonomous AI Agent: A conversational interface that handles the entire return process via chat, reducing manual support tickets and overhead.
- π‘οΈ Intelligent Fraud Detection: Utilizes Amazon Nova's phenomenal multimodal understanding to cross-reference conversational text with user-uploaded images of defects, assigning a highly accurate fraud probability score before processing refunds.
- β‘ Multi-Agent Orchestration: Deployed as an Active Agent using Airia, seamlessly executing SQL database queries and managing decision-making workflows between the frontend and backend.
- π Real-Time Admin Dashboard: Live, synchronized interface for administrators to monitor incoming orders, claims, and AI resolutions using Supabase Realtime, enforcing a Human-In-The-Loop (HITL) capability.
- π Smart Slack Automation: Configurable real-time webhook alerts pushed directly to Slack when high fraud is detected or high-value claims require human review.
- π¨ Premium UI/UX: A stunning, modern, glassmorphic white theme built with TailwindCSS, shadcn/ui, and Framer Motion animations.
graph TD
A[Customer initiates chat] -->|Types issue or records voice| B(Airia Active Agent Orchestrator)
B -->|Requests evidence| C{User provides evidence}
C -->|Uploads Image/Receipt| D[Amazon Nova: Multimodal Analysis]
C -->|Text Description| E[Amazon Nova: High-Thinking Reasoning]
D --> F[AI Fraud Engine]
E --> F
F -->|Calculates Confidence Score| G{Decision Matrix}
G -->|Low Fraud & Valid| H[β
Approve Refund]
G -->|Medium Fraud| I[β οΈ Flag for Human-in-the-Loop]
G -->|High Fraud / Invalid| J[β Reject Claim]
H --> K[(Supabase Database)]
I --> K
J --> K
K -->|Realtime Subscription| L[Admin Dashboard]
K -->|Webhook Trigger| M[Slack Notification]
The system operates through a multi-stage AI pipeline:
-
Customer Chat β The customer interacts with Nova, the AI assistant, via a chat interface. They describe their issue in text or use voice input (transcribed via Groq Whisper).
-
Order Lookup β When the customer provides an Order ID (format:
ORD-XXXX-XXX), the system fetches order details from Supabase and injects them into the AI context for fraud cross-referencing. -
Evidence Collection β The AI requests photographic evidence for physical damage claims. Uploaded images are converted to base64 and attached to the Airia pipeline payload.
-
AI Analysis β The request is sent to the Airia Pipeline which routes to Amazon Nova's multimodal models. Nova analyzes text + images together for:
- Product verification (does the photo match the ordered item?)
- Damage assessment
- Fraud probability scoring (Low / Medium / High)
- Confidence scoring (0β100)
-
Fallback β If Airia is unavailable, the system falls back to Groq (Llama 3.3 70B) for text-only reasoning.
-
Decision & Persistence β The AI emits a structured JSON verdict. The backend creates/updates a claim record in Supabase with the verdict, fraud score, and resolution.
-
Real-Time Dashboard β Admins see claims appear instantly via Supabase Realtime subscriptions. They can override AI decisions (Human-In-The-Loop).
-
Slack Alerts β High-fraud or high-value claims trigger configurable Slack webhook notifications.
| Layer | Technology | Purpose |
|---|---|---|
| Framework | Next.js 16 (App Router) | Server-side rendering, API routes, React Server Components |
| Language | TypeScript | Type-safe development |
| UI Library | React 19 | Component-based UI |
| Styling | TailwindCSS v4, shadcn/ui | Utility-first CSS, pre-built accessible components |
| Animations | Framer Motion | Smooth page transitions, micro-animations |
| State | Zustand | Lightweight client-side state management |
| Database | Supabase (PostgreSQL) | Structured data, Realtime subscriptions, REST API |
| AI Engine | Amazon Nova (via Airia) | Multimodal reasoning, image analysis, fraud detection |
| AI Fallback | Groq (Llama 3.3 70B) | Text-only LLM fallback |
| Voice | Groq Whisper | Audio transcription for voice messages |
| Notifications | Slack Webhooks | Real-time fraud/refund alerts |
| Font | Poppins (Google Fonts) | Clean, modern typography |
ClaimNova/
βββ src/
β βββ app/
β β βββ api/
β β β βββ chat/route.ts # AI chat endpoint (Airia + Groq fallback)
β β β βββ notify/route.ts # Slack webhook notification endpoint
β β βββ page.tsx # Main split-screen view (Chat + Admin)
β β βββ layout.tsx # Root layout with Poppins font
β β βββ globals.css # Global styles, design tokens, animations
β βββ components/
β β βββ chat/
β β β βββ ChatPanel.tsx # Chat container with header
β β β βββ ChatInput.tsx # Message input with file/voice attachments
β β β βββ MessageBubble.tsx # Chat message rendering
β β β βββ FileUpload.tsx # Drag-and-drop file attachment
β β β βββ VoiceRecorder.tsx # Voice recording with Whisper transcription
β β βββ admin/
β β β βββ AdminDashboard.tsx # Live admin panel with claims/orders tables
β β β βββ AddOrderModal.tsx # Create new orders
β β β βββ AddClaimModal.tsx # Manually file claims
β β β βββ NotificationSettings.tsx # Configure Slack webhook
β β βββ ui/ # shadcn/ui primitives
β βββ lib/
β βββ supabase.ts # Supabase client, TypeScript interfaces
β βββ chat-store.ts # Zustand store with localStorage persistence
β βββ utils.ts # Utility functions (cn helper)
βββ supabase/
β βββ database_schema.md # SQL DDL for orders & claims tables
βββ public/ # Static assets
βββ Dockerfile # Multi-stage production build
βββ docker-compose.yml # Container orchestration wrapper
βββ .dockerignore # Docker context exclusions
βββ next.config.ts # Next.js configuration (standalone output)
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ .env.local # Environment variables (not committed)
- Node.js β₯ 18 (recommended: 20 LTS)
- npm β₯ 9
- A Supabase project (create one free)
- An Airia account with an active pipeline (airia.ai)
- (Optional) A Groq API key for voice transcription and LLM fallback
- (Optional) A Slack Incoming Webhook URL for alerts
git clone https://github.com/trueashik/ClaimNova.git
cd ClaimNovanpm installCreate a .env.local file in the project root:
# ββ Supabase (Required) ββ
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
# ββ AI Orchestrator (Required for AI features) ββ
ORCHESTRATOR_WEBHOOK_URL=https://api.airia.ai/v2/PipelineExecution/your-pipeline-id
AIRIA_API_KEY=your-airia-api-key
# ββ Groq (Optional β voice transcription + LLM fallback) ββ
GROQ_API_KEY=your-groq-api-keyTip: Get your Supabase URL and anon key from your project's Settings β API page.
Run the SQL from supabase/database_schema.md in your Supabase SQL Editor to create the required orders and claims tables with their custom enum types.
Quick reference β table summary
| Table | Purpose | Key Fields |
|---|---|---|
orders |
Customer orders catalog | order_id (PK), product_name, order_amount, delivery_status, return_window_days |
claims |
Filed return/refund claims | claim_id (PK), order_id (FK), ai_status, ai_fraud_probability, ai_confidence_score, resolution, approved_refund_amount |
npm run devOpen http://localhost:3000 β you'll see the split-screen interface with the Customer Chat on the left and the Admin Dashboard on the right.
ClaimNova includes Docker support for containerized production deployments.
# Make sure .env.local exists with your keys (see step 3 above)
docker compose up --buildThe app will be available at http://localhost:3000.
To run in the background:
docker compose up --build -dTo stop:
docker compose down# Build the image
docker build -t claimnova .
# Run the container
docker run -p 3000:3000 --env-file .env.local claimnovaThe Dockerfile uses a multi-stage build optimized for production:
| Stage | Base Image | Purpose |
|---|---|---|
deps |
node:20-alpine |
Install production dependencies with npm ci |
builder |
node:20-alpine |
Build the Next.js standalone bundle |
runner |
node:20-alpine |
Minimal production image (~150 MB) with non-root user |
| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
β | Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
β | Supabase anonymous/public API key |
ORCHESTRATOR_WEBHOOK_URL |
β * | Airia pipeline execution endpoint |
AIRIA_API_KEY |
β * | Airia API key for authentication |
GROQ_API_KEY |
β | Groq API key for Whisper transcription and Llama fallback |
* Without Airia keys, the AI chat will fall back to Groq if configured, or return a service-unavailable message.
ClaimNova uses Supabase (PostgreSQL) with two core tables and Realtime subscriptions enabled for live dashboard updates.
Full SQL definitions: supabase/database_schema.md
erDiagram
ORDERS ||--o{ CLAIMS : "has"
ORDERS {
varchar order_id PK
varchar customer_name
varchar customer_email
varchar product_name
text product_description
varchar product_category
varchar vendor_name
timestamptz order_date
timestamptz delivery_date
varchar delivery_status
numeric order_amount
int return_window_days
timestamptz created_at
}
CLAIMS {
varchar claim_id PK
varchar order_id FK
text customer_issue
varchar issue_category
jsonb multimodal_evidence
enum ai_status
enum ai_fraud_probability
numeric ai_confidence_score
text ai_assessment_notes
enum authority_status
varchar authority_reviewer_id
text authority_notes
enum resolution
numeric approved_refund_amount
timestamptz filed_at
timestamptz resolved_at
timestamptz updated_at
}
The core AI chat endpoint. Accepts multipart/form-data with:
| Field | Type | Description |
|---|---|---|
message |
string | User's text message |
order_id |
string | Active order ID for context |
customer_issue |
string | Description of the issue |
claim_id |
string | Active claim ID |
history |
JSON string | Previous conversation messages |
order_details |
JSON string | Cached order details from session |
accumulated_evidence |
JSON string | Previously uploaded evidence (base64 data URIs) |
file_* |
File | Uploaded images, audio, or PDFs |
Returns a structured JSON response with reply, verification_status, fraud_probability, confidence_score, assessment_notes, resolution, and refund_amount.
Sends Slack webhook notifications. Accepts JSON:
{
"type": "fraud" | "refund" | "verification",
"orderId": "ORD-XXXX-XXX",
"claimId": "CLM-XXXXXXXX",
"details": "Formatted message string",
"slackWebhookUrl": "https://hooks.slack.com/services/..."
}- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add your feature' - Push to your branch:
git push origin feature/your-feature - Open a Pull Request
This project is private. All rights reserved.
Built with β€οΈ by Ashik Ahmed
Powered by Amazon Nova β’ Airia β’ Supabase