๐ซ This project is no longer maintained
Cognitive Event Finder is a web-based chatbot for finding events/sessions at conferences. It uses Watson Conversation to manage the chat, Cloudant for retrieving events, and Mapbox for mapping.
We recently feature the Cognitive Event Finder at SXSW. You can see a working version @ https://cognitive-event-finder.mybluemix.net/ where you can search for SXSW events.
The following environment variables are required to run the application:
MAPBOX_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONVERSATION_USERNAME=xxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxxx
CONVERSATION_PASSWORD=xxxxxxxxxxxx
CONVERSATION_WORKSPACE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CLOUDANT_URL=https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-bluemix.cloudant.com
CLOUDANT_DB_NAME=xxxxxxxxxx
We will show you how to configure the necessary services and retrieve these values in the instructions below:
The following prerequisites are required to run the application.
- A Bluemix account.
- A Watson Conversation service provisioned in your Bluemix account.
- A Cloudant service provisioned in your Bluemix account.
- A Mapbox access token.
To run locally you will need Node.js 4.3.2 or greater.
To push your application to Bluemix from your local development environment you will need the Bluemix CLI and Dev Tools.
We'll start by getting your local development environment set up. If you haven't already installed Node.js you can install it by following the instructions here.
From the command-line cd into the cognitive-event-finder directory:
git clone https://github.com/ibm-cds-labs/cognitive-event-finder
cd cognitive-event-finder
Install dependencies:
npm install
Copy the .env.template file included in the project to .env. This file will contain the environment variable definitions:
cp .env.template .env
The application requires that you have a free Mapbox account and API token.
To sign up for a Mapbox account go to https://www.mapbox.com/signup/.
To create an API token go to https://www.mapbox.com/studio/account/tokens/.
Once you have your API token copy it to your .env file:
MAPBOX_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
If you do not already have a Bluemix account click here to sign up.
Login to your Bluemix account.
First, we'll walk you through provisioning a Watson Conversation service in your Bluemix account:
-
From your Bluemix Applications or Services Dashboard click the Create Service button.
-
In the IBM Bluemix Catalog search for Watson Conversation.
-
Select the Conversation service.
-
Click the Create button on the Conversation detail page.
-
On your newly created Conversation service page click the Service Credentials tab.
-
Find your newly created Credentials and click View Credentials
-
Copy the username and password into your .env file:
CONVERSATION_USERNAME=xxxxxxx-xxxx-xxxx-xxxxx-xxxxxxxxxxxxx CONVERSATION_PASSWORD=xxxxxxxxxxxx
Next, let's launch the Watson Conversation tool and import our conversation workspace.
-
Go back to the Manage tab.
-
Click the Launch tool button.
-
Log in to Watson Conversation with your Bluemix credentials if prompted to do so.
-
On the Create workspace page click the Import button.
-
Choose the workspace.json file in the application directory (cognitive-event-finder/workspace.json).
-
Click the Import button.
-
Under Workspaces you should now see the Cognitive Event Finder.
-
Click the menu button (3 vertical dots) and click View Details
-
Copy the Workspace ID and paste it into your .env file:
CONVERSATION_WORKSPACE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
We're almost there! Next, we'll provision an instance of Cloudant in our Bluemix account. After this step we will be able to run our bot locally.
-
From your Bluemix Applications or Services Dashboard click the Create Service button.
-
In the IBM Bluemix Catalog search for Cloudant.
-
Select the Cloudant NoSQL DB service.
-
Click the Create button on the Cloudant detail page.
-
On your newly created Cloudant service page click the Service Credentials tab.
-
Find your newly created Credentials and click View Credentials
-
Copy the username, password, and the url into your .env file:
CLOUDANT_USERNAME=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-bluemix CLOUDANT_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CLOUDANT_URL=https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-bluemix.cloudant.com
Next, create the following databases in Cloudant:
sxswsessions
sxswusers
sxswlogs
Note: You can specify alternative names for these databases. If you do so be sure to update your .env file.
Finally, we need to populate our sxswsessions
database. We've made the list of SXSW events available @ https://opendata.cloudant.com/sxswsessions.
You can use the replication feature in Cloudant to copy these events into your Cloudant database.
-
In Cloudant select Replication.
-
Click the New Replication button:
-
Configure the replication task as follows:
We're now ready to test our bot. From the command-line run the following command:
npm start
If all is well you should see output similar to the following:
Getting event database...
Server starting on http://localhost:6018
Getting user database...
Getting dialog database...
To interact with the bot go to the URL printed in the log. Here's a sample conversation:
Licensed under the Apache License, Version 2.0.