About AgentCart
Inspiration
Online shopping offers thousands of choices, but finding the right product can still be frustrating. Users often spend considerable time browsing through product listings, applying filters, comparing specifications, and trying to decide which option best matches their needs.
We wanted to make this experience simpler and more intelligent.
This inspired us to build AgentCart, an AI-powered shopping assistant that allows users to describe what they need in natural language and helps them discover, evaluate, compare, and purchase relevant products through a single platform.
Our vision was to go beyond building another e-commerce website or chatbot. We wanted to combine conversational AI with an actual shopping workflow.
What We Built
AgentCart brings together AI-powered product discovery, intelligent recommendations, product comparison, cart management, and payment processing.
Its key features include:
- Natural Language Product Search: Users can describe their requirements conversationally instead of relying entirely on traditional keyword searches and filters.
- Intelligent Requirement Extraction: The AI layer interprets user requests and converts them into structured shopping requirements.
- Hard-Constraint Filtering: Products that fail essential user requirements are filtered out before recommendation ranking.
- Explainable Product Ranking: Relevant products are ranked according to user requirements, helping users understand why particular products are recommended.
- Product Comparison: Users can compare multiple products side by side to evaluate their specifications and pricing.
- Shopping Cart: Users can add products, manage quantities, and review their order totals.
- PayPal Sandbox Integration: Users can complete a payment workflow through PayPal Sandbox.
- Order Management: Orders and payment statuses are persisted, with support for payment reconciliation.
How We Built It
We developed AgentCart using a full-stack architecture.
Frontend: Next.js, React, TypeScript, and Tailwind CSS were used to build a responsive shopping interface with product discovery, comparison, cart, and order management features.
Backend: FastAPI and Python power the REST APIs and core business logic, including requirement processing, product filtering, recommendation ranking, and checkout operations.
AI Integration: Groq API is used for natural-language understanding and requirement extraction. We also implemented a rule-based fallback mechanism to preserve basic functionality when AI processing is unavailable.
Database: PostgreSQL, hosted on Neon, stores product information, shopping sessions, requirements, recommendations, orders, and payment attempts. SQLAlchemy and Alembic are used for database management and migrations.
Payments: PayPal Sandbox is integrated for order creation, payment approval, and capture. The backend independently validates product prices and uses idempotency safeguards to reduce duplicate checkout operations.
Deployment: The frontend is deployed on Vercel, while the FastAPI backend runs on Render, with Neon providing persistent PostgreSQL storage.
Challenges We Faced
Building AgentCart involved several challenges beyond simply connecting an AI API to an e-commerce interface.
1. Converting Natural Language into Structured Requirements
Users express shopping needs in different ways, often without mentioning exact product specifications. We needed to translate these requests into structured requirements that could be used by the recommendation system. Integrating AI-based extraction with deterministic filtering helped address this challenge.
2. Building Meaningful Recommendations
Returning products based only on keyword similarity would not provide a useful shopping experience. We implemented hard-constraint filtering followed by relevance-based ranking so that essential requirements are considered before recommending products.
3. Making Checkout Reliable
Payment processing introduced challenges involving duplicate requests, server-side price validation, payment capture, and uncertain payment states. We addressed these through idempotency safeguards, persistent payment-attempt tracking, and payment reconciliation logic.
4. Database Migrations and Deployment
Moving from local development to a deployed PostgreSQL environment required careful database configuration and migration management. We encountered a missing database table during checkout, traced the issue to an incomplete migration history, and resolved it by introducing and applying an additional Alembic migration.
5. Integrating Multiple Technologies
Connecting the Next.js frontend, FastAPI backend, AI service, PostgreSQL database, and PayPal Sandbox required careful API integration, configuration management, and end-to-end testing.
What We Learned
Building AgentCart helped us understand that developing an AI-powered application involves much more than integrating a language model.
We learned how to combine probabilistic AI outputs with deterministic business logic, design recommendation pipelines, build and consume REST APIs, manage relational databases and migrations, and implement safer payment workflows.
We also gained practical experience deploying a complete full-stack application and debugging issues across different environments.
Most importantly, we learned that a useful AI product should not only understand what users say but should also help them complete meaningful tasks.
What's Next?
We see AgentCart as a foundation that can be extended further. Future improvements could include more advanced personalization, larger product catalogs, improved recommendation strategies, richer product information, and additional payment options.
Our ultimate goal is to make online shopping less about browsing endless product listings and more about simply describing what you need.
AgentCart — Describe what you need. Discover what fits. Shop smarter.
Built With
- alembic
- fastapi
- groq
- neon
- next.js
- paypal
- postgresql
- python
- react
- render
- rest-api
- sqlalchemy
- tailwind-css
- typescript
- vercel