In my shop-mini app I am collecting some user profile data (like favourite brands, etc) that I want to share with OpenAI’s model as a prompt and ask it to suggest me products using the useProductSearch.
Right now I am using the useProductSearch directly inside my shop-mini to get the top 10 results, but is it possible to use Supabase to connect to OpenAI and send the user’s data as a prompt to suggest more relevant products?
Hey @Quique-Shopify actually the idea is to just provide a basic prompt to OpenAI like “My wife loves pink sneakers, and her favourite brand is Nike, I’m looking to buy something in the range of $50-$100“, and then have the AI model search through Shopify’s catalog and give the relevant results back to the shop-mini where we can display it. How can I achieve this?
I tried using the useProductSearch hook directly inside my shop-mini (no backend required) but that alone does not give me most relevant results, plus I think it would not work with "natural language” queries.
@Quique-Shopify I researched about Shopify MCP but it only lets us access products for a selected store. I wonder how for example “pair with” is able to search the whole catalogue in Shopify as MCP is per store? Do you have any idea? We are now thinking off using AI to get specific keywords out of the input fields and then using the native useProductSearch hook in mini search the keywords. Would that be a robust way you think?
Hi @Quique-Shopify I have had similar experience, do you suggest we only use the useProductSearch hook without any filters and then use our backend AI to organize/filter the results based on the search query? because when i do use the filters i do not get the correct results. Also, i am getting some product currency in pounds and rest in dollars.
Hi @Quique-Shopify can you suggest to us how we should handle the category for useProductSearch param?
Should we just put all prompts to query, or can we still add categories to filters with this format [“gid://shopify/TaxonomyCategory/el”]. I am concern about the accuracy of the result.
No, I think the more filters you add, the more accurate the response will be. Also, take into account that search results may vary per user, and especially per user’s country.
What I suggested was to use OpenAI (or any other LLM) to convert from a natural language query to what our hook expects, that it’s a set of keywords.