Inspiration
What if buyers and sellers could negotiate with each other through AI agents instead of spending hours comparing prices, sending messages, and waiting for responses?
Traditional e-commerce is largely built around fixed prices and manual interactions. Buyers want better deals, while sellers need to protect their margins. We wanted to build a platform where both sides could use AI agents to negotiate transparently, within rules defined by the seller.
That idea inspired BhavAI — an agentic commerce platform designed to make buying and selling more intelligent, interactive, and accessible.
What it does
BhavAI connects buyer agents and seller agents in an intelligent commerce environment.
- AI-powered negotiation: Buyers can make offers and negotiate with seller agents.
- Seller-defined pricing rules: Sellers configure minimum prices, bulk discounts, and approval thresholds to protect their margins.
- Agentic commerce: AI agents help discover products, evaluate offers, and move negotiations toward an agreement.
- Deal-to-order workflow: Accepted negotiations can be converted into orders.
- PayPal integration: International USD transactions use PayPal Checkout and PayPal Orders API, with Sandbox payment capture and webhook verification.
- India-ready payments: INR domestic transactions support a separate manual settlement workflow.
- Seller analytics: Sellers can monitor products, negotiations, orders, and transactions through an interactive dashboard.
- MCP integration: BhavAI exposes commerce capabilities through a Model Context Protocol server, allowing compatible AI clients to interact with the platform.
Our goal is to make commerce more conversational, autonomous, and seller-friendly.
How we built it
We built BhavAI as a full-stack application with an agentic commerce architecture.
Frontend: React, TypeScript, Vite, and Tailwind CSS power the buyer and seller experiences. AG Grid Community provides interactive analytics tables and CSV export.
Backend: Node.js and Express handle authentication, product catalogs, seller pricing rules, negotiations, orders, and payment workflows.
AI layer: Google Gemini powers AI-assisted negotiation, with a deterministic policy-based fallback to keep negotiation behavior predictable when AI is unavailable.
Agent interoperability: We implemented an MCP server with approximately 20 commerce tools, including protected operations and role-based authorization.
Database: PostgreSQL, hosted on Supabase, stores users, products, pricing rules, negotiations, orders, and payments. Row Level Security policies provide an additional database access-control layer.
Payments: PayPal Orders API and the official PayPal JavaScript SDK support USD checkout and capture. Webhook signature verification and idempotent event handling help maintain payment state integrity.
Deployment: The frontend and API are deployed on Render, with Supabase PostgreSQL as the production database.
Challenges we ran into
One of our biggest challenges was designing negotiations that are flexible for buyers without exposing sellers to unacceptable prices.
We addressed this through seller-defined pricing policies, including price floors, bulk discounts, and approval thresholds.
Payment consistency was another major challenge. A payment callback, order cancellation, or duplicate webhook event should never incorrectly change an order's state. We implemented payment-state guards, transaction-safe order updates, webhook signature verification, and idempotent event processing.
We also had to make agent tools secure. Sensitive seller operations needed authorization, and public product or negotiation data should not expose internal pricing rules.
Finally, integrating the frontend, backend, database, MCP tools, and PayPal into a deployed application required extensive testing and debugging.
Accomplishments that we're proud of
- Built a working buyer-seller agentic negotiation platform.
- Implemented seller-controlled pricing and negotiation policies.
- Integrated PayPal Sandbox checkout and successfully captured a real Sandbox payment.
- Verified PayPal-signed Sandbox webhook delivery and invalid-signature rejection.
- Built an MCP server with approximately 20 commerce tools.
- Developed seller analytics with interactive AG Grid tables.
- Implemented PostgreSQL Row Level Security with 11 policies across 11 tables.
- Deployed the frontend and backend publicly with Supabase PostgreSQL.
- Passed 111 automated tests across API and web applications.
Most importantly, we brought the project beyond a local prototype and deployed a working application.
What we learned
We learned that building agentic commerce is not just about connecting an LLM to a shopping interface.
Reliable commerce requires clear business rules, authorization, payment-state consistency, idempotency, and secure communication between agents and services.
We also learned how to combine AI-assisted decisions with deterministic business policies, integrate payment infrastructure, expose application capabilities through MCP, and deploy a full-stack application using managed cloud services.
What's next for BhavAI
We envision BhavAI becoming an interoperable commerce network where buyers and sellers can interact through their own AI agents.
Our next steps include:
- Expanding support for international currencies and payment providers.
- Improving agent-to-agent product discovery and negotiation.
- Adding more seller controls and advanced analytics.
- Supporting more MCP-compatible AI clients.
- Improving production monitoring and payment reconciliation.
- Exploring trust, reputation, and dispute-resolution mechanisms for agentic commerce.
BhavAI — Where AI agents don't just recommend products. They negotiate deals.
Built With
- agentic-ai
- aggrid
- artificial-intelligence
- e-commerce
- express.js
- fintech
- generative-ai
- google-gemini
- model-context-protocol-(mcp)
- node.js
- paypal
- postgresql
- react
- render
- rest-api
- supabase
- tailwind-css
- typescript