Hi Murali,
Welcome to the community and thanks for sharing your project.
If I understand your objective clearly, you are looking for a solution to take a question from a user and recommend one a location and provide other artifacts such as a map and nearby interests.
It also seems like you have a database of places with GeoLocation and other text information about these places. If that is the case I think this is what you will need…
Validate the Question
The first thing we need to do is to understand the question from the user and find out if the question is related a location search. You can do this by taking the question of the user and ask the model the following…
Prompt: User is asking “What is a good hiking trail in the north part of Bangalore”. Is the user looking for a hiking trail. Reply only YES or NO.
YES
Most likely the model will reply either YES or NO if you use this prompt and give it only a max length under 3. If the answer is Yes, then you can continue, else you can ask the user to provide a question for hiking trail only and provide an example on how to ask the question.
Parse the Location
Once you have validated the question, you will need to parse the location of the user is looking for and you can do that by asking the model this question.
Prompt: User is asking “What is a good hiking trail in the north part of Bangalore”. Provide the geo location the user is looking to go in with latitude and longitude in JSON format only
{ “latitude”: -34.397, “longitude”: 150.644 }
Most likely you will get back an answer with the geo location with latitude or longitude only
Parse the activity
Once you have parsed the geolocation, you will want to find out what type of activities the user is interested in, I am assuming you are looking to serve users with other interest more than just hiking.
Prompt: User is asking “What is a good hiking trail in the north part of Bangalore”. Provide category of activity in one word
Hiking
Search With GeoLocation
Now that you have the geo location of the user, you can do a geo search in you Database to find all the locations within a certain distance
Filter the Results With Semantic Search
Just because you have all the locations nearby, it doesn’t mean you have the places of interests.
To find the place of interest you can take the response from the model, and include the nearby locations that are similar to Hiking
search_embedding = encode_embedding("Hiking")
place_embeddings = encode_embedding(nearby_location_descriptions)
best_nearby_places = semantic_search([search_embedding], place_embeddings)
It will come down to three lines of code with custom functions that you can build using OpenAI API, or using this spreadsheet.
Let me know if you have any questions and feel free to PM directly or at connect with me at https://www.linkedin.com/in/nelsonchu247
Depending on which model you are using, some of the prompts might need to be modify, but I have tested using our own model and it seems to be fine.