Inspiration

AI agents are starting to buy things — rebooking flights, restocking inventory, ordering groceries. But every agentic-commerce demo so far has the same problem: two black boxes agree on a price, and nobody can prove the deal was fair. We wanted negotiation you can watch, a referee with real veto power, and a settlement receipt you can verify.

What it does

Consensus Commerce stages every deal as a visible, multi-agent negotiation:

  • Buyer agent — max price and a walk-away threshold
  • Seller agent — floor price, stock pressure, counter-offers
  • Fairness Referee — computes the Jain fairness index every round and holds hard-veto power over exploitative outcomes

Five open rounds. When the agents converge, the deal executes on the PayPal Orders API (OAuth → create order → capture) and the system mints a SHA-256 fairness certificate: clearing price, Jain index, weighted Nash welfare, and the full round transcript.

Live proof run: a Leica M6 Titan deal settled at $2,325.00 with Jain index 1.0000, PayPal sandbox order SIM896E21DF87178F · COMPLETED, certificate CC-FAIR-EF440F498002.

How we built it

  • FastAPI backend: three agent classes plus the referee, a 5-round negotiation loop, Jain index + weighted Nash welfare scoring, and hard-veto rules
  • PayPal Orders v2 adapter: real OAuth token flow → create order → capture. It runs labeled sandbox_simulation until live credentials are dropped in — we show the honest label instead of a fake "LIVE" badge
  • Live dashboard: watch the rounds negotiate in real time; deal acceptance triggers the PayPal order and the certificate
  • 11 pytest cases covering the engine, referee vetoes, and the PayPal adapter

Challenges

Calibrating the referee was the hard part: too strict and every deal dies, too loose and fairness is theater. We landed on hard vetoes only for genuine exploitation (Jain index below threshold) and soft re-nudges otherwise. Model-provider outages mid-build also taught us to make every agent call retryable.

What we learned

Fairness needs teeth. A fairness score nobody can act on is decoration; a referee that can actually kill a deal changes how the agents behave. And payments need receipts — the certificate is the piece that makes the whole thing auditable.

Built With

Share this project:

Updates

Submission history