-
-
WhyBuy: the pause between wanting and buying.
-
A new wish, the same need: WhyBuy shows what you wrote before and asks one honest question.
-
Real store prices from Channel3, and how much of this month's budget it would take.
-
Approved with PayPal Sandbox: the order carries your reason, and the server verifies the capture.
-
An AI assistant can propose a purchase, but it waits in WhyBuy. Only you approve.
Inspiration
I have a habit: when I want something, I leave it in my cart and ask myself every day if I still need it. Most of the time, the wish fades. Buying isn't bad, but many purchases are driven by a moment of emotion, and we rewrite our reasons afterwards.
AI shopping agents remove the last natural pause, finding the card, and they do what they're told, fast. I wanted to put the pause back, right before the payment, and make the person's own reason travel with it.
What it does
WhyBuy is a memory for purchase decisions.
- Want it, with its why. You write what you want and why. AI reads the reason (need vs. impulse) and suggests a short pause.
- Sleep on it. The idea waits 1, 3 or 7 days. Once a day, WhyBuy asks a single question: still want it?
- Recall, in your own words. When a new wish serves the same need as an earlier one, WhyBuy shows what you wrote before and asks one reflection question. Your answer is saved as your criterion.
- Decide with real numbers. Channel3 finds the real product with a real price and store, shows the price range in stores today, and WhyBuy tells you whether it fits what's left of this month's budget.
- Approve with PayPal. You open the store or approve a PayPal Sandbox payment. The order carries your reason, and the server verifies the capture before anything is marked as bought.
- Agents propose, people approve. An AI assistant can create a proposal (an unapproved order) in the same waiting room. It can never pay.
How I built it
- Next.js 16 + React 19 + TypeScript + Tailwind, deployed on Vercel.
- Gemini (OpenAI-compatible API) to interpret intentions: subject, reason type, specific needs, and a hint when two wishes solve the same problem.
- Channel3 API for live product search and a price-range scan (filters out mismatches, trims extremes, takes the median).
- PayPal REST Orders API v2 (Sandbox): orders are created server-side with the reason in the description and the intention ID in
custom_id. Capture is idempotent and checks that the order belongs to that intention. - PayPal Agent Toolkit pattern for the assistant: it can only
proposePurchaseandgetOrder. The capture lives on a separate route that requires human approval in PayPal. - Memory lives in the browser (localStorage with schema migration), so there are no accounts and no personal data on a server.
- An API shield (rate limits, same-origin checks, scanner blocking) protects the public demo.
Challenges I ran into
- Small models broke the core feature. With a small local model, the "same need" recall never fired: needs came back empty or invented. Moving to a hosted Gemini model made it work.
- The agent tried to invent things. Early on it guessed a price and used the request itself as the reason. Now the reason must come from the person's own words and the price must have been stated by them.
- Honest payments. PayPal Sandbox is a technical demo, not a real store purchase. The UI says so before and after paying, and it shows where every price came from.
- Matching real products. A search for "Mac mini M4" matched MAC cosmetics. Model tokens like "M4" must now match exactly, and the scan stays silent rather than showing a fake range.
- Designing for low attention. People don't read; they react. The interface became a three-step story (Want it → Sleep on it → Decide) with one question at a time.
Accomplishments that I'm proud of
- A complete, deployed flow, from a wish to a verified PayPal Sandbox payment, that a judge can try in two minutes.
- The agent boundary is enforced in code, not just in the prompt: an assistant can propose, but it can't pay.
- Recall that uses the person's own words instead of advice.
- Every number on the screen says where it comes from.
What I learned
- The most useful AI here isn't the one that buys faster; it's the one that remembers why.
- Model quality matters more than prompt tricks for structured extraction.
- Trust in payments comes from small honest details: verified captures, idempotency, and clear labels.
What's next for WhyBuy
- A connector for agents (e.g. MCP / PayPal Agent Toolkit), so any AI agent's proposed purchase passes through the same pause before PayPal checkout.
- Real merchant payees through a PayPal platform integration, so the approved payment goes to the actual store.
- Optional sync across devices, keeping the person in control of their memory.
- Gentle reminders at the end of each pause.
Built With
- channel3
- gemini
- local-storage
- next.js
- node.js
- paypal
- paypal-agent-toolkit
- paypal-rest-api
- react
- tailwindcss
- typescript
- vercel
- vitest

