The Voice Grocery Assistant is an innovative demo application that showcases the power of voice-controlled e-commerce. It allows users to shop for groceries using natural language voice commands, providing a hands-free and intuitive shopping experience.
This demo application was created to explore and demonstrate the potential of combining voice recognition technology with e-commerce functionality. The main goals are:
- To provide a seamless voice-controlled shopping experience
- To showcase how AI can understand and process natural language in a shopping context
- To demonstrate real-time voice-to-text and text-to-voice capabilities
- To explore the integration of voice commands with typical e-commerce actions like searching for products, adding items to a cart, and placing orders
- Frontend Framework: Next.js (React)
- Styling: Tailwind CSS with shadcn/ui components
- Voice Processing: WebRTC for real-time audio streaming
- AI Integration: OpenAI API for natural language processing
- Database: MongoDB for product and order storage
- Search : The Application uses MongoDB Hybrid search solution.
- API Routes: Next.js API routes for backend functionality
- State Management: React hooks (useState, useEffect, useCallback)
- Authentication: (Not implemented in this demo, but could be added using NextAuth.js)
To set up MongoDB Atlas for this project:
- Visit MongoDB Atlas and create an account
- Create a new project
- Build a database (use 7.0+):
- Choose the FREE tier
- Select your preferred provider and region
- Pick a cluster name
- Click "Create"
- Configure security:
- Create a database user with read/write permissions
- Add your IP address to the network access list
- Get your connection string from the "Connect" button
- Select "Drivers"
- Copy the connection string
- Replace
<password>
with your database user's password
Before running the application, create a .env file in the project root with the following variables. Set MONGODB_URI to your MongoDB connection string (for example, mongodb+srv://username:[email protected]), and set OPENAI_API_KEY to your OpenAI API key:
MONGODB_URI=your_mongodb_connection_string
OPENAI_API_KEY=your_openai_api_key
To get started with the Voice Grocery Assistant:
- Clone the repository:
git clone https://github.com/mongodb-developer/GenAI-Showcase cd GenAI-Showcase/apps/RT-voice-ts-store-agent
- Install the dependencies:
npm install
- Run the following script to seed the database with products and its vectorized embeddings for semantic search/full text search.
npm run seed
- Build and run the application:
npm run dev
- Ensure your microphone is enabled and configured.
- Launch the application and follow the on-screen instructions.
- Use voice commands to search for products, add items to your cart, and complete your purchase.
Contributions are welcome. Please open issues or submit pull requests to suggest improvements or add new features.
This project is licensed under the MIT License. See the LICENSE file for more details.