Skip to content
FacebookYouTubeX (Twitter)

Rasa Tutorial 1 - Rasa as external chatbot

Connect Rasa to Pingstreams and easily handoff your conversation to a human agent!

Integrating Rasa in Pingstreams offers many advantages, first of all the possibility to handoff current chatbot’s conversation to humans. This is a very common task in chatbot integration design, because a chatbot cannot always satisfy every user request or simply because the first chatbot was there just to welcome the user, get the user question and some user data (i.e. email, name), choose the right team and then forward the request to the first available agent.

We created this first tutorial to allow a more customized integration experience with Rasa, allowing you to understand how easy it is to attach an external RASA bot to Pingstreams, switching a conversation to humans when needed.

🚀 Native RASA Connector available 🚀 This tutorial aims to support you if you want a starting point to take full control of your RASA integration customization. If instead you prefer to integrate RASA in the “easy way” you can use the RASA native integration already embedded in Pingstreams.

We’ll use Replit.com and Node.js for our first RASA integration tutorial.

NOTE: You can find the full source code of this tutorial here: https://github.com/Pingstreams/pingstreams-rasa-proxy/

  1. Create a replit.com account if you haven’t one already.
  2. Go on the RASA project on Replit
  3. Press the project title on the top, open the menu and press “Fork” option as in the following picture:

  1. Name your project according to your preferences and press “confirm”:

  1. In the index.js file change the RASAserver var to point to your RASA server.

  1. Now press the green Run button on the top bar. Your RASA proxy started. Now it’s time to connect it to a new Pingstreams project.

The API_ENDPOINT var in the source code points to the Pingstreams cloud.

If you installed Pingstreams using the Docker compose distribution, please use this value for your API_ENDPOINT var:

On localhost:

API_ENDPOINT = localhost/api/

On your own server:

API_ENDPOINT = ${YOUR_SERVER_HOST}/api/

Create an account on Pingstreams, then create a new Project, you can name it “My RASA project”.

Follow the tutorial steps, leaving the default settings. You will land on the project’s Dashboard.

From the side menu select Settings > Bots. Click the ADD BOT button, on the top.

Choose External as bot type:

Now configure your bot. First choose a name (as ‘RASA bot’ in the example) and the HTTP endpoint of the Replit Proxy you created above.

To get the proxy base endpoint go on the Replit.com Proxy, Run the project. You get the base url on the right panel on the top, as in the following picture:

Now, copy and paste Base proxy endpoint in the new bot form, adding /bot on the end:

Now press CREATE BOT. When asked, press “Activate bot”. This action will attach your chatbot to your default routing, making the chatbot available to end-users.

Open the widget and press the New conversation button.

A new conversation suddenly starts with chatbot greeting you:

You can ask his name 🙂

If, at some point with your chatbot conversation, it is necessary to kick off the chatbot and invite a human agent instead, you can do this in the simplest way following the handoff documentation.

Just create an intent reply with a \agent directive as last line in the message:

We are looking for an operator...
\agent

As soon as Pingstreams sees such a directive (\agent) in the message it will try to move the conversation to the first available agent, following the conversation’s department rules (Assigned or Pooled). If the department’s routing is on “Assigned”, the conversation is instantly moved to the first available agent, like in the following picture:

In this tutorial you just learned how to connect your RASA chatbot to a Pingstreams conversation and how to move the conversation to the next available agent when needed.

See you on next tutorial!

🚀 Native RASA Connector available 🚀 This tutorial aims to support you if you want a starting point to take full control of your RASA integration customization. If instead you prefer to integrate RASA in the “easy way” you can use the RASA native integration already embedded in Pingstreams.

If you have any question or feedback please write us at support@pingstreams.io

Pingstreams provides a forever free account full of features. Just sign up and use it for free!