AgentCart AI — Your Personal AI Shopping Assistant

Inspiration

Online shopping gives us thousands of products to choose from, but finding the right combination of products for a specific need can still be surprisingly difficult.

Imagine setting up a home office. You need a monitor, keyboard, mouse, and perhaps a desk accessory — all within a fixed budget. Instead of researching every product individually, comparing specifications across multiple pages, and calculating the total yourself, what if you could simply describe what you need and let an AI shopping assistant do the research?

That idea inspired AgentCart AI.

We wanted to explore how AI could move beyond answering shopping questions and become an active shopping assistant that understands customer requirements, researches a real product catalog, compares options, and builds a practical recommendation.

What it does

AgentCart AI turns natural-language shopping requests into personalized product recommendations.

A customer can simply ask:

Build me a complete work-from-home setup under $1,000.

The AI shopping agent then:

  1. Understands the request — identifies the customer's needs, preferences, and budget.
  2. Searches real products — uses server-side tools to retrieve matching products from a MongoDB catalog.
  3. Compares options — evaluates product details, prices, and availability.
  4. Builds a recommendation — suggests a suitable combination of products within the requested budget.
  5. Explains its decisions — tells the customer why each product was selected and how much budget remains.
  6. Waits for approval — the customer reviews and explicitly approves the recommended setup.
  7. Completes a test checkout — the approved cart proceeds through PayPal Sandbox checkout.

The customer stays in control throughout the experience. The AI recommends; the customer decides.

How we built it

AgentCart AI is built as a single full-stack application using Next.js.

The AI layer uses OpenRouter to connect to language models and a tool-based orchestration flow to interact with the product catalog. Instead of allowing the AI to invent product information, product searches and comparisons are performed through backend tools that retrieve actual catalog data.

MongoDB and Mongoose power the product catalog and cart persistence. Zod is used for request validation, while server-side cart and checkout logic ensure that product prices and order totals are calculated by the backend rather than trusted from the browser.

For payments, we integrated the PayPal Orders API v2 and the official PayPal JavaScript SDK in Sandbox mode. This allows us to demonstrate the complete approval and test-payment experience without processing real money.

The frontend is built with Next.js App Router, React, TypeScript, and Tailwind CSS, with a focus on a clean, minimal shopping workspace.

Challenges we faced

One of the biggest challenges was making the AI interact with real product data instead of producing convincing but unreliable recommendations.

We addressed this by giving the AI a limited set of structured tools for searching, retrieving, comparing, and evaluating products. This keeps product information grounded in the catalog.

Another challenge was budget accuracy. An AI-generated recommendation should not simply claim to fit a budget. We implemented backend calculations using actual product prices and made the customer explicitly approve the recommendation before adding it to the cart.

Payment reliability was another important consideration. The browser must never be trusted as the source of payment amounts. Our checkout flow recalculates totals on the server and verifies PayPal payment capture before confirming the demo order.

We also designed fallback behavior for situations where the AI provider or model is unavailable, so the shopping experience can remain usable without falsely presenting fallback recommendations as successful AI tool execution.

What we learned

Building AgentCart AI helped us explore how tool-based AI systems can interact with application data and perform useful, bounded tasks.

We learned the importance of:

  • Connecting language models to real application data through controlled tools.
  • Separating AI reasoning from business-critical calculations.
  • Keeping users in control of AI-generated actions.
  • Designing reliable fallback experiences for external AI services.
  • Integrating payment providers while keeping sensitive operations on the server.
  • Building an AI experience that solves a practical problem instead of simply demonstrating a chatbot.

What's next?

AgentCart AI is a focused demonstration of a different way to shop: describe what you need, let AI research the options, understand its recommendations, and approve your purchase.

AI is the product. Checkout is the proof.

Built With

Share this project:

Updates