Integrate Rasa X with existing Bot

Hello,

I have an existing bot running in Kubernetes with RedsTrackerStore, custom actions, components and channel. I understand how Rasa X can help manage conversations and improve models, but I wonder what is the recommended way to use its functionality on top of a running bot, which is also used by real users through the specified channel.

I think there are two options here:

a) Set up Rasa X es described in the docs with a “plain” rasa core container from Dockerhub, then connect it to the tracker store (via --endpoints option). Since there is only SQLTrackerStore supported at the moment, that means I would need to change to this tracker store or use the migration script on a regular basis. Pro: Easy to install (follow the docs) Con: SQLTrackerStore is required; how to push the improved models back to the live bot?

b) Instead of the rasa core container from Dockerhub, use the container that contains the live bot for “rasa-worker” and “rasa-production” services. Pro: Everything integrated into one application, i.e. improved models are used by the live bot, conversations from users should be visible in real-time Con: More complicated manual installation process

Please tell me in case I missed something :slight_smile:

Best, Martin

I am not really getting your approach b). Can you explain that a bit more?

You can also run Rasa X with a Redis Tracker store, but you still need a SQLDatabase for the Rasa X part. You are following this guide Deploy to a Server, right?

Hi Tobias,

thanks for your response. I think my question was a bit too complicated. Basically it is “How can I get the conversations of an existing bot into Rasa X, without manually using the import script, but by connecting to the bot’s tracker store?” I thought there must be way to do this and have user conversations updated in Rasa X in real-time (as was the case with Rasa Platform), or am I wrong?

You can also run Rasa X with a Redis Tracker store, but you still need a SQLDatabase for the Rasa X part. You are following this guide Deploy to a Server, right?

Yes, I am aware that SQL db is needed. When I start Rasa X locally with --endpoints flag with a RedisTrackerStore in the endpoints.yml, it says “Rasa X currently only supports a SQLite tracker store with path ‘tracker.db’ when running locally. You can deploy Rasa X with Docker (Deploy to a Server) if you want to use other tracker store configurations.”

I did not find a description how to connect it with RedisTrackerStore when using Docker under this link, there are only the components mentioned which Rasa X depends on (rasa-prod, rasa-worker, sql db, rasa x etc.). Again, as described above, my goal is to “sync” Rasa X with the tracker store of a running bot.

Best, Martin

That does not work. You have to use the import script for the old conversation. All new conversations are then automatically forwarded to the Rasa X database.

You would have to add your tracker store as another component and then change your endpoints.yml to use this tracker store. Does that make sense?

All new conversations are then automatically forwarded to the Rasa X database.

What do you mean by all new conversations? All meaning the ones I do in Rasa X for testing AND which the users have with the bot (e.g. via Slack or any other channel)? Because for this the tracker store of the bot must be connected with Rasa.

You would have to add your tracker store as another component and then change your endpoints.yml to use this tracker store.

Ok, so I think this could finally be the answer :slight_smile: Let’s assume this tracker store is running in another container (with its own service, I am deploying via k8s). In the endpoints.yml (or configuration-files.yml in my case) Can I simply replace SQL tracker store with Redis in tracker_store section without breaking the SQL database that Rasa X needs?

apiVersion: v1
data:
    rasa-credentials: |
        rasa:
            url: http://rasa-x:5002
    rasa-endpoints: |
        models:
            url: ${RASA_MODEL_SERVER}
            token: ${RASA_X_TOKEN}
            wait_time_between_pulls: ${RASA_MODEL_PULL_INTERVAL}
        tracker_store: ## redis goes here??
            type: sql
            dialect: "postgresql"
            url: ${DB_HOST}
            port: ${DB_PORT}
            username: ${DB_USER}
            password: ${DB_PASSWORD}
            db: ${DB_DATABASE}
            login_db: ${DB_LOGIN_DB}
        event_broker:
            type: "pika"
            url: ${RABBITMQ_HOST}
            username: ${RABBITMQ_USERNAME}
            password: ${RABBITMQ_PASSWORD}
            queue: ${RABBITMQ_QUEUE}
        action_endpoint:
            url: ${RASA_USER_APP}/webhook
            token:  ""

Sorry, I guess I was a bit unclear and in a rush :pray:

  • “old conversations”: Conversations your user’s had before you switched to Rasa X
  • “new conversations”: Conversations your users had / have after you switched to Rasa X

You could run the script from here Migrates a Rasa tracker store (Redis, Mongo, SQL) to Rasa X. · GitHub to migrate all “old conversations” to Rasa X (if you want to continue using your old tracker store, comment out line 88 of the script. After running the migration, the “old conversations” should be in the Rasa X database (most likely postgres). If you then run Rasa X, all “new” user conversations should automatically be added to the old conversations since RabbitMQ is forwarding them from Rasa to Rasa X.

Yes, exactly :rocket: This documentation gives you some guidance Tracker Stores.