Inspiration

Retail store operators, portfolio managers, accountants, and category planners often face operational friction when attempting to convert raw, disparate transactional spreadsheets into strategic business decisions. Standard Business Intelligence (BI) dashboards are predominantly descriptive—they display historical charts without evaluating trade-offs between conflicting business criteria (such as preserving profit margins versus liquidating overstocked inventory). Conversely, naive Large Language Model (LLM) decision solutions frequently suffer from numerical hallucinations, lack reproducible arithmetic, and exhibit logical intransitivity when ranking strategic alternatives.

We built KLAROS to bridge this gap through a modular, mathematically grounded hybrid architecture. It offloads mathematical verification and data processing to deterministic TypeScript algorithms while leveraging LLMs for qualitative structuring and context extraction.

What it does

  • Universal Multi-Domain Classification: Automatically categorizes ingested spreadsheets into six distinct business domains (Retail Transactions, Inventory & Stock, Financial Ledger, Market & Securities, Subscription / SaaS, or Generic Tabular) and provides domain-tailored KPI cards and analytics modules.
  • Scale-Tested Processing (1M+ Rows): Ingests and aggregates multi-table datasets of over 1,000,000+ rows off the main UI thread via Web Workers without row truncation or UI thread locking.
  • Dual MCDA Verification: Runs independent Analytic Hierarchy Process (AHP) (Geometric Mean priorities with Saaty consistency ratio $CR < 0.10$) and TOPSIS (Euclidean separation distances) calculations side-by-side, benchmarking inter-method concordance using Spearman’s $\rho$ and Kendall’s $\tau$.
  • Resilient Multi-LLM Orchestration: Evaluates qualitative criteria using a fallback chain (Groq $\rightarrow$ OpenRouter $\rightarrow$ Google Gemini) with deterministic offline fallbacks when unauthenticated or offline.
  • Transparent Cost & Margin Estimation: Handles real-world datasets lacking cost columns using empirical retail benchmarks (65% COGS) while clearly displaying audit disclosure badges to prevent false 100% margin spikes.

How we built it

  • Frontend & Design: React 18, Vite, TypeScript, Tailwind CSS, shadcn/ui (Radix UI), and Recharts.
  • Performance Architecture: Off-thread processing using browser Web Workers (market-metrics.worker.ts), multi-layer state caching, and Schwartzian transforms for $O(n)$ chronological sorting.
  • Backend & Auth: Supabase PostgreSQL with Row-Level Security (RLS) policies, Clerk identity management using zero-dependency RS256 Web Crypto JWT verification, and Vercel Serverless proxy functions with Upstash Redis edge caching.

Challenges we ran into

  • Mathematical Integrity: Preventing LLMs from performing direct matrix algebra or arithmetic. We strictly constrained LLMs to qualitative framing and pairwise comparisons while delegating all matrix calculations, eigenvalues, and distance separations to deterministic TypeScript math engines.
  • Real-World Data Anomaly Handling: Processing dirty datasets required automatically suppressing non-merchandise fees (such as AMAZONFEE, POST, D, M) to prevent transaction fees from displacing actual products in top rankings.
  • Date Drift Elimination: Normalizing dates across ISO-8601, Excel serial integers, and epoch timestamps while anchoring time-series forecasts strictly to historical temporal boundaries rather than the user's wall-clock system time.

Accomplishments that we're proud of

  • Tested and verified against the 1,067,371-row online_retail_II.xlsx benchmark dataset while maintaining a smooth 60 FPS user interface.
  • Built a zero-dependency RS256 JWT signature verification pipeline natively in Vercel Serverless Edge functions using Web Crypto APIs to minimize cold starts.
  • Achieved 52 passing unit and integration tests covering mathematical verification, domain classification, document extraction, and MCDA engines.

What's next for KLAROS

  • Expanded Matrix Topologies: Expanding beyond 3x3 decision matrices to support custom $N \times M$ options and criteria configurations.
  • Dedicated Time-Series Forecasting: Integrating specialized time-series forecasting models (e.g., TimeGPT, NeuralProphet) alongside LLM in-context projections.
  • Live Store Integrations: Building native webhooks for direct integration with Shopify, WooCommerce, and Square APIs.

Built With

Share this project:

Updates

Submission history