Project Info
Inspiration
We've all been there: you list your old AirPods on Facebook Marketplace, and within minutes you're drowning in "is this available?" messages, getting offers for half your asking price, and coordinating meetups with people who ghost you. The peer-to-peer resale market is worth $200 billion globally, yet selling is still a painful, manual process that wastes hours of your time and often results in accepting lowball offers just to be done with it. We realized AI agents could fundamentally change this. Instead of you doing all the work (listing, messaging, negotiating, vetting buyers), what if a swarm of AI agents handled everything? That's Bye! Buy! -- your personal selling team that does the work while you just show up and get paid.
What it does
Bye! Buy! is an AI agent marketplace that sells your stuff for you. Here's how it works: You list once: Upload a photo and basic details of what you're selling (AirPods, couch, bike, whatever) You list once: Upload a photo and basic details of what you're selling (AirPods, couch, bike, whatever) Agents take over: Listing agents automatically cross-post to Facebook Marketplace, Craigslist, OfferUp with optimized descriptions and competitive pricing Negotiation agents handle all buyer messages, filter out scammers and lowballers, and negotiate upward to get you the best price Verification agents screen buyers based on their messaging patterns and response quality Coordinator agents schedule meetups at safe locations and times that work for you Agents take over: Listing agents automatically cross-post to Facebook Marketplace, Craigslist, OfferUp with optimized descriptions and competitive pricing Negotiation agents handle all buyer messages, filter out scammers and lowballers, and negotiate upward to get you the best price Verification agents screen buyers based on their messaging patterns and response quality Coordinator agents schedule meetups at safe locations and times that work for you Secure payment: When a buyer is ready, payment goes through Stripe escrow. Guaranteed funds before you hand over the item. Secure payment: When a buyer is ready, payment goes through Stripe escrow. Guaranteed funds before you hand over the item. You show up once: Meet the verified buyer, hand over the item, and get paid instantly. The agents handled everything else. You show up once: Meet the verified buyer, hand over the item, and get paid instantly. The agents handled everything else. Result: What used to take 2+ weeks and 50+ message exchanges now happens automatically while you do nothing.
How we built it
System Architecture At a high level, Bye! Buy! is two cooperating FastAPI microservices — a Posting Service and a Messaging Service — sharing a single SQLite database, with a Next.js frontend on top. Cloud browser sessions via Browserbase + Stagehand give our agents real browser access to Facebook Marketplace, and GPT models power the negotiation intelligence. Tech Stack Agent Architecture We built a multi-agent system where specialized agents collaborate through a shared database and event-driven state machine. Each agent is optimized for a single responsibility: Listing Agent — Uses a hybrid automation strategy. Browserbase launches a cloud Chromium session with persistent Facebook cookies (stored in a Browserbase Context so login survives across sessions). Rather than using Stagehand's natural-language act() for form filling (which can be unreliable on complex forms), we connect directly via Playwright CDP for precise DOM manipulation: press_sequentially() with 20-40ms delays to mimic human typing, direct input[type="file"] for image upload, and programmatic selector clicks. The one exception is category selection — Facebook's multi-level category dropdown is too dynamic to hard-code, so we extract all visible options with custom JavaScript, send them to GPT-4o-mini, and let the AI pick the best match. Negotiation Agent — The core intelligence layer. Every time a new message is detected in a buyer conversation, the agent constructs a rich system prompt containing: Listing details (title, description, price, condition) A dynamically computed "visible lowest price" that hides the true floor from the AI to prevent accidental leaks Negotiation rules calibrated by the seller's willing_to_negotiate float (0.0 = firm, 1.0 = very flexible) State-based addenda (competing offers from other buyers, address collection prompts, confirmation requests) Full conversation history with a [NEW MESSAGES] marker so the AI knows exactly what to respond to The AI returns structured JSON: {message, deal_status, agreed_price, delivery_address, buyer_offer}, which drives the deal state machine forward. Payment Agent — When a deal is confirmed, creates a Stripe Checkout Session and sends the payment URL directly to the buyer in the Facebook chat. Listens for Stripe webhooks (checkout.session.completed) with a polling fallback. After payment, the listing is marked as SOLD, a thank-you message is sent, and a background worker monitors for the seller to upload a tracking number. After delivery confirmation, the seller receives an instant payout via stripe.Transfer.create(). If no tracking number is uploaded within 7 days, the buyer is auto-refunded. Negotiation Intelligence Deep Dive The negotiation system is the heart of Bye! Buy!. Here's how a message flows through the AI pipeline: The negotiation rules are dynamically generated based on a single willing_to_negotiate float (0.0 to 1.0): Critically, the AI never sees the actual min_price. Instead, we compute a "visible lowest" price: price - (price - min_price) * flexibility. This prevents the AI from accidentally revealing the true floor to the buyer — it genuinely believes its bottom line is higher than the seller's actual minimum. When multiple buyers are negotiating for the same item simultaneously, the agent leverages competing offers: if Buyer B offers $55 and Buyer A offered $50, the system appends a competing-offer addendum to Buyer A's next prompt, naturally pressuring them upward. Deal Lifecycle State Machine When a deal reaches agreed, all competing conversations for the same listing are automatically closed — the negotiation agent sends a polite "item is no longer available" message to other buyers. Browser Automation: Two Strategies A key architectural decision was using two different browser automation strategies for two different problems: Both strategies share the same bot detection mitigation: Human-like typing delays (20-40ms per character) Random pauses between actions (0.3-0.8s) Session breaks every 75 polling cycles (60-120 second cooldown) Browserbase's built-in CAPTCHA solving
Challenges we ran into
Browser automation across platforms - Each marketplace has different layouts, anti-bot systems, and messaging interfaces. Making agents handle layout changes and rate limits without breaking was tough. Negotiation strategy - Finding the balance between pushing for higher prices vs. not scaring off real buyers. We built a dynamic pricing model using the seller's willing_to_negotiate parameter and a hidden floor price the AI can't accidentally reveal. Agent coordination - The negotiation agent needs to know when another buyer has a better offer to apply pressure. The payment agent needs to know the exact moment a deal closes to trigger Stripe checkout. Getting agents to communicate through shared state took multiple tries. Real conversations are messy - People send random emojis, ask weird questions, or go off topic. We taught the negotiation agent to stay on track while sounding natural. The system prompt literally says "talk like a real person texting."
Accomplishments we're proud of
Multi-agent negotiation that works - Tested with real scenarios and the agents successfully pushed prices higher than initial offers in most cases. Cross-platform browser automation - Agents can post listings and respond to messages on Facebook Marketplace and Craigslist without any human help. Full payment flow - Stripe escrow to instant payout, including auto-refunds if seller doesn't ship within 7 days. Agents actually collaborating - Watching the listing, negotiation, payment, and payout agents work together feels like having a real team. Tackling a broken $200B market - P2P resale is massive but the selling experience sucks. We're fixing it.
What we learned
Specialization beats generalization - One agent trying to do everything failed. Split into specialized agents (listing, negotiation, payment) and it worked. Same as human teams. Browser automation unlocks agent marketplaces - Most platforms have no APIs. Browserbase (cloud browsers) + Stagehand (AI navigation) + Playwright (DOM control) lets agents work anywhere. Negotiation is the worst part - User research showed dealing with lowball offers and endless messages is the top reason people don't sell their stuff. It's a UX problem, not a supply problem - The $200B resale market has buyers and items. What's broken is the interface. Messaging, negotiating, and coordinating payments creates so much friction that people give up or accept bad prices. This works beyond selling - Started with resale but the same agent architecture works for gigs, rentals, services. Any high-friction peer-to-peer market can be fixed with agents as intermediaries.
What's next
Short term (next 3 months): Launch beta with 100 users selling electronics and furniture. Integrate with more marketplace platforms (OfferUp, Mercari, eBay). Add photo enhancement AI (auto-background removal, better lighting). Build reputation system for tracking successful sales. Medium term (6-12 months): Expand to local services marketplace. Need a plumber? Agents find them, vet them, negotiate rates, schedule appointments, and handle payment. Launch "reverse marketplace" where you post what you want to buy and seller agents compete to offer you the best deal. Long term vision: The Agent Economy Bye! Buy! isn't just a selling app. It's infrastructure for agent-mediated commerce. Today, marketplaces connect buyers and sellers, but humans still do all the work (messaging, negotiating, coordinating). In the future, AI agents will handle all marketplace transactions: Your selling agent negotiates with their buying agent automatically Specialized gig agents bid on tasks (plumber agents, designer agents, tutor agents) Service agents coordinate complex purchases (moving agent books truck + helpers + supplies in one go) The market opportunity: P2P resale: $200B (our entry point) Gig economy: $455B globally Local services: $600B+ Total addressable: over $1 trillion in agent-mediated transactions We're starting with selling your old stuff because it's the simplest wedge. But we're building the rails for every agent-driven transaction.
This repository has no readme, or GitHub could not be reached.
Analysis
View
Metric
- 12
- 9
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- HTMLIn code
- Next.jsIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- SQLIn code
- Tailwind CSSIn code
- TypeScriptIn code
10 of 10 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
425 KB
Source files
102
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
jpsingaraju/bye-buy
121 files · 1.5 MB · @ e0cd501
Structure
Interface
23 files · 19%Screens, components and styles rendered to the user.
API & routing
10 files · 8%Request entry points: routes, handlers and controllers.
Application logic
39 files · 32%Domain rules, services and shared utilities.
Background jobs
3 files · 2%Work run outside a request: tasks, workers and schedules.
Data & schema
24 files · 20%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python53%
- TypeScript26%
- Markdown14%
- HTML4%
- SQL1%
- CSS1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/pyproject.toml
pypi · 15- aiofiles
- aiosqlite
- browserbase
- fastapi
- greenlet
- openai
- pillow
- playwright
- pydantic-settings
- python-dotenv
- python-multipart
- sqlalchemy[asyncio]
- stagehand
- stripe
- uvicorn
frontend/package.json
npm · 15- framer-motion
- next
- react
- react-dom
- react-dropzone
- recharts
- swr
- +8 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.