Skip to content
Build Your First Chatbot
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
images updated arch from slides Oct 16, 2017
starwars-chatbot formatting JSON Oct 2, 2017
.gitignore adding .DS_Store Sep 8, 2017
LICENSE Initial commit Jun 15, 2017
readme.adoc cleaning up text Sep 29, 2017
slides.key adding one slide with complete architecture, no animation Oct 16, 2017
slides.pdf adding one slide with complete architecture, no animation Oct 16, 2017


Build Your Own Chatbot using Java

This repository explains how to create a Star Wars chatbot using Amazon Lex and Java.


The users can interact with this chatbot using the following means:

  1. Voice (Alexa, Phone/Call)

  2. Text (Phone/SMS, Facebook Messenger, Slack)

Here are the key components of architecture:


Deploy Lex bot and Alexa backend function using Java

You need to install dependency as explained at before building this project.

mvn -f starwars-chatbot/pom.xml clean package install

ARN for Alexa function: aws lambda get-function --function-name StarWarsChatbot --region us-east-1 | jq .Configuration.FunctionArn

Getting Started with Alexa skill using Java is explained at

JSON Document

Data is loaded as JSON documents in DynamoDB. Here is a sample JSON document:

  "dead": true,
  "force-sensitive": true,
  "force-side": "light",
  "id": 1,
  "lightsaber": "green",
  "planet": "Dagobah",
  "quotes": [
    "When nine hundred years old you reach, look as good you will not.",
    "Truly wonderful, the mind of a child is",
    "A Jedi uses the Force for knowledge and defense, never for attack",
    "That is why you fail.",
    "Adventure. Excitement. A Jedi craves not these things.",
    "Judge me by my size, do you?",
    "Fear is the path to the dark side",
    "Wars not make one great",
    "Do, or do not. There is no try",
    "Size matters not",
    "The dark side clouds everything",
    "Impossible to see the future is",
    "Clear your mind must be",
    "Much to learn you still have ... my old padawan"
  "weapon": "lightsaber",
  "whoami": "Yoda"

Create Global Secondary Index on whoami

Different platforms


  1. Send a message to 408-913-9827 as shown below:



  1. Test using or Alexa





Logging using Amazon CloudWatch

Monitoring using AWS X-Ray


How to talk to the chatbot?

Use phrase Ask Star Wars for Alexa, otherwise just the text as is. The list of questions is at

You can’t perform that action at this time.