CartAI - Hackathon Submission Questions

Inspiration

The inspiration came from observing how online shopping has removed the human element of negotiation. In traditional markets, buyers and sellers negotiate to find mutually beneficial prices based on urgency, sustainability values, and budget constraints. Modern e-commerce forces everyone to accept fixed prices, removing personalization and the ability to optimize for what truly matters to each individual.

We also noticed that sustainability is often an afterthought in shopping platforms. We wanted to make carbon footprint a first-class priority alongside price and delivery speed, giving environmentally conscious shoppers a real tool to make better choices.

The final spark was realizing that AI agents could recreate this negotiation dynamic—not as a gimmick, but as a genuine multi-agent system where different AI models with different "personalities" could produce realistic, varied outcomes.

What it does

CartAI is an AI-powered negotiation platform that helps users find the best deals based on their unique priorities:

  1. Natural Conversation: Users describe what they want to buy through a chat interface powered by GPT-4o
  2. Priority Customization: Users adjust three sliders (Speed, Carbon, Price) that total 100% to express what matters most
  3. Store Selection: An interactive Google Maps interface shows real Manhattan stores
  4. AI Negotiation: When a user selects a store, AI buyer and seller agents negotiate in real-time through 4 rounds
  5. Transparent Results: The system analyzes the final offer and determines who won—buyer, seller, or if it was a fair deal

Each store uses different AI models:

  • H&M: GPT-4o buyer vs GPT-4o seller
  • Zara: Claude 3 Haiku buyer vs Claude 3.5 Sonnet seller
  • Hugo Boss: DeepSeek buyer vs DeepSeek seller

The platform saves all negotiations to Supabase, allowing users to review past conversations and outcomes.

How we built it

We built it with lack of sleep and lots of redbulls but on the serious note:

Frontend:

  • Next.js 15 with App Router for modern React patterns
  • TypeScript for type safety across the entire codebase
  • Tailwind CSS for responsive, dark-themed UI
  • Framer Motion for smooth animations during negotiations
  • Google Maps JavaScript API with custom styling for store locations
  • Zustand for lightweight, performant state management

Backend:

  • Edge runtime API routes for low-latency responses
  • Server-Sent Events (SSE) for real-time negotiation streaming
  • Supabase for user authentication and conversation persistence
  • Row-Level Security policies to protect user data

AI Architecture:

  • Multi-model orchestration using OpenAI API directly and OpenRouter for other models
  • Custom negotiation engine with probabilistic seller behavior (30/30/40 split)
  • Dynamic flexibility system based on seller personality traits
  • Temperature and token limit tuning for fast, focused responses

Key Technical Decisions:

  • 4-round negotiations instead of 6+ for speed
  • Reduced delays between messages (100-200ms)
  • Parallel API calls where possible
  • Client-side state management with server-side persistence

Challenges we ran into

1. Balancing Negotiation Outcomes: Initially, the buyer always won because sellers kept reducing prices. We solved this by:

  • Adding random stubbornness (30% chance sellers hold firm)
  • Implementing variable flexibility levels
  • Occasionally having sellers increase prices in early rounds
  • Creating outcome categories based on budget percentages

2. Real-time Performance: AI API calls were too slow. We optimized by:

  • Reducing negotiation rounds from 6 to 4
  • Lowering temperature (0.5-0.6) for faster responses
  • Adding strict token limits (80-100 tokens)
  • Minimizing artificial delays between messages
  • Sending metric updates immediately without waiting for message generation

3. Type Safety Across Multi-Model System: Different AI providers have different interfaces. We created:

  • Unified type definitions for all agent messages
  • Abstract provider interface with concrete implementations
  • Centralized error handling and fallback responses

4. State Management Complexity: Managing three provider tabs with independent negotiation states was tricky. Zustand's slice pattern helped us organize state logically.

5. Google Maps Integration: Getting custom dark styling to match our UI while maintaining readability required extensive tuning of the map theme.

Accomplishments that we're proud of

1. Realistic Multi-Agent Negotiations: We created a system where neither side always wins. The probabilistic engine produces genuinely varied outcomes—sometimes buyers get great deals, sometimes sellers hold firm. This feels authentic.

2. Sustainability as Priority: Making carbon footprint equal to price and speed in the priority system. Most shopping platforms treat sustainability as an afterthought.

3. Multi-Model Architecture: Successfully orchestrating three different AI models (GPT-4o, Claude 3.5 Sonnet, DeepSeek) in real-time negotiations, each with distinct behaviors.

4. Polished UX: The negotiation animation, real-time message streaming, smooth transitions, and dark-themed interface create an engaging experience.

5. Full-Stack Implementation: From authentication to AI orchestration to real-time updates to data persistence—everything works end-to-end.

6. Performance Optimization: Reducing average negotiation time by 60% through careful tuning while maintaining quality.

What we learned

Technical Learnings:

  • How to orchestrate multiple AI models with different APIs in a single application
  • Server-Sent Events are powerful for real-time streaming without WebSocket complexity
  • Edge runtime significantly improves API response times
  • Zustand's simplicity makes it ideal for complex state management
  • TypeScript's type system prevents entire classes of bugs in multi-agent systems

AI/ML Learnings:

  • Temperature and token limits dramatically affect response speed and quality
  • Different AI models have distinct "personalities" even with identical prompts
  • Probabilistic systems create more realistic behaviors than deterministic ones
  • Lower temperature (0.5-0.6) doesn't sacrifice quality for short responses

Product Learnings:

  • Users care about more than just price—giving them control over priorities is powerful
  • Transparency matters—showing which AI models are negotiating builds trust
  • Real-time feedback keeps users engaged even during longer operations
  • Balanced outcomes create more interesting experiences than one-sided wins

Design Learnings:

  • Dark themes with high contrast work well for data-heavy interfaces
  • Progress indicators reduce perceived wait time
  • Animations should enhance, not distract from, core functionality
  • Clear win/loss explanations make complex systems understandable

What's next for CartAI

Short-term (Next 3 months):

  • Add more stores and product categories beyond fashion
  • Implement group buying (users pool together for collective bargaining power)
  • Create mobile app with push notifications for negotiation results
  • Add A/B testing to optimize negotiation strategies

Medium-term (6-12 months):

  • Partner with real e-commerce platforms for live integration
  • Machine learning layer that learns from successful negotiations
  • Multi-language support for international markets
  • B2B version for enterprise procurement negotiations

Long-term Vision:

  • AI agents that learn your preferences over time
  • Predictive negotiations that run before you even ask
  • Blockchain-based verification of sustainability claims
  • Marketplace where users can train and sell their own negotiation agents
  • Integration with inventory management systems for dynamic pricing

Immediate Next Steps:

  1. Conduct user testing to gather feedback on negotiation dynamics
  2. Expand AI model selection (add Gemini, Mistral, etc.)
  3. Implement analytics dashboard showing negotiation patterns
  4. Build API for third-party integrations
  5. Scale infrastructure to handle concurrent negotiations

CartAI represents a fundamental shift in how we think about online shopping—moving from passive price acceptance to active, AI-powered negotiation that optimizes for what each individual truly values.

Built With

  • claudecode
  • codex
  • figmamcp
  • nextjs
  • openrouter
  • supabase
  • typescript
Share this project:

Updates