Want your robot to search catalog for you?


Recently, I developed a new cool testing function for Dewey, the humanoid robot at Palo Alto City Library. Now, the robot can become an interface for you to search a Sandbox catalog.

Here is a sneak peak of how it works currently:

The library uses the Sierra ILS, and Sierra comes in with an easy API to use. My original thought on this was, wouldn't it be cool if I can connect Dewey to that Sierra API.

To start with, I requested a new Sierra Sandbox API, and then write up a python script to get the access token to the API everytime. Using the Sandbox will ensure the robot won't cause any real damage to the real catalog itself, and it won't change any data on the Sierra end. The request part of code looks similar to the following , and you will need the base64 python library to automatically generate the auth_token

res = requests.post(
headers = {'Authorization': 'Basic %s' % auth_token},
params = {
'grant_type': 'client_credentials'

Next, I read the Sierra sandbox documentation, and decided that I only need the keyword search API /v5/bibs/search for now, so I developed a wrap up function to use that specific API to get resutls. Here the python request code part looks similar to the following, and you can specify the params according to the Sierrap API Documentation.

res = requests.get(
headers = {'Authorization': 'Bearer %s' % self.token},
params = params,

Since Dewey does not have tablet on its chest to show the result, I pretty much parsed whatever returned from the Sierra API to a paragraph of text.

On Dewey's end, I was using its Speech Recognition functions to enable it to listen to human sounds in my master application. To integrate this new function, I ask Dewey to listen to keywords "search the catalog". Once Dewey hears this, it should switch topic at the back end to accept a catalog search query. Dewey will ask you to enter the query in a input box on a computer connected to it if the search query contains words it does not understand. (That's true in most cases, since I try not to dump a huge vocabulary on the robot to further degrade its already shaking Speech Recognition abilities.) But you can also speak to Dewey if you are confident Dewey knows the words you are saying.

In the Youtube video, I asked Dewey to search for the query "Robot". So dewey listened to the word, converted the sound wave to text, then connected to Sierra API, and got the returned text. Then he said:

found 1041 results that are available.  for example, introduction to mobile robot control electronic resource., by tzafestas s g 1939.robot rampage., by webster christy.robot and frank videorecording.basic robot building with lego mindstorms nxt 2 0 electronic resource., by baichtal john.

Now you can compare this result with the Sierra Sandbox web search result. They matches perfectly.

I am pretty excited that Dewey is now connected with Sierra Sandbox API successfully. I will probably be able to develop more advanced functions with this.

Next time, I will write about how to make NAO robot provide book recommendations, give information like the current library events, and even how to turn NAO robot into a Tweet bot. Stay tuned!

Currently unrated