Azure-Samples / rag-postgres-openai-python

A RAG app to ask questions about rows in a database table. Deployable on Azure Container Apps with PostgreSQL Flexible Server.
MIT License
235 stars 85 forks source link

geospatial use case #121

Open flutter-painter opened 4 hours ago

flutter-painter commented 4 hours ago

Hi @pamelafox, Congratulations for providing such a clear and comprehensive demo with a common use case.

Yet in this common retail scenario, I see little added value over a classic ecommerce search view. The keywords 'climbing' and 'gear' would match just the same with full text search over title/description. The price range could be typed by user using one text field max price : 30 While the conversational UI gives this "communication feeling", it is not handy to display dozens of matching products.

I wonder if other use cases would illustrate the unique querying capabilities of OpenAI. Do you think it could handle geocoordinates, or even postgis ? This would really change the experience

pamelafox commented 4 hours ago

I think that'd be quite doable! If I was going to add that, I would start with a table with lat/lng coordinates. Then when the user asked the question, I'd use the query rewriting step to pull out an address/location string. Then I'd send it to the Bing geocoding API, and use it with the PostGIS operators along with the vector/text search.

I don't know when I'd have time to try it out, but it sounds pretty compelling and doable.

Is that what you were thinking?