from Hacker News

Using GPT3, Supabase and Pinecone to automate a personalized marketing campaign

by vimota on 2/25/23, 6:22 PM with 62 comments

  • by pbourke on 2/25/23, 10:45 PM

    > My script read through each of the products we had responses for, called OpenAI's embedding api and loaded it into Pinecone - with a reference to the Supabase response entry.

    OpenAI and the Pinecone database are not really needed for this task. A simple SBERT encoding of the product texts, followed by storing the vectors in a dense numpy array or faiss index would be more than sufficient. Especially if one is operating in batch mode, the locality and simplicity can’t be beat and you can easily scale to 100k-1M texts in your corpus on commodity hardware/VPS (though NVME disk will see a nice performance gain over regular SSD)

  • by swyx on 2/25/23, 8:04 PM

    > And it pretty much worked! Using prompts to find matches is not really ideal, but we want to use GPT's semantic understanding. That's where Embeddings come in.

    sounds like you ended up not using GPT3 in the end which is probably wise.

    i'm curious if you might see further savings using other cheaper embeddings that are available on huggingface. but its probably not material at this point.

    did you also consider using pgvector instead of pinecone? https://news.ycombinator.com/item?id=34684593 any painpoints with pinecone you can recall?

  • by Hyption on 2/25/23, 8:50 PM

    I don't like the unscientific ad for his gf company.

    'which helped launch the movement of those opposed to endocrine disruptors, was retracted and its author found to have committed scientific misconduct'

  • by jamesblonde on 2/25/23, 10:06 PM

    I have see a lot of people write about how important the interaction between vector DBs and chat-GPT3 (and GPT3) is. I am still not much wiser after this article. Is it that it makes it easier to go from:

    user query -> GPT3 response -> Lookup in VectorDB -> send response based on closest embedding in VectorDB

    ?

  • by mdorazio on 2/25/23, 8:00 PM

    Are you saving the match pairs somewhere? I imagine 1) there are a finite number of them, 2) doing an exact lookup in a DB first will be faster and easier than calling GPT3 and Pinecone every time, and 3) eventually GPT3 APIs will get pricey enough to make you think twice unless you're running your own instance on a cluster.
  • by throwthere on 2/25/23, 11:56 PM

    This looks incredible and magical to me. How do you learn to create things like this as a mostly web programmer? Vectorization, etc I had no idea could integrate with gpt etc but honestly it looks kind of obvious/effortless to the author.
  • by mattfrommars on 2/26/23, 2:38 AM

    Pardon my ignorance here. I started to play around with text generation today and came around plenty of resource but hard to make any sense of it. I had this working https://github.com/oobabooga/text-generation-webui and instead of it being able to answer question, it revolves around the concept of generating text.

    In your case and ChatGPT3, does is it provide output based on the data you feed it? If that is the case, is there anything related to training the model to use your data?

    I am trying to gauge a sense of what is going on.

  • by ipv6ipv4 on 2/26/23, 8:00 AM

    How do you know if the output that was sent to customers (who believe they are getting accurate results from a knowledgable human being, BTW) is correct?
  • by djoldman on 2/26/23, 12:19 AM

    How long did this take?

    Did you consider something like openrefine or fuzzy matching / levenshtein distance?

    Seems like a common data cleaning ask with a small amount of data.

  • by espe on 2/26/23, 7:14 AM

    i fail to see how this data cleaning could not be solved with proper tokenization and some distance measure. the amount of power used for those api calls is slighty obscene.

    edit: don't want to rant. it's not a bad post and i'm sure there is many and far more wasteful examples than this.

  • by 1f60c on 2/26/23, 9:30 AM

    I'm disappointed that the article doesn’t explain what they ended up doing.
  • by EGreg on 2/26/23, 12:57 AM

    Why not just use GPT-3 or even GPT-2 classifier API? No generative AI needed
  • by sexangel on 2/26/23, 12:51 AM

    > 100s of human hours saved

    wait till its thousands, millions, billions . . .

  • by fswd on 2/26/23, 10:54 PM

    What is pinecone and is there a link to a website?
  • by pjakubowski on 2/25/23, 10:32 PM

    Awesome to see the integration between Klaviyo automation and GPT-3 AI and using it to streamline your girlfriends processes. Keep up the fantastic work!
  • by NotYourLawyer on 2/26/23, 1:45 AM

    This is pure spam.
  • by wyem on 2/26/23, 1:04 AM

    Loved reading it. Will feature this in my newsletter on AI Tools and learning resources, AI Brews https://aibrews.com