A conversational AI chatbot that provides personalized laptop recommendations using Azure OpenAI and ChromaDB vector search.
This project implements a Retrieval-Augmented Generation (RAG) system that:
- Understands user laptop requirements through natural language
- Searches a vector database of laptop specifications
- Provides tailored recommendations using Azure OpenAI's chat completion API
Assignment_09.py- Complete Python script implementationAssignment_09.ipynb- Jupyter Notebook with detailed documentationREADME.md- This file
pip install openai chromadbSet your Azure OpenAI credentials in the environment variables:
AZURE_OPENAI_EMBEDDING_API_KEYAZURE_OPENAI_EMBEDDING_ENDPOINTAZURE_OPENAI_LLM_API_KEYAZURE_OPENAI_LLM_ENDPOINT
# Using virtual environment (recommended)
source .venv/bin/activate
python Assignment_09.py
# Or using full path
"/Users/haopq1/AI Course/Assignment_09/.venv/bin/python" Assignment_09.pyOpen Assignment_09.ipynb in Jupyter Lab/Notebook for step-by-step execution with detailed explanations.
- Vector Search: ChromaDB for semantic similarity matching
- AI Recommendations: Azure OpenAI GPT-4o-mini for personalized suggestions
- Automated Testing: Predefined queries for business, gaming, and student use cases
- Clean Output: Professional console messages without emojis
The system automatically processes three test scenarios:
- Lightweight business laptop with long battery life
- High-performance gaming laptop with best graphics
- Budget-friendly laptop for student tasks
- Embedding Generation: Convert laptop descriptions to vectors
- Vector Storage: Store embeddings in ChromaDB collection
- Similarity Search: Find relevant laptops based on user query
- Context Building: Format retrieved data for LLM
- AI Response: Generate personalized recommendations
HaoPQ1