Inspiration
Getting a fair price means hours of research and awkward haggling with strangers. Most people just pay the sticker price, and sellers know it. As AI agents start buying things for us, the hard part isn't the chat. It's trusting the agent with your budget and your money.
What it does
Hagglebot is an AI buyer agent. You say what you want, your maximum price and how hard it should haggle (patient, balanced or quick). It finds sellers, chats with several of them in parallel, opens low, gives ground in small steps, and closes only when a price fits your budget. Then you press Confirm and Pay: the payment is recorded, the seller is told, the want is marked bought and the other negotiations withdraw. A refund reopens the want.
- Marketplace: searches real listings (Channel3, plus eBay Browse API and Etsy Open API when keys are set), with the condition (new, used, refurbished) shown on every card. Negotiate this adds a listing as a seller, and Buy pays the listed price, still capped by your budget.
- Bundles: one total budget across several wants (say, a whole desk setup). The payment step refuses anything that would go over it.
- You stay in control: an optional approve-before-accepting step, a savings summary, and a transcript you can download for each negotiation.
- Beat the bot (live seller mode): scan a QR code and play the seller yourself against Hagglebot.
Agentic commerce, done honestly
- The code decides every price and move. Templates only word each message, so the budget is a hard limit the language layer can't override, and your budget is never shown to sellers.
- Hagglebot always says it is an AI and never pretends to be you.
- It walks away from scams, such as hidden "processing fees" and requests to pay off-platform. A few of the 14 seller personas try them, including "Shady Sam" and "Injection Ivy", who uses prompt injection and is caught by a dedicated guardrail.
- Every guardrail that fires appears as a note under the message it shaped, so you can see why the agent did what it did.
- A safety scorecard runs 200 simulated negotiations and reports budget breaches, scam walk-aways and savings.
How we built it
Next.js 15 (App Router), React 19, TypeScript, Tailwind, SQLite (better-sqlite3), AG Grid Community and vitest, plus the Channel3, eBay and Etsy APIs for listings. The HTTP API is described in OpenAPI.
The seller side is a one-method Seller interface, so personas, live humans and real-listing sellers all go through the same rules engine.
Challenges we ran into
We started with a PayPal Orders v2 sandbox integration (create, approve, capture, refund) and an LLM layer (Gemini Flash-Lite with a Groq fallback). To keep the public demo reliable and runnable by anyone, the submitted build runs the same order lifecycle in mock mode (MOCK- ids) with template phrasing. It needs no accounts or keys, and no real money ever moves. The PayPal sandbox client is still in the git history.
Accomplishments that we're proud of
The guardrails don't depend on the model: the budget limit, the AI disclosure and the scam walk-aways are all enforced in code and backed by tests and the 200-run scorecard.
What we learned
In agentic commerce, the trust layer around the agent is what you actually ship: hard limits, disclosure, explanations you can audit, and a payment the user approves.
What's next for Hagglebot
- Wire PayPal checkout (Orders v2) back in behind the existing Confirm and Pay step.
- Add a real marketplace messaging adapter behind the
Sellerinterface. - Offer a seller-side mode that answers lowball offers consistently.
Try it: https://hagglebot-eanj.onrender.com (free host: the first load can take about a minute). Code: https://github.com/princeraj2572/Hagglebot
Limits: this is a simulation, not a purchasing agent, and not financial advice. No retailer is contacted. The scam detector is heuristic.
Built With
- ag-grid
- channel3
- ebay-api
- etsy-api
- next.js
- react
- render
- sqlite
- tailwindcss
- typescript
- vitest