Operations · OrderTrace · StockSleuth

RackPilot is an AI-powered operations and business intelligence platform for clothing businesses.

For small clothing wholesalers, independent apparel brands and clothing retailers. It combines inventory management, order processing, physical stock tracking, fulfilment workflows, sales analytics and intelligent purchasing recommendations in one system. Two investigation modules sit on the same records: OrderTrace reconciles orders, invoices, payments and dispatches, and StockSleuth reconstructs stock movements to explain why recorded stock and the shelf disagree.

The aim is to move a clothing business from managing orders, spreadsheets, stockrooms and purchasing by hand to one system that understands its operations and helps it decide better.

  1. 1
    Orders arrive

    Messages, voice transcripts, manual entry or an uploaded order sheet

  2. 2
    Inventory and fulfilment

    Check stock, reserve items, locate garments, prepare pick lists

  3. 3
    Business intelligence

    Sales, stockouts, slow-moving products and demand

  4. 4
    Smarter purchasing

    What to reorder, in what quantity, and why

Demo sign-in, no password. Synthetic wholesaler in Gandhi Nagar, Delhi: 18 products, 220 size and colour variants, 150 days of trading.

The complete product

One interface, one history of business events, three responsibilities.

The modules are not three applications. They read the same orders, stock movements, shipments and audit records from different angles.
Operate

RackPilot core

Products, variants, inventory, orders, reservations, locations, picking, dispatch, sales analytics and purchasing recommendations.

Open RackPilot core
Investigate

OrderTrace

Connects each order with its stock allocation, invoices, payments and dispatch records, and traces exactly where they stop agreeing.

Open OrderTrace
Investigate

StockSleuth

Investigates missing stock, unexplained changes, wrong reservations and misplaced goods by replaying the stock ledger.

Open StockSleuth

Operate: manage the business's orders and inventory.

Investigate: find discrepancies and reconstruct the events that caused them.

Optimise: use the resulting sales and stock data to decide what to buy.

1 · The problem

Each record looks reasonable on its own. Together they disagree.

  • Orders arrive in informal messages, not an order system.
  • Products have many variants: size, colour, design, SKU, sometimes batch.
  • Staff know a garment is somewhere in the stockroom, not where.
  • Physical stock and recorded stock drift apart.
  • Several orders compete for the last units.
  • Owners can't easily see which sizes and designs sell and which sit.
  • Purchasing runs on intuition rather than sales, commitments and lead times.
  • Invoices, payments and dispatch notes live in separate tools and don't get cross-checked.

These are the problems RackPilot is built to address. How often and how badly each target customer has them still needs checking with real clothing-business owners.

2 · Who it's for

Start narrow: a wholesaler or a small brand with enough orders for this to hurt.

Primary

Small clothing wholesalers

Many variants, repeat retailer orders, physical stock, frequent picking and packing. The main demo business, Saffron Thread Apparel, is one.

Secondary

Independent apparel brands

Own designs, variants to manage, sell-through to watch, replenishment to decide. The second demo tenant, Indigo Lane, is one.

Also

Clothing retailers

Accurate stock, fast product location, reliable fulfilment and better buying.

4 · The end-to-end workflow

Every feature shares the same records, so each step improves the next.

Better order records improve inventory visibility, better visibility improves fulfilment, and better sales records improve purchasing.
  1. Step 1
    Stock is added

    Variants registered, quantities and rack locations recorded.

  2. Step 2
    An order arrives

    Products, sizes, colours, quantities and deadline extracted.

  3. Step 3
    Inventory is checked

    Variants matched, availability validated, shortages named.

  4. Step 4
    Stock is reserved

    The same units can't be allocated twice.

  5. Step 5
    Picked and dispatched

    Location-aware pick list; fulfilment recorded.

  6. Step 6
    Performance updates

    Sales and movements feed analytics.

  7. Step 7
    Purchasing is recommended

    Shortages found; quantities proposed from data.

3 · Features

Nine capabilities, A to I, all working in the demo.

A

AI-powered order intake

Messages, voice-note transcripts and photos or PDFs of order sheets become structured lines. Ambiguous or unknown items ask you to choose; it never invents a SKU. A confirmation screen comes before anything is reserved.

Try it
B

Inventory and SKU management

Products, designs, brands, size and colour variants, cost and price, on-hand, reserved and available, supplier and history. Damaged and quarantined stock is excluded from sellable.

Try it
C

Physical rack and location tracking

Warehouse A → Rack R-12 → Shelf 3 → Bin 12. Search or scan to find a garment, pick by location, move stock between racks, record counts, and flag bins that need verifying.

Try it
D

Order fulfilment and reservations

Validate, reserve, pick by location, dispatch, invoice. Database constraints stop two orders taking the same units. Shortfalls are explained, and the owner chooses: backorder or ship what's there.

Try it
E

Stock alerts and exceptions

Running low, can't be fulfilled, orders competing for stock, bins to verify, deadlines at risk, count discrepancies, unsold stock. Each from an explicit rule that says what triggered it.

