Skip to content

benthecoder/shopai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Profile with LLMs

Goal: The goal of this project is to extract valuable insights about a shopper based on chat history

Stack:

  • Weaviate VectorDB
  • OpenAI gpt-3.5-turbo-16k-0613 function calling
  • Streamlit

User attributes

The insights could be the following attributes:

  1. Demographics: Age, gender, and occupation provide insights into users' backgrounds.
  2. Location: Local references and city mentions help determine users' geographic preferences.
  3. Sustainability Preference: Users' concerns about the environment and sustainability indicate their preference for eco-friendly products.
  4. Luxury vs. Value: Brand preferences and price sensitivity hint at users' preference for luxury or value-based shopping.
  5. Shopping Behavior: Insights into users' impulse vs. planned purchases and product discovery habits.
  6. Influence Sources: The influencers, blogs, or social media platforms users follow for shopping advice.
  7. Seasonal Shopping Habits: How users adapt their shopping behavior during different seasons and holidays.
  8. Payment Preferences: Insights into users' preferred payment methods and digital wallets.
  9. Product Lifecycles: Expectations regarding product durability and lifespan.

Look at this notebook for example responses

Project Flow

  1. Users engage in chat sessions with a bot.
  2. Initial session retrieves user context and attributes.
  3. Conversations occur over multiple sessions using GPT models.
  4. All chat data is collected, including user input and bot responses.
  5. Chat data is processed with GPT models to generate insights-rich text.
  6. Insights related to demographics, location, and preferences are extracted.
  7. Extracted insights are stored in Weaviate, associated with the user's ID, creating a structured knowledge graph.

This project facilitates understanding and utilizing valuable shopper information from chat interactions on the e-commerce platform.

Setup

create env with conda

conda create -n shopai python=3.8

activate env

conda activate shopai

install requirements

pip install -r requirements.txt

Run

streamlit run src/main.py

TODO

  • Weaviate intergration
    • create class and object of a user
    • Get properties of the object
    • Add properties of the object
  • LLM
    • Find out best way to add context to create completion (system or assistant message)
    • Given conversation history, and current properties, write function that extracts insights, outcome is update property or create new one
  • chat
    • on each new conversation, read in context about user
    • on each session end, load in property to db
  • improve prompt
    • have it create new property
    • have it create properties that are related to user.

References

Weaviate

OpenAI

  • return multiple objects in function calling forum

Git

  • do git rm -r --cached . to gitignore commited file