This project describes how to integrate Coveo within Slack to create a search (chat) bot.
It uses multiple components:
- Coveo platform - hosts the index and organization for your data, provides the search capabilities.
- Heroku - hosts the webhook API.ai will send the intents to and queries Coveo.
- Slack - the application users will use to interact with Coveo. It will be like doing a conversation with a user in Slack.
- API.ai - Process the queries from Slack and translate them to Intents.
In Slack, users send queries to user @coveo
like @coveo search for JavaScript framework
. Or they can have direct messages with @coveo
.
Slack will send the message to API.ai which will transform it to an User Intent.
API.ai sends the Intent to the Heroky app which will send a query to Coveo based on the keywords in the intent.
The results are returned to Slack.
- In your Coveo organization, create a hosted search page to show more results from Slack.
-
Set up a new project in Heroku
- Add the files from
misc/heroku
in your Heroku environment. - Add config variable
COVEO_API_KEY
with your Coveo API key. - Add config variable
COVEO_SEARCH_PAGE
with the url to the Search Page for the results link in Slack. - Start your app in Heroku
- Add the files from
-
Set up your
COVEO_API_KEY
as a config variable in your Heroku app -
Start your app in Heroku a. create a new Heroku app b. wait for the app status' to be "ready"
-
In API.ai, create an agent and follow the procedure in API.ai's Slack Integration.
- In API.ai console, create a new agent.
- You can import the file
misc/api.ai/agent.config.zip
to reproduce our intents. - Go in Fulfillment and update the URL to your Heroku app.
- Go in Integration and enable Slack. Follow the instructions to connection to your Slack app.
- You need to create a new App. Follow the instructions at https://api.slack.com/apps?new_app=1
Once you've completed your Slack integration, you can send direct messages to your new bot in Slack. You can send messages like find images with dinosaurs
.
- You will need a Coveo organization and an Api key (restricted to Search only).
- Heroku, this application is hosted in Heroku.
- API.ai, this application uses services from API.ai, you can register for a free account.
- Slack, we are creating a slack bot, so you need Slack ;o)
- Gauthier Robe (https://github.com/gforce81)
- Jérôme Devost (https://github.com/jdevost)