Logging user messages (TrackerStore problem)

Hi, I’m currently using rasa for mostly the NLU part only, messages are sent using the REST api /model/parse and i get the json response! so far so good.

what i want to do is to log every message the bot receives, more specifically “text”, “intent” and “entities” attributes.

i’ve tried to add a TrackerStore [either MongoDB or SQL] such that i access it later on and extract the data i want, i do connect to it successfully but i get no records in the database at all.

so what i am doing wrong? and what’s the right way to do such a logging in rasa?

thanks in advance :blush:

Hm, core is the one that takes care of connecting to/logging to the tracker store, I don’t believe that NLU can actually do this currently

@erohmensing Thanks for the reply! well, i understand that core does the trackerstore thing, so what i did is that i trained a model with dummy stories and policies (to include core). hoping that i would get the logs, then i can process them later on and get what i need.

Anyways, can you suggest a good way for doing such logging? My first thought was to write some NLU component and put it at the end of the pipeline, then i would log both messages an predictions in that component(either in db or local files) but i think that way would add an overhead and unnecessary latency.

Hm that’s strange, if you are set up on core then it should be able to log :thinking: and the parse data should be part of that. Can you clarify how you’re connecting to it and how you’re trying to query the conversations?

here’s my core config:

# ------------------------------------------
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/

  - name: "MemoizationPolicy"

stories.md file

## story 1: Menus
* Food_Show_Menu
  - food_show_menu  
## story 2: order
* Food_Order
  - food_order

. endpoints.yml

    type: mongod
    url: "mongodb://localhost:27017"
    db: "rasa"

i run the server using the command:

python -m rasa run  --enable-api --model {path to model tar} --port {port number} --endpoints {path to endpoints file} --debug

and i get in the debug log that it successfully connect to mongo tracker store finally i query the model using HTTP POST request to {ip}/model/parse with body like:

"text": "i want to order food"

sorry for the long reply but i hope that clarifies things a bit.

@erohmensing for quering the conversations, i used sqlite-browser when i tried SQLtracker, and got empty table called “events” i think. and for mongo i used Robo 3T browser and got no documents/records.

Ah that’ll be why, I think in order to get the tracker store, you have to have an actual conversation by hitting the rest input channel instead of hitting the parse endpoint, since the parse endpoint doesn’t log those

1 Like

This is it!!

now the problem seems to be that i can’t log a message and get parsed output (NLU predictions) with a single request, right?

Ah, yeah that’s hard, basically you can either log them and see them in the tracker store or parse them and not have them logged :sweat_smile:perhaps it makes most sense just to hit both endpoints during your workflow? Either at the same time so you can see what’s coming out and query it later, or e.g. you could parse, check it, and log

1 Like

Okay! I think i will find somehow to arrange things in order to do both requests.

At the end, I can’t thank you enough for your time and help. :blush:

No problem :slight_smile: