-
-
Home Screen
-
Home Screen
-
The searched product and its details
-
Other product with comparison and details
-
Inisitating payment pop through paypal
-
Payment successfully inisiated after writing the details of card
-
Suceesful Payment Pop up to verifies that payment is inisiated Successfully
-
All the orders been made with their details and ID no to track them
Inspiration
Online shopping means dozens of tabs: specs, reviews, price checks, and still no confidence you picked right. AI chatbots can recommend products, but they are a black box: you can't see why they chose something, and they sometimes invent prices.
We wanted an assistant that shows its work and ends in a real, secure checkout. For the PayPal Hackathon, that meant AI agents that research like a careful friend, then hand you a trusted PayPal payment.
What it does
You describe what you need and your budget, by typing or speaking, e.g. "wireless noise cancelling headphones under $100". Five AI agents then work live in Mission Control:
- Intent Agent: turns your sentence into a structured shopping brief (category, budget, must-haves)
- Search Agent: queries the product database for items that meet every must-have
- Budget Agent: splits matches into within / over budget, and flags near misses ("Raise budget to $120")
- Comparison Agent: scores every option 0–100 with a transparent formula
- Explainer Agent: writes a short, plain-English reason for the top pick
You get a top pick, alternatives, a side-by-side comparison table and one-tap refinements. Click any agent to see exactly what it did: the JSON, the SQL query and the scores.
Then click Buy with PayPal, approve in PayPal Sandbox (PayPal wallet or card), and the order is captured, saved and shown with a receipt.
How we built it
- Frontend: React 19 + TypeScript, Vite, Tailwind CSS 4, Framer Motion for animation, PayPal JS SDK for the checkout buttons
- Backend: Python FastAPI, streaming each agent step to the browser with Server-Sent Events
- AI: Groq running
gpt-oss-120b, with a smaller model and a rule-based parser as fallbacks - Database: Supabase Postgres with Row Level Security: products, missions, agent steps, recommendations and orders
- Payments: PayPal Server SDK (generated by APIMatic) using Orders v2: create → approve → capture
- Photos: free Unsplash images, each credited to its photographer
The AI only understands the request and explains the result. Plain code does the searching, budget check and scoring, so results are fair and repeatable. The Intent Agent's output is validated JSON (simplified):
{
"category": "headphones",
"maxPrice": 100,
"requirements": [
{ "spec": "wireless", "equals": true, "kind": "must" },
{ "spec": "anc", "equals": true, "kind": "must" }
]
}
Every product is scored out of 100:
$$\text{Score} = 0.30\,R + 0.25\,V + 0.25\,F + 0.20\,S$$
where \( R \) is rating, \( V \) value, \( F \) fit to your use case and \( S \) specs. Value rewards staying under budget: \( V = 100 - 50 \cdot \frac{\text{price}}{\text{budget}} \). Rating is weighted by review count: \( R = \frac{r - 3}{2} \cdot 100 \cdot \left(0.85 + 0.15 \cdot \min\left(1, \frac{n}{2000}\right)\right) \). The weights shift when you ask for "cheap" or "top rated".
Challenges we ran into
- AI getting numbers wrong: the explainer once claimed a $99 product was "$1 over" a $100 budget. Fix: the AI never does math. Code calculates every budget note, and a validator rejects any dollar amount that isn't in the facts we provided.
- Latency spikes: some AI calls took ~10 s. We added per-call timeouts, a fallback model, caching and a rule-based backup, so a search never hangs.
- Trustworthy prices: the browser never sends a price. The server reads it from the database, creates the PayPal order, and verifies the captured amount matches.
- PayPal order lifecycle: capturing before approval returns
ORDER_NOT_APPROVED. We made capture idempotent (safe to retry) and turned PayPal errors into clear messages. - Database security without the admin password: we used Supabase's REST API with tight Row Level Security rules, plus one locked-down function that can only reduce stock by one.
Accomplishments that we're proud of
- A glass-box AI: every agent's work is one click away, from the AI's JSON to the exact SQL query to the score breakdown
- Real end-to-end payments: PayPal Sandbox orders are created, approved, captured, saved in Supabase, and stock goes down
- Grounded explanations: the AI can't invent prices or specs; everything it says comes from verified facts
- Never breaks during a demo: if the AI, database or backend is unavailable, the app falls back gracefully instead of failing
- Polished experience: live agent animations, voice input, mobile layout and confetti on a successful payment
What we learned
- LLMs are best at understanding and explaining, not deciding or calculating. Pairing them with deterministic code makes AI trustworthy.
- Showing the work builds trust: streaming each agent's step live makes the result feel earned, not magic.
- The PayPal Orders v2 flow (create → approve → capture), plus idempotency and server-side price checks, is what makes agent-driven checkout safe.
- Row Level Security in Supabase lets a public key do only exactly what the app needs.
What's next for ShopPilot AI
- Real catalogs: connect live merchant and affiliate product feeds instead of our demo catalog
- PayPal Vault: saved payment methods for one-click reorders
- Multi-item carts: let agents build bundles (e.g. a full desk setup within one budget)
- Price-watch agent: notify you when a product drops into your budget
- Personal memory: remember preferences like brands, sizes and past purchases
- Go live: deploy publicly and switch from PayPal Sandbox to production
Built With
- api
- apimatic
- css
- fastapi
- gpt-oss-120b
- groq
- javascript
- lucide
- node.js
- orders
- paypal
- postgresql
- postgrest
- python
- sdk
- server
- tailwind
- typescript
- unsplash
- uvicorn
- vite