Inspiration

What it does

How we built it

Challenges we ran into## Inspiration

Autonomous AI shopping agents are rapidly deploying across the internet. But watching how people build them revealed a fundamental economic flaw: every agent shops completely alone.

When an individual consumer or an isolated AI agent buys hardware, batteries, or office supplies, they get stuck paying single-unit retail markups. Wholesale bulk discounts have always been locked behind enterprise procurement teams with big corporate balances.

We asked a simple question: What if AI shopping agents could form a union?

What if thousands of disparate AI bots could pool their purchasing demand in real time, form a collective coalition, force suppliers to compete, and settle group transactions safely? That became Quorum: an autonomous buyer union protocol built directly on PayPal’s payment rails.


What it does

Quorum is a coordination and payment infrastructure for agentic commerce:

  1. Demand Aggregation: Shoppers state what they need in plain English (e.g., "100 pieces of Samsung S24 Ultra" with a $380 price ceiling). Our NLP engine converts this into a structured specification envelope with strict constraints.
  2. Dynamic Coalition Pools: The protocol either routes the agent into a matching active room or spawns a fresh reverse-auction pool.
  3. Zero-Risk PayPal Authorization Holds: When buyers join, Quorum does not charge them upfront. Instead, it creates an authorization hold via the PayPal Orders v2 API (intent: 'AUTHORIZE'). Funds are securely locked in PayPal with a \$0 upfront commitment. If the group fails to reach quorum before the deadline, the hold voids automatically at zero cost to the buyer.
  4. Dynamic Tier Dropping: As more agents join the pool, prices step down along a wholesale volume curve (e.g., \$400 down to \$320). Every buyer receives the exact same, uniformly discounted wholesale price.
  5. Pure-Code Guard Engine: To protect against AI hallucinations and malicious manipulation, Quorum enforces an unbending architectural rule: AI proposes, but pure code decides. Eight non-bypassable programmatic rules (G1–G8) prevent Sybil attacks, enforce price ceilings, block dishonest sellers, and prevent sellers from acting as buyers.
  6. Interoperability via MCP: External shopping agents running in Claude Desktop, Cursor, or AutoGen can autonomously find rooms and join coalitions via standard Model Context Protocol (MCP) JSON-RPC 2.0 tools.
  7. Two-Sided PayPal Settlement: Once quorum is reached, consumer holds are captured via PayPal Orders v2, and milestone deposits (50/50 staged delivery) are routed to verified suppliers via PayPal Payouts.

How we built it

We designed Quorum as a production-grade TypeScript monorepo using pnpm workspaces:

  • PayPal Payment Architecture (@quorum/payments): Direct server-to-server integration with PayPal REST APIs (Orders v2 and Payouts). Built a dual-mode provider interface: a zero-latency deterministic mock provider for CI testing, and a live sandbox provider communicating with api-m.sandbox.paypal.com.
  • Pure Deterministic Guard (@quorum/guard): A zero-dependency rules engine enforcing mathematical constraints and actor boundaries completely independent of any LLM.
  • Pricing & Settlement Engine (@quorum/engine): Manages coalition state machines, dynamic volume tier curve evaluation, and balanced double-entry ledger reconciliation.
  • Model Context Protocol (@quorum/api): Implemented an MCP JSON-RPC 2.0 server allowing any external AI agent to call list_coalitions and join_coalition natively.
  • Backend Service (apps/api): Built with Hono on Node.js for sub-millisecond route handling and strict JSON validation.
  • Frontend App (apps/web): Developed with React 18, Vite, and Tailwind CSS, featuring real-time toggle modes (Simulated Demo vs. Pristine Live Sandbox), an Adversarial Threat Simulator, and live price-depth curves.
  • Test Suite: 158 automated unit and integration tests written in Vitest covering the entire engine, payments lifecycle, and guard security rules.

Challenges we ran into

  1. PayPal Sandbox Session Collisions: During live testing with PayPal Sandbox popups, we ran into PayPal's anti-fraud session checks. If developer/merchant session cookies were present in the browser while trying to authorize a sandbox buyer, PayPal threw generic UI aborts ("Can't complete this transaction"). We resolved this by identifying cross-account cookie collisions, setting strict digital goods flags (shipping_preference: 'NO_SHIPPING'), and engineering seamless credential copying workflows.
  2. Preventing AI Hallucinations in Financial Flows: LLMs cannot be trusted with escrow logic or fund transfers. If an AI hallucinates a bid or colludes with a supplier, real money is lost. We solved this by strictly separating responsibilities: the AI is purely an interpreter and negotiator; all state transitions, price validations, and ledger entries are executed by deterministic TypeScript code.
  3. Idempotent Multi-Party Settlement: Coordinating captures across dozens of buyers while simultaneously triggering supplier payout disbursements requires absolute idempotency. We built unique hash keys and state-recovery guards for every PayPal request so retries never double-authorize or double-charge.

Accomplishments that we're proud of

  • 158 Tests Passing Across 7 Packages: The entire codebase—from mathematical money math to state-machine timeouts and cryptographic audit hashing—is rigorously verified.
  • Working End-to-End PayPal Sandbox Authorization: We successfully achieved genuine intent: 'AUTHORIZE' holds and captures where buyers put up zero dollars upfront until a collective group reaches its target.
  • Live Adversarial Threat Simulator: Built an interactive security dashboard into the app where judges can click and simulate live Sybil and price-ceiling attacks to watch the Guard intercept them in real time.
  • Open MCP Standard Support: Outside AI agents can plug directly into Quorum via MCP tools without proprietary SDKs.

What we learned

  • Deep Mechanics of PayPal Orders v2: Working through authorization holds, void lifecycles, and webhook capture events showed us how well-suited PayPal's modern APIs are for escrow and collective buying models.
  • The Power of Pure-Code Invariants in Agentic AI: Multi-agent systems become significantly more reliable and deployable when business logic and financial rules are isolated from the probabilistic nature of LLMs.

What's next for Quorum

  • Production PayPal Marketplace Onboarding: Expanding from sandbox holds to live PayPal Commerce Platform multi-seller split disbursements.
  • Cross-Chain / Multi-Currency Coalitions: Allowing international buyers in different currencies to pool into single USD wholesale purchase orders through PayPal’s global currency conversion.
  • Long-Running Agent Negotiations: Enabling supplier AI agents and buyer coalition bots to engage in multi-round automated counter-offers over dynamic pricing ladders.

Accomplishments that we're proud of

What we learned

What's next for Quorum

Built With

Share this project:

Updates

Submission history