Inspiration

Online peer-to-peer transactions often require buyers and sellers to coordinate everything themselves: negotiating prices, agreeing on terms, arranging payments, sharing shipping details, and confirming delivery. This process can become fragmented, time-consuming, and uncertain, particularly when two people do not know or trust each other.

We wanted to explore a different approach: What if AI agents could handle the coordination and negotiation between buyers and sellers, while a trusted payment infrastructure handled the actual movement of money?

That question inspired Brokerage AI.

Rather than building another marketplace with a chatbot attached, we envisioned a platform where buyers and sellers could delegate parts of a transaction to specialized AI agents. These agents would negotiate within defined boundaries, establish mutually acceptable terms, and coordinate the transaction lifecycle using PayPal's payment infrastructure.

Our goal was to bring agentic AI and digital commerce together in a practical, demonstrable experience.

What it does

Brokerage AI is an AI-powered peer-to-peer marketplace that introduces autonomous buyer and seller agents into the transaction process.

Users can browse available listings, create deals, and choose between two interaction modes:

  • Self Chat: The buyer communicates with the seller's AI agent, which represents the seller's interests and responds according to the seller's listing and deal constraints.
  • AI Negotiate: Two specialized AI agents negotiate autonomously on behalf of the buyer and seller, working towards mutually acceptable deal terms over a maximum of five negotiation rounds.

Once an agreement is reached, AI extracts the conversation into structured deal terms, including the agreed price and transaction details. The seller can review and approve the proposed agreement before payment begins.

The transaction then moves through a coordinated workflow:

  1. Agreement: Both sides establish the deal terms through AI-assisted negotiation.
  2. Invoicing: The seller-side agent creates and sends a PayPal invoice.
  3. Payment: The buyer completes payment through an embedded PayPal checkout experience.
  4. Fund holding: The captured Sandbox payment is held in the platform's business account while the transaction progresses. This is an application-managed simulated escrow workflow, not a native PayPal escrow service.
  5. Delivery: The seller marks the item as shipped and provides tracking information.
  6. Confirmation: The buyer confirms receipt of the item.
  7. Return window: A short demonstration return window allows the transaction to progress through its post-delivery stage.
  8. Payout: Once the workflow is completed, the platform initiates a PayPal Payout to the seller, retaining a transparent 3% platform fee.

Both buyers and sellers have dedicated dashboards to monitor listings, negotiations, messages, deals, invoices, payment statuses, and payouts.

The central idea is simple: AI coordinates the deal, while PayPal powers the payment workflow.

How we built it

We built Brokerage AI as a full-stack web application using a modern JavaScript ecosystem.

Frontend and application layer

  • Next.js App Router and React for the application architecture.
  • Tailwind CSS for styling and responsive interfaces.
  • Framer Motion for interface animations and transitions.
  • Next.js API routes and Node.js for server-side operations and integrations.

AI and agent orchestration

  • Google Gemini as the reasoning engine behind the buyer and seller agents.
  • Vercel AI SDK for integrating AI capabilities into the application.
  • Role-specific agent instructions and transaction context to make each agent represent its respective party.
  • Structured AI outputs to convert natural-language negotiations into actionable deal terms.

Payments and commerce

  • PayPal Agent Toolkit to give AI agents access to specific PayPal capabilities.
  • PayPal Orders API for creating and capturing buyer payments.
  • PayPal Invoicing API for seller-side invoice creation and delivery.
  • PayPal Payouts API for distributing funds to sellers after the transaction workflow is completed.

An important architectural decision was separating the permissions of the two agents. The buyer agent can create, retrieve, and capture orders, but cannot issue invoices or initiate seller payouts. The seller agent can create and send invoices and initiate permitted payouts, but cannot capture the buyer's payment.

This separation helps establish clearer execution boundaries instead of giving every agent unrestricted access to financial operations.

Database and authentication

  • Supabase Auth for user authentication.
  • Supabase PostgreSQL for persistent application data, including profiles, listings, deals, messages, and transaction records.

We designed the application around the complete transaction lifecycle rather than treating negotiation and payment as disconnected features.

For the hackathon prototype, all payment operations use PayPal Sandbox accounts and test transactions.

Challenges we ran into

One of our biggest challenges was connecting conversational AI to a structured financial workflow.

