An AI-powered personal shopping assistant that helps customers find the perfect products using voice interactions and an interactive avatar. Built with LiveKit agents and powered by Google's Gemini LLM.
- Intelligent Search: Uses fuzzy matching with difflib to find products based on keywords, descriptions, categories, and brands
- Category Browsing: Browse products by specific categories (beauty, electronics, clothing, etc.)
- Price Range Filtering: Find products within specific budget constraints
- Top Discounts: Discover the best deals and highest discount percentages
- Visual Product Display: Show detailed product cards with images, prices, ratings, and descriptions
- Discount Highlighting: Clearly display original prices, discounted prices, and savings
- Stock Information: Real-time stock availability and shipping details
- Swipeable Product Discovery: Fun, Tinder-like interface for product discovery
- Personalized Recommendations: Learn user preferences through their likes/dislikes
- Discount Rewards: Users get 5% discount when they like 3+ products
- Preference Learning: Build user preference profiles based on selections
- Tavus Avatar: Interactive AI avatar for natural conversations
- Voice Interactions: Full voice-based shopping experience
- Real-time Communication: WebRTC for seamless audio/video communication
The system includes a comprehensive product database with:
- 11,000+ Products across multiple categories
- Categories: Beauty, Electronics, Clothing, Home & Garden, Groceries, and more
- Rich Product Data: Titles, descriptions, prices, ratings, reviews, stock levels
- Brand Information: Products from various popular brands
- Discount Information: Real-time pricing and discount percentages
- search_products: Find products using keywords and fuzzy matching
- get_top_discounts: Show products with highest discount percentages
- get_products_by_category: Browse specific product categories
- get_products_in_price_range: Filter products by budget
- create_product_card: Display detailed product information
- create_product_selection_quiz: Create interactive product discovery experience
-
Clone the repository
git clone <repository-url> cd tavus
-
Install dependencies
pip install -r requirements.txt
-
Environment Variables Create a
.envfile in the parent directory with:LIVEKIT_URL=your_livekit_url LIVEKIT_API_KEY=your_livekit_api_key LIVEKIT_API_SECRET=your_livekit_secret GOOGLE_API_KEY=your_gemini_api_key ELEVENLABS_API_KEY=your_elevenlabs_key ELEVEN_API_KEY=your_api_key TAVUS_API_KEY=your_tavus_api_key
-
Product Data Ensure
products.jsonis in the root directory (already included) -
Run the application
python tavus.py download-files python tavus.py dev
- PersonalShopperAgent: Main AI agent with Gemini LLM integration
- Product Loading: Loads and indexes products from JSON database
- Search Engine: Implements fuzzy search using Python's difflib
- User Preference Tracking: Builds user profiles based on interactions
The agent communicates with frontend clients via RPC methods:
client.productcard: Send product card data to displayclient.productquiz: Send product selection quiz dataagent.productCardAction: Handle product card interactionsagent.submitProductQuiz: Process product quiz submissions
- Conversational AI: Natural language understanding for shopping queries
- Product Recommendations: Context-aware product suggestions
- Deal Highlighting: Enthusiastic communication about discounts and savings
- Interactive Guidance: Helps users navigate product choices
- "Show me the best discounts available"
- "I'm looking for beauty products under $20"
- "Find me some electronics"
- "Create a product quiz for clothing items"
- "What laptops do you have in stock?"
- User expresses interest in a product category
- Assistant searches and presents options
- User can request product cards for detailed information
- Assistant can create product selection quiz for discovery
- Users earn discounts by engaging with the selection process
- LiveKit Agents: Real-time voice agent framework
- Google Gemini: Advanced language model for natural conversations
- Tavus: AI avatar platform for visual representation
- ElevenLabs: High-quality text-to-speech
- Deepgram: Speech-to-text recognition
- Python: Core application language
- difflib: Fuzzy string matching for search
- WebRTC: Real-time communication protocol
Update the products.json file with new product data following the existing schema:
{
"id": 1,
"title": "Product Name",
"description": "Product description",
"category": "category-name",
"price": 99.99,
"discountPercentage": 10.5,
"rating": 4.5,
"stock": 100,
"brand": "Brand Name",
"tags": ["tag1", "tag2"],
"thumbnail": "image-url"
}Update the system instructions in PersonalShopperAgent.__init__() to change:
- Conversation style and personality
- Product recommendation strategies
- Discount and promotion emphasis
- User interaction patterns
The system is designed to work with various frontend frameworks. Implement the RPC methods:
- Handle
client.productcardto display product information - Handle
client.productquizto show product selection interface - Send
agent.productCardActionfor user interactions - Send
agent.submitProductQuizwith user selections
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.