Inspiration

More often than not, people are indecisive on choosing a place to go to, and when asking a stranger on the street for places or directions, people end up:

  • forgetting the information quickly
  • not understanding the information at all
  • asking another stranger for more precise instructions
  • searching for the address on their phone
  • and worst, getting lost

What it does

We wanted a reliable source that can recommend places given a location and provide directions in the fastest and easiest way possible, without human (stranger) contact. This can help expose businesses to become more reachable to possible customers.

Loki does exactly that by allowing users to look (search for nearby places by input or category) and locate (display relevant results arranged from nearest to farthest and view directions) on chat. Users can also bookmark their favorite places for recordkeeping.

How we built it

  1. Used our in-house chatbot builder to create the utterances for Facebook Messenger
  2. Used Google Map JavaScript and Geo-coding API for searching and pinning locations in the webview
  3. Used Facebook Places Search API for searching nearby places, then calculated each place's distance to the current pinned location to sort the results from nearest to farthest
  4. Created API using Python Flask framework and Elasticsearch for saving, deleting and getting the list of bookmarked places per user

Challenges we ran into

1.) Facebook Places API has limitations such as:

  • No sorting capability
  • Result has no 'distance' attribute
  • Result per page can be less than the limit set, and has inconsistent count

Solution: We created a wrapper to calculate the distance per location, then sorted the order by distance. We also set a higher limit and paginated each result.

2.) Google Maps was not rendering on the mobile Messenger app

Solution: It turns out that we used a JavaScript syntax that is not supported in some browser versions, but we were able to see the error and solve it using Mozilla Firefox browser.

Accomplishments that we’re proud of

Loki has a very cool personality (▀ ͜͞ʖ▀) Our video also looks well-produced!

In terms of development, we were able to complete the bot using limited resources, minimize costs by using Facebook’s Places API, and embed Google Maps for the map view of the results.

What we learned

We learned about the different types of messages that can be used in Messenger, and we were able to explore some free APIs that Facebook can provide.

What's next for Look & Locate (Loki)

In the next iteration, Loki should be able to:

  • Trigger search using NLP (e.g. typing “Where can I get milk?” returns supermarkets)
  • Search places within a given list (e.g. McDonald’s store locator)
  • Recommend places based on the behavior of the user (e.g. bot returns bakeries because user always searches for bread)
Share this project:

Updates

Submission history