An AI-generated conversation is not automatically a valid transaction. The agents need to understand the buyer's requirements, the seller's constraints, and the agreed terms without losing important details during negotiation.

We had to think carefully about how to turn natural-language conversations into structured deal information that could be reviewed before triggering payment operations.

Another challenge was coordinating the transaction lifecycle. Invoicing, payment capture, shipment updates, delivery confirmation, the return window, and seller payouts are separate operations, but they must follow a consistent sequence. A failure or premature action at one stage should not incorrectly advance the entire transaction.

Integrating multiple PayPal APIs introduced another layer of complexity. Orders, Invoicing, and Payouts serve different purposes, and we needed to understand how they fit together into one coherent commerce experience.

We also had to consider agent permissions. Giving both agents unrestricted access to payment operations would create unnecessary risks. Designing role-specific capabilities helped us establish a more controlled approach to agentic commerce.

Finally, building a complete marketplace experience within a hackathon timeframe required balancing the core transaction workflow against secondary marketplace features and interface improvements.

Accomplishments that we're proud of

We are particularly proud of bringing together AI-driven negotiation and a multi-stage payment workflow in one application.

Some of the accomplishments we value most are:

  • Building two distinct negotiation experiences: human-to-agent Self Chat and autonomous buyer-versus-seller AI negotiation.
  • Enabling specialized agents to negotiate within their respective roles and produce structured deal terms.
  • Integrating multiple PayPal capabilities across invoicing, order creation, payment capture, and payouts.
  • Designing role-specific PayPal tool permissions rather than providing both agents with unrestricted financial access.
  • Connecting the agreement process to subsequent delivery, confirmation, and payout stages.
  • Building dedicated buyer and seller dashboards to make the transaction lifecycle visible and understandable.

Most importantly, we are proud that Brokerage AI demonstrates a broader use of AI than simply generating text or answering questions. The agents participate in a multi-step commercial workflow where their outputs connect to real application operations within a controlled Sandbox environment.

What we learned

Building Brokerage AI taught us that developing an agentic application involves much more than connecting an LLM to a collection of tools.

We learned the importance of defining clear agent responsibilities, controlling tool access, validating structured outputs, and maintaining application-side control over important operations.

We also gained practical experience working with PayPal's Orders, Invoicing, and Payouts APIs and understanding how different payment capabilities can be orchestrated into a complete transaction journey.

Another important lesson was that AI autonomy needs boundaries. Agents can negotiate and coordinate, but financial operations require explicit permissions, validation, and carefully managed application state.

Most importantly, we learned to approach AI-powered commerce as a system-design problem rather than simply an AI integration problem.

What's next for Brokerage AI

We see Brokerage AI as a foundation for a more comprehensive agentic commerce platform.

Our next steps include:

  • Smarter negotiations: Improving agent reasoning, negotiation strategies, and the ability to handle more complex buyer and seller requirements.
  • Expanded marketplace: Introducing better discovery, search, filtering, categories, and listing management.
  • Transaction transparency: Improving tracking, status updates, transaction histories, and notifications throughout the lifecycle.
  • Dispute resolution: Exploring AI-assisted dispute handling with evidence collection and human review.
  • Shipping integrations: Connecting real shipping and tracking providers to reduce manual coordination.
  • Production readiness: Moving beyond the Sandbox prototype by addressing payment custody, regulatory requirements, security, reliability, and production payment infrastructure.

Our long-term vision is to make peer-to-peer commerce more convenient by allowing people to focus on what they want to buy or sell, while specialized AI agents handle much of the coordination required to complete the transaction.

Brokerage AI is our step towards a future where AI agents don't just recommend what to do — they help get things done.

Built With

  • ag-grid
  • agentic-ai
  • ai-agents
  • e-commerce
  • fintech
  • framer-motion
  • gemini
  • generative-ai
  • javascript
  • large-language-models
  • next.js
  • node.js
  • payment-automation
  • paypal
  • paypal-agent-toolkit
  • paypal-invoicing-api
  • paypal-orders-api
  • paypal-payouts-api
  • postgresql
  • react
  • supabase
  • supabase-auth
  • tailwind-css
  • vercel
  • vercel-ai-sdk
Share this project:

Updates

Submission history