Inspiration

E-commerce today is largely designed around humans interacting with websites, searching through catalogs, comparing products, and manually completing checkout. But as AI agents become increasingly capable of understanding intent and executing tasks, we started imagining a different future: What if buyers and merchants could interact through AI agents instead of traditional shopping workflows?

Imagine telling an AI, "Find me the best headphones within my budget," and having it independently discover products, communicate with a merchant's agent, compare options, negotiate suitable offers, and prepare a purchase.

However, this raised a critical question: How can we give AI agents financial autonomy without giving them unrestricted control over people's money?

That question inspired AgentRelay. We wanted to explore a new model of commerce where autonomous agents can collaborate and make purchasing decisions, while deterministic policies and human authorization ensure that financial control remains with the buyer.

What it does

AgentRelay is a Trust-Governed Agentic Commerce and Payment Orchestration Platform that enables Buyer AI Agents and Merchant AI Agents to communicate, coordinate shopping decisions, and facilitate transactions through PayPal Checkout.

It features two specialized AI agents:

  • Buyer Agent: Understands natural-language shopping requests, identifies buyer requirements, evaluates recommendations, and applies the buyer's configurable spending preferences.
  • Merchant Agent: Searches the product catalog, checks inventory, evaluates merchant policies, and suggests relevant complementary products and cross-sell bundles.

The agents follow a structured eight-step A2A workflow, from receiving buyer intent to recording transaction events.

Our key differentiator is the deterministic financial governance layer. Before a purchase proceeds, the backend evaluates the cart against the buyer's configurable autonomous spending limit and merchant restrictions.

  • Purchases within the buyer's spending limit can proceed without an additional spending-limit approval.
  • Purchases exceeding that limit trigger a Human-in-the-Loop authorization modal.
  • Once authorized, the buyer proceeds to PayPal Checkout to review and approve the payment.

AgentRelay also provides a buyer storefront, editable spending preferences, merchant dashboard, transaction monitoring, and audit trails for agent interactions.

How we built it

We built AgentRelay using a full-stack architecture with AI-powered agent interactions and backend-controlled financial governance.

Frontend:

  • React 18 and Vite for the application interface.
  • Tailwind CSS for responsive styling.
  • Axios for frontend-backend communication.
  • Lucide React for interface icons.

Backend:

  • Node.js and Express.js for REST APIs.
  • MongoDB and Mongoose for storing users, products, customers, policies, orders, and audit events.
  • JWT for authentication.
  • Controller-Service-Model architecture for modular backend development.

AI Integration:

  • Groq API for LLM-powered interactions.
  • Separate Buyer and Merchant Agent responsibilities.
  • Natural-language shopping intent processing.
  • Contextual product recommendations and cross-sell suggestions.
  • Structured communication between agents.

Payment Integration:

  • PayPal Checkout for payment orchestration.
  • Backend-driven checkout order creation and processing.
  • PayPal approval and return flow.
  • Payment confirmation and receipt generation.

A major architectural decision was separating AI reasoning from financial authorization. The LLM handles language understanding and recommendations, while deterministic backend services enforce spending limits and merchant policies. This prevents an AI-generated response from independently overriding financial restrictions.

Challenges we ran into

1. Designing reliable agent-to-agent communication

We needed to ensure that the Buyer Agent and Merchant Agent communicated in a structured sequence rather than behaving like two unrelated chatbots. We addressed this by defining an eight-step workflow with distinct responsibilities for intent processing, product discovery, proposal generation, policy evaluation, and transaction handling.

2. Separating AI decisions from financial governance

One of our biggest challenges was ensuring that an LLM could not bypass spending restrictions. We implemented a deterministic policy engine that independently evaluates purchase amounts and merchant restrictions before checkout.

3. Managing buyer-specific spending limits

Initially, the system was using the merchant's default autonomous purchase threshold instead of the buyer's updated spending preference. We traced the issue to two independent policy sources and connected the buyer's configured limit directly to the approval decision while retaining merchant-level daily spending and discount restrictions.

4. Migrating payment integration from Razorpay to PayPal

We initially developed the payment workflow around Razorpay. Adapting it to PayPal required changes across backend payment services, checkout handling, frontend integration, and payment confirmation. We had to preserve the existing shopping and agent orchestration workflows while replacing the payment layer.

5. Coordinating the complete transaction lifecycle

Keeping product recommendations, cart totals, spending-limit decisions, human approval, and payment confirmation consistent across the entire shopping session required careful coordination between frontend state and backend services.

Accomplishments that we're proud of

  • Built a working multi-agent commerce platform with separate Buyer and Merchant AI Agents.
  • Implemented an eight-step A2A shopping and transaction workflow.
  • Integrated Groq-powered LLM interactions for natural-language shopping.
  • Developed intelligent product discovery and contextual cross-sell recommendations.
  • Built a deterministic policy engine with configurable buyer spending limits and merchant restrictions.
  • Implemented Human-in-the-Loop authorization for purchases exceeding buyer-defined limits.
  • Successfully migrated the payment integration from Razorpay to PayPal Checkout.
  • Implemented PayPal checkout redirection, successful payment processing, and receipt generation.
  • Developed separate buyer and merchant interfaces with profile management, product catalogs, dashboards, and audit visibility.

What makes us particularly proud is that AgentRelay is not just an AI shopping chatbot. It demonstrates how multiple agents can collaborate within a governed transaction workflow where financial decisions remain subject to explicit rules and human control.

What we learned

Building AgentRelay taught us that autonomous commerce requires much more than connecting an LLM to a payment API.

We gained practical experience in:

  • Designing multi-agent architectures and defining clear agent responsibilities.
  • Integrating LLMs into structured application workflows.
  • Building backend services for agent communication and transaction orchestration.
  • Implementing deterministic policy enforcement alongside probabilistic AI systems.
  • Integrating PayPal Checkout into an existing full-stack application.
  • Managing authentication, database models, API communication, and frontend state.
  • Handling human authorization and transaction lifecycle consistency.
  • Understanding the importance of auditability, privacy, and financial safeguards in autonomous systems.

Our biggest takeaway was that trust must be an architectural component of autonomous AI systems, not an afterthought.

What's next for AgentRelay - Trust-Governed Agentic Commerce

We see AgentRelay as a foundation for a broader ecosystem of trusted autonomous commerce.

Our next goals include:

  1. Standardized A2A Communication: Explore interoperable protocols that allow Buyer Agents and Merchant Agents from different platforms to communicate.
  2. Advanced Agent Negotiation: Enable more sophisticated negotiation around pricing, discounts, product alternatives, and bundles.
  3. Risk-Aware Transaction Governance: Introduce transaction-risk scoring, anomaly detection, and adaptive authorization requirements.
  4. Agent Identity and Permissions: Develop stronger mechanisms for agent authentication, scoped permissions, and verifiable authorization.
  5. Multi-Merchant Orchestration: Allow Buyer Agents to discover and coordinate purchases across multiple merchants.
  6. Personalized Commerce: Improve recommendations using buyer preferences, shopping history, and contextual requirements.
  7. Enhanced Auditability: Expand transaction monitoring and agent-decision traceability.

Our long-term vision is to make AgentRelay a trust layer for agentic commerce, where AI agents can independently collaborate and execute complex purchasing workflows while buyers retain meaningful control over their money.

AgentRelay: Let agents negotiate. Let policies govern. Let humans stay in control.

Built With

Share this project:

Updates

Submission history