Inspiration

Our software engineering team had a lot of random interrupts. These interrupts caused context switching and stress. We decided to implement 'office hours' to control the interrupt problem. It became apparent that an office hours bot would be a great tool to help us organize and manage our team's office hours!

What it does

Present abilities

Oh-bot is able to...

  1. Set your team's office hours. Just ask to set your team's office hours and it will help out.
  2. Retrieve office hours for a known team (Controlled by the Lex slot SetTeam)
  3. Add discussion topic for a team's office hours for a given day
  4. Lookup office hour discussion topics for a given day

Technology stack

AWS Lex Bot + Slack

Serverless.com framework driven setup

Python 3.6 AWS Lambda Functions

Dynamodb backend

Lex configuration overview

Intents

  • AddDiscusionTopicOfficeHours
  • GetTeamsOfficeHours
  • LookupDiscussionTopics
  • SetTodaysOfficeHours

Slots

  • GetDiscussionTopic
  • SetTeam
  • OfficeHoursLocation

Dynamodb tables

  • oh-bot-{environment}
  • oh-bot-{environment}-topics

How I built it

Our company uses Slack so I started with creating a Slack app/bot and then connected it to our Amazon Lex bot. Basically, started with 1 intent at a time.

Challenges I ran into

We found it hard to collaborate on the Lex configurations since most of it is done via the web interface. Importing and exporting Lex configurations is limited to JSON and AWS API//cli. It would be great to see it support Yaml . Also keeping track of what has changed between the different 'intent' and 'slot' versions can cause confusion. One huge problem was how to get more event data from Slack into Lex (Like which Slack user is interacting with the bot).

Lastly, we found the error messaging for Lex could be misleading or non-informative.

Accomplishments that I'm proud of

Implemented with clean and simple Lambda functions and Dynamodb. Totally serverless :)

What I learned

I learned a lot about Lex and a few new things about Slack! Also, this was the first time I implemented an application that used Dynamodb.

What's next for oh-bot

I would like to add some reporting outputs to help teams better understand what types of questions they are getting at office hours so they can adjust to meet the needs of those they support.

Implement Lex build scripts with https://docs.aws.amazon.com/lex/latest/dg/gs-cli-create.html or something similar. To work alongside serverless.yml configuration.

How to test (for judges)

for judges - I invited @devpost to our slack team. Please go to #ohbot chat room and do the following...

  1. Set office hours for "Data Platform" (or any team available in the card if you want) example utterance: "set office hours please" -- follow along with oh-bot from there

  2. View a team's office hours example utterance: "Look up team office hours"

  3. Submit a topic for discussion to a team's office hours example utterance: "Submit a discussion topic"

  4. Look up discussion topics for a given team (will ask you what day to look up, match up perhaps with the day you used for the submission you did in step 3) example utterance: "Show discussion topics for data platform"

That's it!

Share this project:

Updates

posted an update

https://github.com/silvermullet/oh-bot/pull/7

Overhauled to allow use of the python slackclient package. Leveraging this serverless plugin to make this work

https://www.npmjs.com/package/serverless-package-python-functions

Reworked serverless.yml and function layout to work with this

Added new "submitted by" section based upon Slack userId passed to lex.

screen shot 2017-07-17 at 7 33 45 pm

Updated Dynamodb to include a 'user' to data object

Log in or sign up for Devpost to join the conversation.

posted an update

I added the Lex bot configurations via AWS cli requests.

https://github.com/silvermullet/oh-bot/tree/master/lex

This includes the Slack Channel configuration with the webhook URLs removed. Also, the lambda functions have my account number removed. If you use the serverless deploy with the included Serverless.yml included in the code base you will be able to get the Dynamodb and Lambda functions in place. Then import the Lex configurations.

Log in or sign up for Devpost to join the conversation.