Skip to content

quanghaophan/Assignment_09

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Assignment 09 - Laptop Consultant Chatbot

A conversational AI chatbot that provides personalized laptop recommendations using Azure OpenAI and ChromaDB vector search.

Overview

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

Files

  • Assignment_09.py - Complete Python script implementation
  • Assignment_09.ipynb - Jupyter Notebook with detailed documentation
  • README.md - This file

Requirements

pip install openai chromadb

Configuration

Set your Azure OpenAI credentials in the environment variables:

  • AZURE_OPENAI_EMBEDDING_API_KEY
  • AZURE_OPENAI_EMBEDDING_ENDPOINT
  • AZURE_OPENAI_LLM_API_KEY
  • AZURE_OPENAI_LLM_ENDPOINT

Usage

Python Script

# 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.py

Jupyter Notebook

Open Assignment_09.ipynb in Jupyter Lab/Notebook for step-by-step execution with detailed explanations.

Features

  • 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

Sample Queries

The system automatically processes three test scenarios:

  1. Lightweight business laptop with long battery life
  2. High-performance gaming laptop with best graphics
  3. Budget-friendly laptop for student tasks

Architecture

  1. Embedding Generation: Convert laptop descriptions to vectors
  2. Vector Storage: Store embeddings in ChromaDB collection
  3. Similarity Search: Find relevant laptops based on user query
  4. Context Building: Format retrieved data for LLM
  5. AI Response: Generate personalized recommendations

Author

HaoPQ1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published