A complete smart shopping application powered by AI agents and Memori for persistent memory.
Try it now: https://smart-shopping-ai-agent.lovable.app/
- Memory-Enhanced Shopping: Remembers customer preferences and shopping history using Memori
- Multiple AI Backend Options:
- DigitalOcean Gradient AI Platform: Powered by DigitalOcean's Gradient AI Platform for intelligent responses
- Swarms Multi-Agent System: Enhanced intelligence with specialized shopping assistant agents
- Modern Web Interface: Beautiful React/Vite frontend with Tailwind CSS and shadcn/ui components
- Real-time Chat: Interactive chatbot with typing indicators and message history
- Product Catalog: Browse and search products with advanced filters
- RESTful API: FastAPI backend with comprehensive endpoints
- Persistent Memory: Customer interactions stored and recalled across sessions
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ │ │ │ │ │
│ React/Vite │ │ FastAPI │ │ DigitalOcean │
│ Frontend │◄───┤ Backend │◄───┤ Gradient AI │
│ │ │ │ │ Platform │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
│
▼
┌─────────────────────┐
│ │
│ Memori Memory │
│ System (SQLite) │
│ │
└─────────────────────┘
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ │ │ │ │ │
│ React/Vite │ │ FastAPI │ │ Swarms Multi- │
│ Frontend │◄───┤ Backend │◄───┤ Agent System │
│ │ │ │ │ (OpenAI GPT-4) │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
│
▼
┌─────────────────────┐
│ │
│ Memori Memory │
│ System (SQLite) │
│ │
└─────────────────────┘
smart-shopping-assistant/
├── backend/
│ ├── with-digital-ocean-agent/
│ │ ├── main.py # FastAPI app with DigitalOcean AI
│ │ ├── requirements.txt # Dependencies for DigitalOcean version
│ │ └── smart_shopping_digitalocean.db # SQLite memory database
│ ├── with-swarms-agent/
│ │ ├── main.py # FastAPI app with Swarms multi-agents
│ │ ├── requirements.txt # Dependencies for Swarms version
│ │ └── smart_shopping_swarms.db # SQLite memory database
│ └── .env.example # Environment configuration template
├── frontend/
│ ├── src/
│ │ ├── app/
│ │ │ └── page.tsx # Main page component
│ │ ├── components/
│ │ │ ├── Chatbot.tsx # Chat interface
│ │ │ ├── ChatWidget.tsx # Floating chat widget
│ │ │ ├── Navigation.tsx # App navigation
│ │ │ ├── ProductCard.tsx # Product display card
│ │ │ ├── ProductGrid.tsx # Product grid layout
│ │ │ └── ui/ # shadcn/ui components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/
│ │ │ ├── api.ts # API service layer
│ │ │ └── utils.ts # Utility functions
│ │ └── pages/
│ │ ├── Index.tsx # Home page
│ │ ├── Products.tsx # Product catalog page
│ │ └── NotFound.tsx # 404 page
│ ├── package.json # Node.js dependencies
│ ├── vite.config.ts # Vite configuration
│ └── tailwind.config.ts # Tailwind CSS config
└── README.md # This file
- Python 3.8+
- Node.js 18+
- API credentials for your chosen backend:
- DigitalOcean: DigitalOcean Gradient AI Platform account with API credentials
- Swarms: OpenAI API key
Choose one of the two backend options:
cd backend/with-digital-ocean-agent
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp ../env.example .env
# Edit .env with your DigitalOcean AI credentials:
# agent_endpoint=your-digitalocean-agent-endpoint
# agent_access_key=your-digitalocean-agent-access-key
# OPENAI_API_KEY=your-openai-api-key # For Memori memory system
# Start the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
cd backend/with-swarms-agent
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp ../env.example .env
# Edit .env with your OpenAI API key:
# OPENAI_API_KEY=your-openai-api-key
# Start the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000
cd frontend
# Install dependencies
npm install
# Start the development server
npm run dev
- Frontend: http://localhost:8080
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Create a DigitalOcean Gradient AI Platform account
- Get your agent endpoint and access key
- Set the environment variables in
backend/with-digital-ocean-agent/.env
:
OPENAI_API_KEY=your_openai_api_key_here # For Memori memory system
agent_endpoint=https://your-agent-endpoint.digitalocean.com
agent_access_key=your-agent-access-key
- Create an OpenAI account and get your API key
- Set the environment variables in
backend/with-swarms-agent/.env
:
OPENAI_API_KEY=your_openai_api_key_here
The Memori system automatically creates a SQLite database to store conversation history and customer preferences. Each backend option uses its own database:
- DigitalOcean:
smart_shopping_digitalocean.db
- Swarms:
smart_shopping_swarms.db
No additional setup required.
POST /chat
- Send message to AI assistant
GET /products
- Get all productsPOST /products/search
- Search products with filtersGET /products/{id}
- Get specific productGET /categories
- Get product categories
GET /memory/search
- Search customer memory (admin)
- React 18 with TypeScript for type safety
- Vite for fast development and optimized builds
- Tailwind CSS for utility-first styling
- shadcn/ui components for consistent design
- React Query for efficient data fetching and caching
- React Router for client-side navigation
- Real-time messaging with the AI assistant
- Floating chat widget accessible from any page
- Message history with timestamps and typing indicators
- Loading states and comprehensive error handling
- Responsive design optimized for all devices
- Modern grid layout with product cards
- Advanced search functionality with multiple filters
- Category-based filtering and sorting
- Product images, ratings, and detailed descriptions
- Responsive product cards with hover effects
- Customer preferences remembered across sessions
- Personalized product recommendations based on history
- Intelligent conversation context and follow-up responses
- Customer Interaction: User chats with the AI assistant about shopping needs
- Memory Search: Memori searches previous interactions for customer context
- AI Processing: DigitalOcean AI generates personalized responses using customer history
- Memory Storage: Conversation automatically stored in Memori for future reference
- Product Recommendations: AI suggests relevant products from catalog based on preferences
- Customer Interaction: User engages with specialized shopping assistant agents
- Multi-Agent Coordination: Swarms orchestrates multiple AI agents for enhanced intelligence
- Memory Integration: Memori provides persistent memory across agent interactions
- Intelligent Processing: Agents collaborate to understand customer needs and preferences
- Personalized Recommendations: Advanced multi-agent system provides sophisticated product suggestions
- Backend: Add new endpoints in
main.py
- Frontend: Create new components in
src/components/
- API Integration: Update
src/lib/api.ts
Edit the PRODUCT_CATALOG
in backend/main.py
to add your own products with:
- Product information
- Images
- Categories
- Descriptions
- Service not initialized:
- For DigitalOcean: Check credentials in
with-digital-ocean-agent/.env
- For Swarms: Check OpenAI API key in
with-swarms-agent/.env
- For DigitalOcean: Check credentials in
- Memory errors: Ensure SQLite database is writable in backend directory
- CORS errors: Verify frontend URL in CORS middleware configuration
- Import errors: Ensure all dependencies are installed with
pip install -r requirements.txt
- API connection failed: Verify backend is running on port 8000
- Build errors: Check Vite/React and TypeScript configuration
- Styling issues: Ensure Tailwind CSS and shadcn/ui are properly configured
- Component errors: Verify all shadcn/ui components are properly installed
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues related to:
- Memori: Check the main Memori documentation
- DigitalOcean AI: Consult DigitalOcean AI platform docs
- Swarms: Check the Swarms documentation
- This Demo: Create an issue in the repository
Smart Shopping with AI Memory - Making every shopping experience personal! 🛍️🤖
Choose your AI backend: DigitalOcean for cloud-hosted AI or Swarms for advanced multi-agent intelligence!