Try it
F

Sales and inventory analytics

Best sellers, fastest sizes and colours, trends, cover, stockout days, ageing, value at cost and margin. Gaps in the sales records are flagged, not read as dead stock.

Try it
G

Demand forecasting and replenishment

Demand from what customers ordered, so stockouts don't hide it. The forecast is backtested against history and its error is shown.

Try it
H

Budget-aware purchasing

“I've got ₹30,000.” A hard budget, supplier packs and minimums, customers waiting first, best margin per rupee next. Evidence, risks, assumptions and what not to reorder, all before the owner approves.

Try it
I

Natural-language business assistant

Ask in ordinary words. Each question maps to a fixed query template; the database does the arithmetic; the answer says how it was computed.

Try it
OrderTrace and StockSleuth

An investigation, not another dashboard alert.

A difference is not proof of an error, and a variance is not proof of theft. The rules establish what was expected, what each record says, which records support the finding and what still needs a person to verify.

The missing two shirts

ORD-1042: 20 blue oxford shirts ordered, 20 allocated, 20 picked, SHP-501 ships 20, INV-2058 bills 18, the customer pays for 18 and the order is marked completed.

Ordered
20
Allocated
20
Invoiced
18
Dispatched
20

OrderTrace checks for another invoice, a credit note, a return and a backorder, finds none, and opens OT-001. StockSleuth confirms the 20 left the warehouse. Three hypotheses stay labelled as unverified.

Open OT-001

Six tees have gone missing

BLK-TSH-M at Warehouse A → Rack R-12 → Shelf 3 → Bin 12: recorded 50, counted 44.

  1. 09:00Stock received · 50 on record
  2. 10:154 picked for ORD-1043 · booked here until dispatch
  3. 11:30TRF-0087: 2 sent to the showroom rail · never scanned in
  4. 12:40ORD-1043 cancelled · the picked reservation isn't released
  5. 14:00Physical count · 44 on the shelf

StockSleuth opens SS-004: open records could explain 6 of the 6 units, likely in the packing area and on the rail. The recommended next step is to recount before approving any adjustment.

Open SS-004

OrderTrace rules

  • OT-INV Order vs invoice — Dispatched quantities not billed, billing ahead of dispatch, or invoice lines the order doesn't have
  • OT-SHP Order vs dispatch — More shipped than the order allows after cancellations
  • OT-PAY Invoice vs payment — Overpayments, balances more than 30 days past due, and payments not allocated to an invoice
  • OT-ALLOC Allocation vs dispatch — Picked or reserved units left behind once an order is dispatched or closed
  • OT-DUP Duplicate records — Payments, invoices or shipments that look recorded twice
  • OT-MATCH Customer / product mismatch — A linked shipment, invoice or payment naming a different customer or variant than the order
  • OT-STATUS Unexplained status — An order marked complete while fulfilment, billing or payment is outstanding

StockSleuth rules

  • SS-COUNT Physical vs recorded stock — A count that differs from the recorded on-hand quantity at that time
  • SS-TRF Transfer imbalance — Stock sent from one location and not received at the other
  • SS-DUP Duplicate movement — The same receipt, transfer or adjustment posted twice
  • SS-NEG Negative inventory — Movements that, replayed in time order, take a balance below zero
  • SS-STALE Stale reservations — Stock still held for orders that are cancelled or already closed
  • SS-PICK Pick vs dispatch — Units marked picked that were neither dispatched nor put back
  • SS-RET Return reconciliation — Resellable returns received but not restocked
  • SS-ADJ Adjustment anomalies — Repeated or large manual adjustments with no count behind them
  • SS-LOC Location mismatch — Stock counted at a location where none is recorded
  • SS-LEDGER Ledger inconsistency — A stored balance that no longer equals its movement history or its reservations

The shared investigation engine

Fact

The invoice lists 18 units and the dispatch record lists 20.

Inference

The transaction may have an invoicing discrepancy.

Unverified hypothesis

The invoice may be missing a line item.

Resolution

An authorised employee confirms the quantity and records the correction.

Lifecycle: detected → investigating → action required → resolved → closed. Outcomes include record corrected, goods located, adjustment approved, counting error, false positive, legitimate partial fulfilment and awaiting external confirmation. Each finding stores its rule and version, the expected and actual values, the calculation, the exceptions checked and its source records. Corrections are new, audited records, and a resolved finding never reopens the case.

5 · What the AI actually does

An AI-enabled business system, not an LLM that controls everything.

