Skip to content
Soham1010Public

About

AI matchmaker for rebuilder-dealers: pairs a damaged ACV car with a Copart salvage donor whose intact parts fix it, and proves the margin. AI proposes and challenges; deterministic code decides.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PAIR — two damaged cars, worth more together

PAIR is an AI matchmaker for rebuilder-dealers. It pairs a damaged car on ACV (the recipient) with a Copart salvage car (the donor) whose undamaged bolt-on parts can fix it, and shows whether the repair package makes money once purchase, parts, labor, transport, fees and risk are counted.

Built for the AI4GOOD hackathon. The demo follows one dealer, Dana, through a RAV4 auction she lost and the packages PAIR finds for her instead.

How it works

AI proposes and challenges; deterministic code decides. No model call ever approves a match.

  1. Intent profiler (lib/intent.ts): reads a buyer's bid history and infers what they are trying to buy (make, model, years, trims, budget, distance).
  2. Discovery lanes (lib/lanes.ts): three opportunity lanes, ACV clean, Copart salvage and PAIR packages, each gated by what that buyer type is allowed to see. A franchise dealer never sees salvage, for example.
  3. Candidate generator and rules engine (lib/engine.ts): finds donor/recipient pairs and rejects trim-specific part mismatches (fascia, headlamp type, sensor packages), generation mismatches, structural damage and donors beyond the buyer's distance cap. Safety-critical parts such as airbags, belts and structural members are never part of a package.
  4. Skeptic (app/api/agent/route.ts): Claude tries to break each proposed match and can request a follow-up photo to resolve an objection. It can object but never approve. Its output is schema-validated, and a deterministic fallback runs when no API key is set.
  5. Evidence loop: an unverified part, such as a radiator support, triggers a photo request. The match is re-decided once the evidence arrives.
  6. Economics engine (lib/economics.ts): costs every line, shows break-even, and labels each input as Sourced, Estimate, Assumption or Synthetic with its source (lib/references.ts). All assumptions can be edited live in the Assumptions drawer.
  7. Explainer: a one-to-two sentence plain-English summary. Every number it cites is checked against the decision record.
  8. Lost-auction simulator (lib/simulator.ts): replays lost auctions to estimate how much recovery PAIR adds on top of plain ACV and Copart recommendations.

Data

  • Market snapshot (data/market/): real data from fueleconomy.gov (every RAV4 configuration from 2019 to 2025) and NHTSA recalls, complaints and crash ratings. Both are US-government public domain. Refresh it with npm run market.
  • Demo dataset (data/*.json, public/photos/): synthetic vehicles, bids, buyers and photo observations, generated deterministically from a fixed seed with npm run data. No real ACV or Copart listings are used.

Running locally

npm install
npm run dev        # http://localhost:3000
npm test           # vitest: economics, rules engine, hero pipeline, simulator

The live Skeptic and Explainer are optional. To use them, put this in .env.local:

ANTHROPIC_API_KEY=sk-ant-...

Without a key, PAIR uses its deterministic fallbacks and the demo still runs end to end.

Stack

Next.js 16 (App Router) · React 19 · TypeScript · Tailwind CSS 4 · Claude via @anthropic-ai/sdk · Zod · <model-viewer> / three.js for the 3D RAV4 · Vitest · deployed on Netlify.

Project layout

app/            page, layout, API routes (agent = Skeptic/Explainer, search = market snapshot)
components/     Home, LostAuction, Discovery, PairDetail, AssumptionsDrawer, Car3D
lib/            engine, economics, lanes, intent, simulator, catalog, references
scripts/        generate-data.ts (synthetic dataset), fetch-market.ts (real market snapshot)
data/           generated dataset + market snapshot
tests/          engines.test.ts

Credits

3D RAV4 models (public/models/): made by @TejasGov.

Car photos come from Wikimedia Commons:

Car Author License
Toyota RAV4 Alexander Migl CC BY-SA 4.0
Toyota Camry Throwawayacc222 CC0
Honda CR-V SsmIntrigue CC BY-SA 4.0
Honda Civic MercurySable99 CC BY-SA 4.0
Ford F-150 SsmIntrigue CC BY-SA 4.0
Chevrolet Equinox Kevauto CC BY-SA 4.0
Nissan Rogue Kevauto CC BY-SA 4.0
Toyota Tacoma Mr.choppers CC BY-SA 3.0

ACV, Copart and the vehicle makes named here are trademarks of their owners. PAIR is an independent hackathon project and is not affiliated with any of them.

About

AI matchmaker for rebuilder-dealers: pairs a damaged ACV car with a Copart salvage donor whose intact parts fix it, and proves the margin. AI proposes and challenges; deterministic code decides.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages