A smart shopping assistant powered by Google's Gemini LLM that helps users browse products, manage their cart, and complete purchases through natural language interactions.
- Natural language product search: Find products by simply describing what you're looking for
- Contextual understanding: The bot remembers previous interactions and understands references to products
- Shopping cart management: Add, remove, update quantities, and view cart contents with simple commands
- Checkout process: Complete your purchase with a clear cart summary and total
The system consists of three main components:
- Product Catalog API (
products.py): A FastAPI server providing product information - Tools Module (
tools.py): Implements product search and cart management functionality - Chatbot Interface (
bot.py): The Gemini-powered conversational interface
- Python 3.8+
- Google Gemini API key
- Required Python packages (see
requirements.txt)
git clone https://github.com/shelwyn/Sales-Agent.git
cd Sales-Agentpip install -r requirements.txtCreate a .env file in the root directory with the following content:
GOOGLE_API_KEY=your_google_api_key_here
python products.pyThis will start the product catalog API on http://localhost:3000.
In a new terminal window:
python bot.pyHere are some examples of how to interact with the Sales Agent:
- "Do you have any wireless headphones?"
- "Tell me about your phone accessories"
- "Add the noise cancelling headphones to my cart"
- "I'd like to buy 2 smart watches"
- "What's in my cart?"
- "Remove the Bluetooth speaker from my cart"
- "I'd like to check out now"
You can test the Product API using Postman with these sample requests:
- GET
http://localhost:3000/products/search?name=wireless
- GET
http://localhost:3000/products/P002
You can access the interactive API documentation at http://localhost:3000/docs after starting the FastAPI server.
Edit the PRODUCTS list in products.py to add, modify, or remove products.
The modular design allows for easy extensions:
- Add new product fields in the
Productmodel - Create additional shopping tools in
tools.py - Modify the chatbot prompts in
bot.pyto highlight new features
Contributions, issues, and feature requests are welcome! Feel free to check issues page.