-
-
Stage 0: Natural Language Intake — Natural language hardware brief entry with quick industry workstation presets.
-
Conversational Clarification Guardrail — Halts assumptions when budget or key constraints are missing and asks clarification questions.
-
Stage 1: Deterministic Multi-Plan Optimizer — Synthesizes Plan A , Plan B , and Plan C with deterministic spec difference analysis.
-
Interactive AG Grid Matrix — High-density editable component matrix showing real-time SKUs, specs, delivery SLAs, and stock counts.
-
Real-Time Over-Budget Deficit Guardrail — Disables checkout when a custom component swap exceeds the approved budget ceiling.
-
Algorithmic Auto-Rebalance Transparency auto-downgrades non-critical components to resolve budget deficits with full before-and-after audit.
-
5-Axis Trade-Off Radar Chart — Compares plans across Cost Efficiency, Hardware Quality, Spec Match, Delivery Speed, and Reliability.
-
Smart Trade-Off Frontier — Real-time sensitivity recommendations: Cost Relief (Save ₹47k), Hardware Boost, and 3-Day Express Speed.
-
Sensitivity Trade-Off Confirmation — Detailed itemized change breakdown before applying recommendations to the plan.
-
Autonomous 2-Agent Negotiation — Buyer AI Agent negotiates volume discounts against a Merchant Quote Engine with private margin floors.
-
Negotiated Vendor Rebate Applied — Concession secured and applied directly as a line-item discount in the settlement ledger.
-
Supplier Quote & WhatsApp Intake — Ingests raw supplier proformas to benchmark prices and identify missing spec risks.
-
Stage 2: Ed25519 Cryptographic Spending Mandate math envelope locking spending ceilings and merchant identity before payment creation.
-
Executive Remote Approval Portal — Single-use expiring token link and QR code for mobile sign-off.
-
PayPal Pay-on-Delivery Authorization Hold — Funds held in an authorization hold; captured only upon physical delivery verification.
Inspiration
Buying IT and workstation hardware for startups, engineering teams and small businesses is full of manual friction and financial risk:
- 100% upfront capital risk: Vendors and distributors want full payment before they ship.
- Zero leverage on failure: If parts arrive late, defective, or downgraded (say, a 75Hz panel instead of the 144Hz IPS you ordered), the buyer has already paid and has no financial leverage.
- Spending drift and no governance: Requests bounce between chats, spreadsheets and emails, with no mathematical budget ceiling, no cryptographic spend control and no tamper-proof audit trail.
We built ProcureAI to fix this: an autonomous AI procurement agent that negotiates and buys hardware on your behalf under an Ed25519 cryptographic spending mandate, using PayPal Pay-on-Delivery authorization holds. Buyer funds stay held and are captured only after the hardware is delivered and inspected.
What it does
ProcureAI runs the full procurement lifecycle in seven coordinated steps.
1. Natural-language intake and smart clarification
The user types a plain prompt such as "Set up 5 workstations under ₹3,00,000 with 144Hz monitors, delivered within 7 days." Gemini extracts quantities, refresh rates and delivery deadlines. If a critical constraint such as budget is missing, the Agent Clarification Card stops the agent from guessing and offers interactive budget presets first.
2. Deterministic multi-plan optimization
To avoid LLM arithmetic hallucination, a deterministic verifier checks a commercial hardware catalog against the hard constraints and builds three verified baskets. A basket \(B\) is feasible only if its total cost stays within the budget \(M\):
$$ \text{Cost}(B) = \sum_{i \in B} \text{qty}(i) \cdot \text{price}(i) \le M $$
and every hard constraint (refresh rate of at least \(144\) Hz, delivery within the deadline, stock availability) also holds.
- Plan A (Lowest Cost): the minimum total price that meets every hard constraint.
- Plan B (Best Quality in Budget, Recommended): the highest weighted score for hardware quality \(Q\), manufacturer reliability \(R\) and fulfillment speed \(F\) within budget:
$$ \text{Score}(B) = \alpha Q(B) + \beta R(B) + \gamma F(B) $$
- Plan C (Alternative): a high-scoring variant that differs from Plan B in at least two component categories.
It also computes deterministic spec diffs: "What the extra ₹X buys vs Plan A" and "How Plan C differs from Plan B."
3. AG Grid data matrix and live budget rebalancing
Users can switch to a dense AG Grid view and swap components in real time. If a swap pushes the basket over the ceiling, an over-budget guardrail locks checkout and offers Auto-Rebalance Basket, which deterministically downgrades non-critical items until the basket is within budget again.
4. Trade-off frontier and multi-dimensional radar
What-if recommendations (Cost Relief, Hardware Boost, Express Speed) come with an itemized change confirmation. A 5-axis Radar Chart compares cost efficiency, specs, delivery speed and reliability.
5. Two-agent autonomous negotiation
A Buyer Agent negotiates volume discounts against a Merchant Quote Engine that enforces private margin reservation floors. Concessions it secures can be applied to the basket with Apply Negotiated Rebate.
6. Ed25519 cryptographic spending mandates
The finalized order is signed with an Ed25519 keypair. The mandate locks the spending ceiling \(C\), the plan hash and the merchant ID. Before any PayPal order is created or authorized, ProcureAI verifies the signature \(\sigma\) with the public key and checks the ceiling:
$$ \text{Verify}\big(\text{pk}, \sigma, H(\text{plan}) \parallel \text{merchantID} \parallel C\big) = \text{true} \quad \wedge \quad \text{Cost}(B) \le C $$
A CFO can approve remotely through a single-use, expiring token link or a QR code.
7. PayPal Pay-on-Delivery authorization hold
Payment is placed with intent: "AUTHORIZE", so funds are held during fulfillment and nothing is captured upfront. Once the hardware arrives and is verified, the buyer clicks "Confirm Physical Delivery & Capture Payment", which captures via PayPal Payments v2. If delivery fails or the specs don't match, the authorization can be voided immediately with zero financial loss.
How we built it
PayPal platform integration
- Orders v2 API (
intent: "AUTHORIZE"): places the pay-on-delivery hold, with full USD/INR dual-currency reconciliation. - Payments v2 API (
/v2/payments/authorizations/{id}/capture): atomic capture on confirmed delivery. - Payments v2 API (
/v2/payments/authorizations/{id}/void): releases held funds on delivery rejection or cancellation. - Webhooks v1: verified through PayPal's
POST /v1/notifications/verify-webhook-signatureAPI, with no local HMAC shortcuts. - Invoicing v2 API: generates itemized corporate invoices for tax accounting.
AI and deterministic separation
- Google Gemini 2.5 Flash: natural language understanding, clarification and multi-round negotiation dialogue.
- Deterministic verification engine: pure algorithmic constraint evaluation with zero math in the LLM, plus guaranteed SLA and inventory checks.
- Heuristic fallback: if Gemini quotas or rate limits are hit, the system falls back to local deterministic parsing so the user flow never blocks.
Security and cryptography
- Ed25519 signing: tamper-proof envelopes built with Node.js native
node:crypto. - Immutable SHA-256 audit trail: a hash-chained SQLite ledger in which every state transition commits to the previous block:
$$ \text{hash}(n) = \text{SHA-256}\big(n \parallel \text{hash}(n-1) \parallel \text{time}(n) \parallel \text{action}(n) \parallel \text{payload}(n)\big) $$
- Per-visitor session isolation: each visitor gets an isolated session (
x-session-id), so users on shared environments don't interfere with each other.
Data and real-time streaming
- Node.js native
node:sqlite: an embedded, zero-dependency database in WAL mode on Node 24. - Server-Sent Events (SSE): a push pipeline (
/api/events) for order progress, remote approvals and reconciler alerts. - In-process 10-minute expiry reconciler: watches authorization validity, with a 72-hour honor-period warning and a 29-day expiration state transition.
Frontend
React 18, Vite, Ant Design 5, Framer Motion and AG Grid Community v36.
Challenges we ran into
1. Eliminating LLM arithmetic errors. LLMs hallucinate prices, miscalculate totals and fumble strict inequalities (is \(144 \ge 144\)?). We split the work: Gemini handles language, and a deterministic engine does all catalog matching, budget validation and scoring.
2. Dual-currency rounding mismatches. Converting INR line items to PayPal USD amounts can leave 1-2 cent discrepancies (ITEM_TOTAL_MISMATCH). Our deterministic penny-reconciliation algorithm rounds every line item to cents and adjusts the remainder so the line items sum exactly to the order total:
$$ \sum_{i=1}^{n} \text{usd}(i) = \text{total} $$
3. True webhook cryptographic verification. Instead of fragile local HMAC logic, we call PayPal's POST /v1/notifications/verify-webhook-signature end to end, passing all 7 transmission parameters.
4. Reconciliation on a persistent disk. A separate Render cron job can't mount the web service's persistent disk, so we built an idempotent in-process reconciler with overlapping-run guards inside the main web service.
Accomplishments that we're proud of
- 224 passing automated tests: a fully green suite covering constraint verification, Ed25519 signing and tamper detection, PayPal webhook verification, sensitivity frontier calculations and Playwright end-to-end browser flows.
- Real cryptographic spend enforcement: the Ed25519 mandate mathematically bounds what the agent can spend before any payment gateway call is allowed.
- A complete working lifecycle: every step works end to end against real PayPal Sandbox, from natural-language brief to grid customization, remote executive sign-off, authorization hold and delivery capture.
- Zero client-side secrets: strict security hardening, Helmet CSP headers and no API credentials in the client build.
What we learned
- How to use PayPal's two-step
intent: "AUTHORIZE"pattern to build a secure pay-on-delivery protocol for commercial commerce. - How to design reliable agentic systems by separating probabilistic language capabilities from deterministic business logic and cryptographic governance.
- How to build background reconciliation loops and hash-chained audit ledgers with native
node:sqliteon Node 24.
What's next for ProcureAI
- Automated carrier tracking: courier webhooks (FedEx, DHL, Delhivery) that trigger delivery verification automatically on geofenced delivery confirmation.
- Multi-merchant cart splitting: extending the optimizer to split baskets across specialized merchants, with separate concurrent PayPal authorization holds under one master mandate.
- Multi-signature corporate thresholds: extending the Ed25519 mandate to \(M\)-of-\(N\) threshold signatures for multi-stakeholder enterprise sign-offs.