# Create an agent to access tracker

**URL:** <https://forum.rasa.com/t/create-an-agent-to-access-tracker/3265>\
**Category:** Rasa Open Source\
**Created:** [December 4, 2018, 3:37pm UTC](https://forum.rasa.com/t/create-an-agent-to-access-tracker/3265 "2018-12-04T15:37:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![huberrom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/huberrom/32/1209_2.png) [@huberrom](https://forum.rasa.com/u/huberrom)\
**Post date:** [December 4, 2018, 3:37pm UTC](https://forum.rasa.com/t/create-an-agent-to-access-tracker/3265/1 "2018-12-04T15:37:10Z")

</div>

I created a custom channel in order to communicate with a custom chat, and it’s working great, but now I want to open a new route so the chat can modify slots through events. I want to do the exact same thing as the route /tracker/events, so I checked the code base, and I don’t understand how to create an agent to do things like :

```
tracker.agent.tracker_store.get_or_create_tracker(sender_id)  

```

Can anyone help me ? (If it helps, I want to copy the method append\_event from [rasa\_core/server.py at master · RasaHQ/rasa\_core · GitHub](https://github.com/RasaHQ/rasa_core/blob/master/rasa_core/server.py))

Thank you in advance !

---

<div class="post-metadata">

**Author:** ![huberrom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/huberrom/32/1209_2.png) [@huberrom](https://forum.rasa.com/u/huberrom)\
**Post date:** [December 4, 2018, 4:21pm UTC](https://forum.rasa.com/t/create-an-agent-to-access-tracker/3265/2 "2018-12-04T16:21:05Z")

</div>

I should specifie that I only have a core (in a docker container, action-server and nlu are in an another container) so I tried this :

```
_endpoints = AvailableEndpoints.read_endpoints(os.environ['RASA_CORE_ENDPOINTS_CUSTOM_CHANNEL'])
self.agent.load_agent(os.environ['RASA_CORE_MODEL_CUSTOM_CHANNEL'], interpreter=RegexInterpreter(), endpoints=_endpoints)

```

and then :

```
request_params = request.get_json(force=True)
            evt = Event.from_parameters(request_params)
            tracker = self.agent.tracker_store.get_or_create_tracker(sender_id)
            if evt:
                tracker.update(evt)
                self.agent.tracker_store.save(tracker)

```

To update the tracker. There is no error when I send an event, it returns with a json saying the slot is set, but when I send a message with the same conversation id, the slot is None. I’m using redis as tracker\_store

---

<div class="post-metadata">

**Author:** ![huberrom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/huberrom/32/1209_2.png) [@huberrom](https://forum.rasa.com/u/huberrom)\
**Post date:** [December 5, 2018, 9:18am UTC](https://forum.rasa.com/t/create-an-agent-to-access-tracker/3265/3 "2018-12-05T09:18:44Z")

</div>

If anyone have the same bug one day, the problem is that I didn’t load a tracker store with the agent in load\_agent (the fourth argument) :

```
_broker.PikaProducer.from_endpoint_config(_endpoints.event_broker)
_tracker_store=TrackerStore.find_tracker_store(None, _endpoints.tracker_store, _broker)
```
