Inspiration
Autonomous shopping bots and AI checkout agents are entering e-commerce, but they operate blindly: they only check if an account balance covers the single purchase in front of them. They have zero situational awareness of upcoming real-world bills—like rent due in 3 days, payroll, or recurring utilities. An agent spending $300 from a $350 account can trigger catastrophic overdraft fees or leave a user unable to pay their housing commitments. We built Can-I-Buy-It? (Guardian Copilot) to give PayPal users an autonomous financial guardian that protects their liquidity before they spend.
What it does
- Sacred $500.00 Protected Liquidity Floor: Mathematically models 90-day forward cash flow against scheduled commitments (rent, utilities, subscriptions) and strictly blocks or flags any discretionary purchase that would breach the $500 safety reserve.
- Autonomous Multi-Agent Consensus Swarm: A stateful LangGraph swarm (Trader ↔️ Auditor ↔️ Arbiter) debates transactions, calculates pure Decimal math, checks overpricing, and evaluates risk before creating any payment orders.
- Intelligent PayPal Pay in 4 Routing: When paying upfront in full would dip the balance below $500, Guardian automatically models 4 bi-weekly interest-free installments ($87.50 down vs. $350.00 upfront) to preserve liquidity.
- Human-in-the-Loop (HITL) Authorization: The agent never silently debits an account; it stages transactions in a persistent pre-execution gate requiring explicit user confirmation.
- Universal Multi-Merchant Discovery: Integrates Channel3 to search 100M+ products across 25,000+ merchants by text or image.
- PayPal Invoicing & Order Audit: Allows freelancers to draft and send incoming client invoices and perform read-only order inspections in PayPal Sandbox.
How we built it
- Frontend: Next.js 15 (React 19, Tailwind CSS v4) with Server-Sent Events (SSE) streaming for real-time multi-agent reasoning traces, custom MagicBento telemetry cards, and dark-mode storefront.
- Backend: FastAPI (Python 3.12) orchestrating a LangGraph state machine with deterministic Python
Decimalarithmetic for financial invariants. - PayPal REST v2 APIs: Integrated
/v2/checkout/orderswith idempotency headers (PayPal-Request-Id), PayPal Pay in 4 checkout,/v2/invoicing/invoices,/v1/reporting/transactions, and "Log in with PayPal" OAuth 2.0. - AG Grid & AG Charts: Integrated
AgGridReact(v36 Quartz Dark Theme) for high-density transaction ledgers, CSV exports, and 90-day cash flow projection curves. - ChromaDB & SQLite: Persistent write-through transaction ledger in SQLite and long-term memory via ChromaDB vector embeddings.
Challenges we ran into
- Eliminating Floating-Point Drift: Financial invariants cannot tolerate binary floating-point errors (e.g.,
0.1 + 0.2 != 0.3). We enforced pure PythonDecimalarithmetic across the entire auditor and reconciliation pipeline. - Eliminating LLM Hallucinations in Commerce: General LLMs often invent prices or merchants. We enforced a deterministic fail-closed router that requires verified item metadata and benchmarks against real catalog pricing.
- PayPal Reporting Index Latency: Real sandbox transaction reporting can take up to 3 hours to index. We engineered a write-through local SQLite cache deduplicated by
paypal_idso newly captured transactions reflect immediately in the AG Grid ledger.
Accomplishments that we're proud of
- Achieving 100% test pass rates on automated financial invariant suites and DeepEval LLM-as-a-judge benchmarks.
- A seamless, responsive multi-agent consensus debate visible live in chat as Trader, Auditor, and Arbiter inspect the transaction.
- Building a robust, high-performance AG Grid financial ledger with custom dark styling and dynamic payment method badges.
What we learned
- How to implement cyclic LangGraph state machines with explicit Human-In-The-Loop interruption boundaries.
- Best practices for PayPal REST v2 Sandbox APIs, specifically dynamic Buy Now, Pay Later (Pay in 4) vaulting and idempotency keys.
- Leveraging AG Grid v36 custom cell renderers and themes for financial telemetry.
What's next for Can-I-Buy-It?
- Production merchant webhook listeners for automatic dispute resolution and chargeback defense.
- Direct bank account aggregation via Open Banking / Plaid to synchronize off-PayPal checking balances into the 90-day liquidity model.
- Browser extension bringing Guardian Copilot directly into any checkout page on the web.