Think 2021: New tools have the developer ecosystem and IBM building together Learn more

Archived | Create a sports buddy with TJBot and Watson

Archived content

Archive date: 2019-05-21

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.


A TJBot is a robot that can be used to access Watson services in a fun way. In this code pattern, we use a TJBot in conjunction with Watson services, Twilio, and baseball data so you can create your own personal sports buddy that can help you follow your favorite team, get upcoming-game reminders, latest stats, and more.


In this developer code pattern, we will build a TJBot that knows baseball. Using Watson Discovery, TJBot will provide information about your favorite teams, such as their current league standing, upcoming schedule, and links to relevant articles from Watson News. We will add Twilio to show how to send SMS text messages to a user.

When you have completed this pattern, you will understand how to:

  • Build a TJBot that converses using Watson Assistant.
  • Use Watson Text to Speech and Speech to Text services to converse with TJBot.
  • Use Watson Tone Analyzer to determine your sentiment about your favorite teams.
  • Use Watson Discovery to find news articles about your favorite teams.
  • Query third-party data sources to get the latest Major League Baseball (MLB) data from
  • Use Twilio to send SMS text messages with team schedules and news article links.



  1. The user speaks to the TJBot via the USB microphone.
  2. The TJBot invokes the Watson Speech to Text service to translate what the user said.
  3. The TJBot invokes the Watson Assistant service to create a dialog between the user and the TJBot (this is where we ask users about their favorite baseball teams).
  4. The Watson Assistant service invokes the Watson Discovery service to find news about the user’s favorite team.
  5. The Watson Assistant service invokes the Watson Tone Analyzer service to see how the user feels about the team’s prospects for the season.
  6. The Watson Assistant service calls out to to find the team’s upcoming schedule.
  7. Optionally, the Watson Assistant service calls out to Twilio to text the team’s upcoming schedule and latest news headlines to the user.
  8. All responses going back to the user use the Watson Text to Speech service.
  9. The TJBot’s speaker plays the audio back to the user.