INSPIRATION
All markets worldwide have always had the art of haggling — whether it be the souks of Marrakech, the bazaars of Istanbul, or the street stalls of Delhi. But in the age of e-commerce, everything has been reduced to a simple "Buy Now" button.
We wanted to bring back the art of haggling and rethink pricing entirely. The price you pay shouldn't be a number a database hands you. It should be something you earned through conversation.
WHAT IT DOES
Choose an item from the shelf and you're taken into a haggling room with Brindle, our AI shopkeeper. Brindle has a secret floor price he'll never go below, a distinct personality, and a limited amount of patience.
Make an offer. Brindle responds in character — charmed by flattery, agitated by lowballs, won over by a good story. His mood shows through his eyes, his voice, and the lighting in the room around him. When you reach an agreement, that price — created entirely through your conversation — becomes the exact amount on a PayPal order. You pay through PayPal and receive a receipt. The price was never in a database. You talked it into existence.
The Merchant Portal lets any shop owner configure their own listing: product name, description, list price, a secret floor price Brindle will never betray, and a personality for Brindle to adopt. Once set up, Brindle haggles for your shop 24/7 in four languages.
Key features:
Real-time haggling with structured AI output — each turn returns a reply, an emotion, a counter-offer, and a deal signal Five expressive emotions shown on a 3D orb through eyes only, no mouth Brindle reads every reply aloud using the browser's speech synthesiser in English, Spanish, Russian, and German Price Rail shows your offer and Brindle's counter converging in real time Patience meter drains on lowball offers and stalling PayPal Orders v2 integration signs the agreed price server-side — the client cannot tamper with the amount Merchant Portal lets any seller configure a product, set a secret floor, and choose Brindle's personality HOW WE BUILT IT
Stack: Next.js App Router, TypeScript, Tailwind CSS, shadcn/ui
For each haggling turn we call the negotiate API. The LLM running on Groq receives the product details, conversation history, Brindle's personality, and the floor price in the system prompt. Structured output is returned via tool call and validated with Zod on the server. The floor price is enforced in code — every counter is clamped between the floor and the list price, and a deal is only valid if the final price meets or exceeds the floor. The floor lives in server config and never touches the client.
When a deal is reached, the server issues a short-lived HMAC-signed deal token containing the product ID, agreed price, and expiry. When the buyer clicks Pay, only the token is sent to the create-order endpoint. The server verifies the signature and expiry, extracts the price, and creates a PayPal Orders v2 order with that exact amount. The client never sends a price. The amount on the PayPal order is always the amount agreed in the negotiation — mathematically guaranteed.
Brindle is built in React Three Fiber using drei's MeshDistortMaterial. Mood maps to color, distortion speed, wobble intensity, and emissive glow, all lerped smoothly between states. His eyes are soft squircle shapes parented to the sphere with no pupils — expression comes from shape change alone. The room's ambient light tints to match the current mood. One shared easing token and two spring presets are used consistently throughout. All animations use only transform and opacity.
Voice uses the browser's native speechSynthesis with smart voice selection, a text preprocessor that adds natural pauses and fixes price formatting, and mood-matched rate and pitch. No external APIs, no cost.
CHALLENGES
Keeping the floor truly server-side. The floor price must never appear in the client bundle, API response, or console. We built a token system so the agreed price travels from negotiation to PayPal order without the client ever knowing the floor it was checked against.
Structured output across languages. When Brindle switches to Russian or German, the JSON tool call occasionally fell out of sync. We added Zod validation with a one-retry fallback and an in-character error line so any failure stays invisible to the buyer.
Making the orb emotionally readable without going uncanny. Eyes without a mouth on a floating sphere can get unsettling fast. Removing the pupils and using a single soft squircle shape per eye — expression through shape change only — fixed it.
The ceiling of free browser voices. We pushed speechSynthesis as far as it goes with voice priority selection, rate and pitch tuning, and a text preprocessor — but it's still a browser voice with a natural limit.
ACCOMPLISHMENTS
A checkout where the price is created by conversation, with the PayPal order amount cryptographically tied to what was agreed — not what the client sends. Five distinct emotions on Brindle, readable through eyes alone. A Merchant Portal that turns a fun concept into a genuine product pitch: any seller, any floor, any personality, four languages, around the clock. A design that feels considered and was built in under 24 hours.
WHAT WE LEARNED
The most important lesson was that AI integration needs to be structural, not cosmetic. Brindle doesn't assist a fixed-price checkout — he creates the price. The moment we made the LLM output the actual PayPal order amount via the signed token, everything clicked into place. That's what meaningful integration actually means.
We also learned that prompt injection is a real concern the moment money is involved. Enforcing the floor in code rather than in the prompt took one extra line of server logic and made the entire system tamper-proof.
WHAT'S NEXT
Real PayPal merchant onboarding so any seller gets paid directly and Haggle Bot becomes a deployable storefront. Persistent session history so returning customers get a warmer opening and Brindle can reference your last haggle. Dynamic floor pricing that adjusts based on inventory, time of day, and demand. Mobile with voice input so you can speak your offer and Brindle speaks back. Brindle as an API so any e-commerce platform can embed him as a negotiation layer on top of their existing catalog.
Built With
- framer-motion
- groq
- next.js
- paypal
- react-three-fiber
- tailwind-css
- typescript
- web-speech-api
- zod