Generative AI Course Project
VIZY — K-Beauty AI Agent
A RAG-based AI agent that combines a user's beauty profile, product data, and conversation to recommend K-beauty products and explain each pick.
Overview
Online beauty recommendations often miss. A shade looks different under each light, camera, and filter, and HEX codes or star ratings say little about whether a product actually suits the person buying it.
VIZY, a three-person project for a generative AI course, tackles this with three features: Find the Look matches the makeup colors in a photo to real products, Find the Match finds alternatives to a product you already use, and an AI beauty assistant answers in conversation using your profile, past feedback, product data, and web search.
My focus was the layer that turns a color match into a personal recommendation. A color-based Top-3 is accurate, but it cannot handle requests like “a bit more matte, with a cooler summer feel.” I built the recommender and then a RAG agent that understands what the user is asking for, searches products by meaning, re-ranks them against the user's preferences, and explains each pick.


Key contributions
- LLM-powered Top-3 recommendation Built a Top-3 recommender that writes a reason for each pick, first on LLaMA 3 and then on the OpenAI API, with JSON-only output and prompt rules that keep results consistent.
- RAG agent workflow Classified each message as recommend, explain, or trend, parsed free-form feedback into structured preferences (tone, finish, brightness, saturation, liked and disliked keywords), and routed it to the right pipeline.
- Semantic search and personalized re-ranking Stored product descriptions and each user's conversation history as OpenAI embeddings in PostgreSQL + pgvector, retrieved the top 20 candidates, and re-ranked them by vector similarity (1.0), current preferences (0.7), and saved profile (0.3) to pick the final three.
- Synthetic data enrichment Generated product reviews and personal-color data with generative AI, giving the knowledge base unstructured text for semantic search beyond product specs.
- Conversational features and UI Added per-user conversation memory and DuckDuckGo search for trend questions, and built the chatbot and recommendation-result screens in React.
Challenges and how I solved them
- LLaMA 3 output was unstable. Parsing and explanations from LLaMA 3 often broke format or drifted. I moved these steps to the OpenAI API, required JSON-only output, and added a fallback that recovers the JSON block or fills in a safe default, so one bad response never breaks the screen.
- Color matching could not follow subjective requests. The Top-3 was accurate in color, but requests like “more matte, cooler” were out of its reach. I added the RAG agent on top: parse the request into structured preferences, search products by meaning, then re-rank against those preferences.
- The model invented products and features. Early answers mentioned products outside the database or claimed attributes we never provided. Prompts now allow only products in the candidate list and only the given attributes. When nothing matches exactly, the agent recommends the closest option and explains the trade-off instead of refusing — for example, a semi-matte for someone who asked for matte.
- Long-term profile and current request pulled in different directions. A user's saved profile could override what they had just asked for. I weighted the score so that the current conversation outranks the stored profile, and the stored profile only nudges the ranking.
- The database could not answer trend questions. Questions like “what are this year's lip trends?” have no answer in a static product DB. The trend intent now skips retrieval, pulls the top three DuckDuckGo results, and summarizes them for the user's tone.