The database and deterministic rules own stock, order state and money. Claude reads messy input and explains results it is handed; anything it writes is checked against the records first. Without an API key, every feature still works on rules.
TaskMechanismIn RackPilot
Extract order details from messagesLLM with structured outputRules by default; Claude reads text, photos and PDFs into a fixed schema (optional)
Match a description to a productDatabase search, AI-assisted if neededCatalogue matcher scores product words; Claude may suggest a product code, the matcher still decides
Calculate stock availabilityDatabase queries and business rulesAvailable = sellable on-hand − active reservations
Reserve inventory safelyTransactional backend logicRow locks, one transaction per order, CHECK (reserved ≤ on_hand)
Find a garment's recorded locationInventory databaseBalances per variant and bin; search by SKU, barcode or description
Calculate sales and gross marginSQL and validated financial calculationsDispatch records × order price − unit cost; cross-checked two ways on the Measurements page
Forecast demandStatistical models, evaluated on history28-day ordered rate, backtested weekly against a naive baseline
Explain a business resultLLM grounded in retrieved resultsClaude rewords computed answers; any number or code not in the results is rejected
Answer questions about supplier policiesRAG over documentsPostgres full-text search over supplier terms and house policies
Produce a purchasing proposalRules plus validated business dataPriority funding within a hard budget, packs and minimum orders
Decide whether records reconcileDeterministic rules, never an LLM17 OrderTrace and StockSleuth rules with versions and exceptions
6 · Architecture

Next.js, a Node backend API, PostgreSQL, and one schema for all three modules.

  1. Next.js frontend
    Dashboard, orders, inventory, pick lists, OrderTrace, StockSleuth, Investigation Centre, analytics, purchasing, assistant.
  2. Backend API (Next.js route handlers, TypeScript)
    Session, tenant scoping, zod validation, role permissions, workflow orchestration; the checks re-run after every write.
  3. PostgreSQL
    Run in-process by PGlite for the demo. Append-only ledger and audit trail enforced by triggers; CHECK constraints stop overselling.
  4. AI services
    Claude for extraction, routing and explanation, with structured outputs and grounding checks.
  5. Validated outputs
    Stock numbers that rebuild from the ledger, traceable findings and recommendations, owner-approved actions.

The shared data model

businesses · users · suppliers · customers · products · product_variants · locations · inventory_balances · stock_movements · orders · order_items · reservations · pick_lists · invoices / invoice_items · payments · shipments / shipment_items · transfers · returns · purchase_orders / receipts · physical_stock_counts · investigations · investigation_findings · investigation_evidence · investigation_events · audit_events · recommendations · documents

Every business-owned row carries its business; the backend scopes every query to the signed-in user's business. Two tenants share the demo to show it.

7 · What makes it different

Not that it uses AI, or that it manages inventory. Those exist.

Less manual work

Informal orders become structured operational records.

Operational accuracy

Every order, movement and reservation is reflected consistently, and checked.

Actionable intelligence

Traceable recommendations and evidence-backed investigations rather than static charts.

RackPilot connects everyday clothing-business operations with evidence-backed investigations into why recorded transactions and stock don't reconcile.

8 · Hackathon MVP versus the full product

What is built, and what is next.

Built now
  • Realistic clothing catalogue with sizes, colours and rack locations
  • Message, voice-transcript and document order intake with confirmation
  • Availability checks and safe reservations
  • Location-aware pick lists
  • Shortage and low-stock alerts
  • Budget-aware replenishment from sample sales
  • OrderTrace and StockSleuth rules, shared Investigation Centre, grounded explanation, authorised corrections with audit trail
  • Dashboard showing the whole workflow
Phase 2
  • Barcode or QR scanning with a device camera (today: keyboard-wedge scanners and SKU search)
  • Fuller supplier and purchase-order management
  • Returns to suppliers
  • Multi-period reporting
  • Real authentication (Supabase Auth) on the same role checks
  • Configurable reorder rules
Phase 3
  • WhatsApp and other channel integrations
  • Camera-assisted intake
  • Multiple warehouses
  • Seasonal forecasting once a year of history exists
  • Supplier lead-time learning
  • Accounting and sales-channel integrations
9 · How success is measured

Measured on the prototype, not claimed.

Numbers from the repository's own test sets and test run. The Measurements page in the demo recomputes most of them live.
42/44
order messages read fully right

holdout 12/14; ambiguous lines asked 6/6; unknown variants refused 4/4

10/12
policy questions answered from the right section

top 3: 11/12

66%
forecast error per product and week

naive baseline 72%; per variant 125%

22/22
tests pass

demo scenario, ambiguous and unknown orders, insufficient stock, simultaneous orders, missing history, tenants, roles

Not yet measured: time to locate and pick (needs staff trials), usefulness of proposed quantities (needs owners), and the Claude reader's accuracy (needs a paid evaluation run).

10 · The product in one definition

RackPilot is an AI-assisted operations and business-intelligence platform for small clothing wholesalers and apparel businesses. It manages orders, stock, warehouse locations, fulfilment, sales analysis and purchasing decisions. Its OrderTrace module reconciles orders, invoices, payments and dispatch records to uncover transaction discrepancies. Its StockSleuth module reconstructs inventory movements to investigate stock variances, missing movement records, incorrect reservations and location inconsistencies. Both share an investigation engine that presents source-linked evidence, separates verified facts from hypotheses, recommends checks and records authorised resolutions.