# Default tracker store

**URL:** <https://forum.rasa.com/t/default-tracker-store/19821>\
**Category:** Rasa Open Source\
**Created:** [October 15, 2019, 10:13am UTC](https://forum.rasa.com/t/default-tracker-store/19821 "2019-10-15T10:13:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![meggy](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@meggy](https://forum.rasa.com/u/meggy)\
**Post date:** [October 15, 2019, 10:13am UTC](https://forum.rasa.com/t/default-tracker-store/19821/1 "2019-10-15T10:13:02Z")

</div>

How to access conversation history from default tracker store ?? how to write code in action.py file to extract chat conversation??

---

<div class="post-metadata">

**Author:** ![talhashaikh5](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/talhashaikh5/32/5405_2.png) [@talhashaikh5](https://forum.rasa.com/u/talhashaikh5)\
**Post date:** [October 15, 2019, 10:24am UTC](https://forum.rasa.com/t/default-tracker-store/19821/2 "2019-10-15T10:24:39Z")

</div>

You can get the whole Conversation by using this API `http://localhost:5005/conversations/{replace_with_sender_id}/tracker`

There is no way to get the conversation in the action.py program by using the tracker object. you can use request.get() method and get the whole conversation as a JSON response.

---

<div class="post-metadata">

**Author:** ![meggy](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@meggy](https://forum.rasa.com/u/meggy)\
**Post date:** [October 15, 2019, 10:37am UTC](https://forum.rasa.com/t/default-tracker-store/19821/3 "2019-10-15T10:37:32Z")

</div>

Thanks for your quick response 😊😊Can you explain how to use request.get() method to get the whole conversation with code if possible Thanks in advance

---

<div class="post-metadata">

**Author:** ![talhashaikh5](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/talhashaikh5/32/5405_2.png) [@talhashaikh5](https://forum.rasa.com/u/talhashaikh5)\
**Post date:** [October 15, 2019, 10:52am UTC](https://forum.rasa.com/t/default-tracker-store/19821/4 "2019-10-15T10:52:30Z")

</div>

Here is the screenshot of how the request looks like

 ![Screenshot%20from%202019-10-15%2016-09-25](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/f/f16b7b3ef4254d5ee57ed60acce28ea3c23ea2a7.png)

here is the code you can use in actions.py

```
# importing the requests library 
 import requests 
# api-endpoint 
sender_id = mention_sender_id_here
URL = "http://localhost:5005/"+sender_id+"/ali/tracker"
# sending get request and saving the response as response object 
r = requests.get(url = URL) 
# extracting data in json format 
data = r.json()

```

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 15, 2019, 11:41am UTC](https://forum.rasa.com/t/default-tracker-store/19821/5 "2019-10-15T11:41:55Z")

</div>

If you follow this approach you will get the conversation history only when custom actions are called but if you want to access the whole conversation history from tracker, you can check this code:

[https://github.com/JiteshGaikwad/Rasa-ChatHistory-Logger](https://github.com/JiteshGaikwad/Rasa-ChatHistory-Logger)

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 15, 2019, 11:47am UTC](https://forum.rasa.com/t/default-tracker-store/19821/6 "2019-10-15T11:47:01Z")

</div>

Instead of calling api, we can also get the conversation using `as_dialogue` method of the tracker

[https://rasa.com/docs/rasa/api/tracker/#rasa.core.trackers.DialogueStateTracker.as\_dialogue](https://rasa.com/docs/rasa/api/tracker/#rasa.core.trackers.DialogueStateTracker.as_dialogue)

---

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [October 18, 2019, 2:04pm UTC](https://forum.rasa.com/t/default-tracker-store/19821/7 "2019-10-18T14:04:54Z")

</div>

hey @JiteshGaikwad I tried this method to store conversations but in chatHistoryLogger I’m get “undefined variable error” for “logger.debug”

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/2/2318ba126064b568f0963a24f93b90bf5fb67a2f.png)

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 18, 2019, 4:14pm UTC](https://forum.rasa.com/t/default-tracker-store/19821/8 "2019-10-18T16:14:28Z")

</div>

Hey @kpreetsid make sure you have imported the logging module in the chathistoryLogger

> import logging

---

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [October 21, 2019, 6:00am UTC](https://forum.rasa.com/t/default-tracker-store/19821/9 "2019-10-21T06:00:19Z")

</div>

Hey @JiteshGaikwad,

I’ve already imported the said module in chthistoryLogger file.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/2/2d379ab1d0c20576395950f47a2252719d39f847.png)

Still getting the same error.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/c/c84274fd57a2c4e8ba251cd26ebe2ba409c67127.png)

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/c/c3a096f9ef9368ba1519fafa639fc958712b4b61.png)

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 21, 2019, 6:15am UTC](https://forum.rasa.com/t/default-tracker-store/19821/10 "2019-10-21T06:15:42Z")

</div>

can you show me the chatHistoryLogger.py

---

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [October 21, 2019, 6:30am UTC](https://forum.rasa.com/t/default-tracker-store/19821/11 "2019-10-21T06:30:45Z")

</div>

attaching snapshot of whole chatHistoryLogger.py

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/9/966525f8ba921fb542cc0b728e41b83ff94682e8.png)

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 21, 2019, 6:42am UTC](https://forum.rasa.com/t/default-tracker-store/19821/12 "2019-10-21T06:42:01Z")

</div>

hi @kpreetsid, thanks for stating the issue, I had forgot the `logger` definition.

> logger = logging.getLogger( **name** )

just add it to line no. 8

---

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [October 21, 2019, 6:47am UTC](https://forum.rasa.com/t/default-tracker-store/19821/13 "2019-10-21T06:47:29Z")

</div>

what does “name” stands here?, because I’ve checked whole file but there is no variable named “name”.

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 21, 2019, 6:49am UTC](https://forum.rasa.com/t/default-tracker-store/19821/14 "2019-10-21T06:49:41Z")

</div>

**name is a built-in variable which evaluates to the name of the current module.**

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [October 21, 2019, 6:51am UTC](https://forum.rasa.com/t/default-tracker-store/19821/15 "2019-10-21T06:51:11Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/b/bfaef4f030e8a5ab61fa5e1439ff28a5c5101679.png)

---

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [October 21, 2019, 7:00am UTC](https://forum.rasa.com/t/default-tracker-store/19821/16 "2019-10-21T07:00:17Z")

</div>

Hey @JiteshGaikwad,

Thanks , it’s working now 😃 😃

---

<div class="post-metadata">

**Author:** ![Saranya96](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Saranya96](https://forum.rasa.com/u/Saranya96)\
**Post date:** [April 28, 2020, 12:52pm UTC](https://forum.rasa.com/t/default-tracker-store/19821/17 "2020-04-28T12:52:09Z")

</div>

I have implemented Rasa-ChatHistory-Logger .Is it possible to get specific sender \_id log information?

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [April 28, 2020, 1:02pm UTC](https://forum.rasa.com/t/default-tracker-store/19821/18 "2020-04-28T13:02:07Z")

</div>

@Saranya96, you can get it, can you let me know how are you storing the data, I mean logging it to db or json file?

---

<div class="post-metadata">

**Author:** ![Saranya96](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@Saranya96](https://forum.rasa.com/u/Saranya96)\
**Post date:** [April 28, 2020, 1:06pm UTC](https://forum.rasa.com/t/default-tracker-store/19821/19 "2020-04-28T13:06:23Z")

</div>

I am logging as a json file only.

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [April 28, 2020, 1:11pm UTC](https://forum.rasa.com/t/default-tracker-store/19821/20 "2020-04-28T13:11:44Z")

</div>

If your json file is something similar to this file:

> <https://github.com/JiteshGaikwad/Rasa-ChatHistory-Logger/blob/e22c1ed8dda863c921206de091dfa7322396abf7/sampleChatHistoryData.json#L3>

you need to write the code as below:

- you need to write a function which accepts the `sender_id`
- Inside the function, you need to maintain a variable let’s say `sender_logs` of datatype `list` that will store the sender’s log info
- and then you need to write the code that will loop over the json data and check the info with sender’s id and once matched it will append the data to the `sender_logs` variable
- once the loops end, you need to return the `sender_logs` variable

[Next page](https://forum.rasa.com/t/default-tracker-store/19821.md?page=2)
