Find answers from the community

Updated 2 years ago

πŸ‘‹ Looking for guidance on the best

At a glance
πŸ‘‹ Looking for guidance on the best method for structuring data for the index. I have an ecommerce website, that I'm looking to build a bot to answer customer questions about our products. I'd like to index the product information, use instructions, care instructions, customer reviews, and FAQs. What's the best way to ensure all the relevant text data for a given product is indexed together. Additionally, we have size and color variants that I want the output to consider when fed a query that references size or color. thanks!
2
j
K
L
12 comments
hi casey! one thing you could consider is having a list index for every product, and a vector index over products. the vector index will help "route" the query to the right product, and a list index ensures that any query will go through all information in the list index
to start with, before doing this, you may want to just try dumping each product document into one vector index, just to see if that works well or no
How do you define a vector index over multiple list indexes? I thought we had to do it the other way around (define a list index over multiple tree indexes)
@Kaveen there aren't really any rules for which indexes you can combine! (At least as far as I know... maybe a tree index can't be top level, but who knows lol)

In this scenario, the top level vector index would need a summary for each list index.

Then, queries will (hopefully) be matched to the appropriate product
yep! exactly, +1 to @Logan M's answer
Thank you @jerryjliu0 and @Logan M this is really helpful. What info would be contained in the Vector index?
See this example in the docs: https://gpt-index.readthedocs.io/en/latest/how_to/composability.html#defining-summary-text

Basically, for every list index (so for each product), set a doc_id string and a summary. Then, use all the list indexes to construct a vector index
Thank you! Would it make sense to do a tree index over attributes of the product, ex. reviews, care instructions, etc. then a list index with the product info over the tree?
Hmm it could work! I might start with the vector index over the list indexes first (since it's easier/more simple), to get a good baseline, and then see how it performs from there πŸ‘Œ
gotcha, thanks @Logan M
Hi @jerryjliu0 if the index is set up this way i.e. every list index represents a product, will it be able to answer questions like, say "What products do you have in red color?"
My guess is it won't since data is only indexed by the products and not other characteristics of the products.
Add a reply
Sign up and join the conversation on Discord