user query -> GPT3 response -> Lookup in VectorDB -> send response based on closest embedding in VectorDB
?
user query -> GPT3 response -> Lookup in VectorDB -> send response based on closest embedding in VectorDB
?
The optional step two is used when the lookups are more closely related to an answer's latent space than the original query text. This approach is called HyDE (first published here: https://arxiv.org/abs/2212.10496).
The synthesis is also optional. You can essentially summarize your lookups or refine them or do whatever you want at this stage.
If you skipped steps 2 and 4, it's just a semantic search engine. If you skip step 2, you're either doing it for latency/performance reasons, or because the user query's embeddings are more similar to the docs in the vector db.
Your vector DB has well formed prompts - users write random stuff, map it to the closest well formed prompt?
"My daily face cream is BrandX's low-sheen formulation" -> "BrandX Matte Face Moisturizer"
OP's example is a little different, because he's not even using Gpt3 completions, he's just using their embeddings API to vectorize product names, then when he gets a new product name, he maps it into the space to find the nearest product names.
But then you have the issue of GPT3 token limits, so you're limited in how many of these relevant snippets you can embed into a prompt. Wondering if there's a better way to go about this (for your first example, rather than OPs use case).
I'm sure the techniques will evolve over time, but for now, these sorts of patterns (pre-index, then augmenting the prompt at query-time) seem to work best for feeding information/context into the model that it doesn't know about. The other broad family of techniques is around trying to train the model with your custom information ("fine-tuning", etc), but I think most practitioners will agree that's currently less effective for these sorts of use-cases. (Disclaimer: I'm not an expert by any means, but I've played around with both techniques and try to keep up-to-date on what the experts are saying).
Like asking 'what streaming services am I paying for and how much have I spent on them to date?', and some tool going over your bank statements to pick out spotify, netflix etc. I could see being useful.
https://simonwillison.net/2023/Jan/13/semantic-search-answer...