Inspiration
Online shopping offers consumers more choices than ever, but comparing products based on price, quality, and seller reliability can be overwhelming. While traditional AI shopping assistants can generate recommendations, they often rely on a single model without explaining how different priorities influence the final decision.
I wanted to explore a different approach: What if multiple AI agents, each specializing in a different aspect of shopping, could deliberate and collectively recommend the best product?
Inspired by my previous research on multi-agent consensus formation and directional influence in large language models, I developed ConsensusCart, a multi-agent AI shopping assistant that brings structured deliberation into e-commerce.
My goal was to build a system where AI agents independently evaluate products, challenge one another's reasoning, and reach an informed recommendation before allowing users to complete their purchases through PayPal.
What it does
ConsensusCart is an AI-powered shopping assistant that helps users compare products, understand trade-offs, and make purchasing decisions through multi-agent deliberation.
The application consists of four specialized AI agents:
Budget Agent: Evaluates product affordability, pricing, and value for money.
Quality Agent: Assesses product specifications, features, and alignment with user preferences.
Trust Agent: Evaluates seller reliability, customer reviews, warranties, and return policies.
Deals Agent: Takes into account deals and discounts for the user
Users select a product category, specify their budget and preferences, and initiate the recommendation process. Each agent independently evaluates products from a curated demonstration catalog and generates an initial recommendation.
When the agents disagree, ConsensusCart initiates a structured deliberation process where agents review competing arguments, reconsider their initial recommendations, and update their decisions.
After deliberation, the system aggregates the agents' recommendations and presents the selected product alongside the reasoning and trade-offs behind the decision.
Finally, users can proceed to checkout through PayPal's Orders v2 API, connecting AI-assisted decision-making with a functional payment experience. If the user doesn't agree with the agents selection, they can override it.
How I built it
ConsensusCart was developed using Python, GPT-4.1-mini, LangChain, LangGraph, Streamlit, and PayPal's REST APIs.
Multi-Agent Architecture
I designed three specialized agents using GPT-4.1-mini through OpenAI's API. Each agent receives a distinct system prompt defining its evaluation criteria and independently analyzes the available products.
To maintain consistency, I implemented structured output schemas using Pydantic, ensuring that agents return standardized recommendations, confidence scores, and explanations.
Agent Orchestration and Deliberation
I used LangGraph to orchestrate the multi-agent workflow, including parallel agent evaluations, disagreement detection, conditional deliberation, and final decision aggregation.
The workflow consists of several stages:
Initial Evaluation: All three agents independently evaluate the product candidates.
Disagreement Detection: The system compares agent recommendations to determine whether deliberation is necessary.
Deliberation: Agents examine competing arguments and reconsider their recommendations over a maximum of two rounds.
Decision Aggregation: The system combines the agents' evaluations to select a final recommendation.
Explanation: Users can inspect the agents' reasoning and understand how the recommendation was reached.
PayPal Integration
I integrated PayPal's Orders v2 API to support sandbox payment processing.
The payment workflow includes creating an order, redirecting the user to PayPal for approval, capturing the approved payment, and displaying transaction confirmation.
PayPal's sandbox environment allows the complete checkout process to be demonstrated without real financial transactions.
Frontend and Testing
I developed the interactive frontend using Streamlit, allowing users to configure shopping preferences, initiate agent evaluations, inspect deliberation results, and proceed to checkout.
I also implemented automated tests using pytest to validate agent behavior, recommendation aggregation, and workflow orchestration.
The application is deployed through Streamlit Community Cloud.
Challenges I ran into
Coordinating Multiple AI Agents
One of the biggest challenges was ensuring that three independently operating agents could evaluate the same products while producing consistent, structured outputs.
I addressed this by defining separate agent responsibilities and implementing Pydantic schemas to standardize their responses.
Handling Agent Disagreement
Another challenge was determining how agents should resolve conflicting recommendations.
A simple majority-voting approach would not fully capture the benefits of multi-agent reasoning. Instead, I implemented a structured deliberation process that allows agents to reconsider their decisions after examining competing arguments.
I also needed to account for situations where agents continued to disagree, ensuring that the system could still produce a recommendation without falsely presenting the result as unanimous consensus.
Integrating AI Recommendations With PayPal
Connecting AI-generated recommendations to a payment workflow introduced additional complexity.
I needed to ensure that the selected product and its price remained consistent when creating and processing PayPal orders.
Using PayPal's sandbox environment helped me develop and test the payment workflow safely.
Building an End-to-End Application
Integrating the agent architecture, deliberation workflow, decision aggregation, frontend, and payment processing into one functional application required extensive debugging and testing.
I addressed these challenges through modular Python components, automated tests, and iterative development.
Accomplishments that I'm proud of
Built a functional multi-agent AI shopping assistant with three specialized agents evaluating products from different perspectives.
Implemented structured agent deliberation, allowing agents to challenge competing recommendations rather than relying solely on majority voting.
Integrated PayPal's Orders v2 API to connect AI-assisted recommendations with sandbox checkout.
Developed an interactive Streamlit application that allows users to explore agent reasoning and complete the shopping workflow.
Implemented automated testing to validate important components of the multi-agent architecture.
Translated academic research into a practical application, applying concepts from multi-agent consensus formation and directional influence to consumer decision-making.
What I learned
Building ConsensusCart taught me several important lessons about multi-agent AI systems and full-stack AI application development.
First, multiple AI agents do not automatically produce better decisions. Their effectiveness depends on how responsibilities are distributed, how disagreements are handled, and whether their recommendations remain grounded in available evidence.
Second, I learned that agent orchestration requires careful state management and structured communication. Implementing a reliable multi-agent workflow involves more than making multiple LLM API calls; it requires coordinating independent evaluations, managing deliberation rounds, and aggregating potentially conflicting recommendations.
Third, integrating PayPal helped me better understand payment API workflows, order creation, transaction capture, and sandbox testing. It also reinforced the importance of keeping users in control of financial transactions, even when AI assists with purchasing decisions.
Finally, this project strengthened my understanding of how to translate research concepts into a functional, user-facing application.
What's next for ConsensusCart
Although ConsensusCart currently uses a curated demonstration catalog, I envision expanding it into a more comprehensive AI-powered shopping platform.
Some future improvements include:
Real-Time Product Discovery: Integrating retailer APIs to retrieve live product listings, prices, and availability.
Personalized Agent Priorities: Allowing users to adjust the importance of affordability, quality, and seller trust based on their individual preferences.
Advanced Deliberation Strategies: Exploring confidence calibration, evidence verification, and more sophisticated consensus-building mechanisms.
Multi-Product Comparisons: Supporting purchasing decisions involving product bundles and multiple items.
Expanded PayPal Integration: Exploring additional PayPal capabilities to support more realistic commerce experiences.
Quantitative Evaluation: Benchmarking multi-agent deliberation against single-agent recommendations to measure improvements in recommendation quality, consistency, and decision-making transparency.
Ultimately, I want ConsensusCart to demonstrate how multi-agent AI systems can make online shopping more transparent, explainable, and trustworthy.
Rather than simply telling users what to buy, ConsensusCart helps them understand why a product is recommended, while providing a seamless path from AI-assisted decision-making to PayPal checkout.