Dialogue State Tracker

The tracker stores and maintains the state of the dialogue with a single user. It is stored in a tracker store, retrieved when incoming messages for the conversation are received and updated after actions have been executed

Here we go:

class rasa_core.trackers.DialogueStateTracker(sender_id, slots, max_event_history=None)[source]

Bases: object

Maintains the state of a conversation.


Returns all actions that should be applied - w/o reverted events.


Return a Dialogue object containing all of the turns.

This can be serialised and later used to recover the state of this tracker exactly.


Clears follow up action when it was executed


Creates a duplicate of this tracker


Return the currently set values of the slots

current_state(should_include_events=False, only_events_after_latest_restart=False)[source]

Return the current tracker state as an object.


Return a list of events after the most recent restart.


Dump the tracker as a story in the Rasa Core story format.

Returns the dumped tracker as a string.


Dump the tracker as a story to a file.

classmethod from_dict(sender_id, dump_as_dict, domain)[source]

Create a tracker from dump.

The dump should be an array of dumped events. When restoring the tracker, these events will be replayed to recreate the state.


Returns a generator of the previous trackers of this tracker.

The resulting array is representing the trackers before each action.


Get entity values found for the passed entity name in latest msg.

If you are only interested in the first entity of a given type use next(tracker.get_latest_entity_values(“my_entity_name”), None). If no entity is found None is the default result.


Retrieves the value of a slot.


Return the idx of the most recent restart in the list of events.

If the conversation has not been restarted, 0 is returned.


Creates a new state tracker with the same initial values.


State whether the tracker is currently paused.


Generate the past states of this tracker based on the history.


Use a serialised Dialogue to update the trackers state.

This uses the state as is persisted in a TrackerStore. If the tracker is blank before calling this method, the final state will be identical to the tracker from which the dialogue was created.


Update the tracker based on a list of events.


Creates a new tracker with a state at a specific timestamp.

A new tracker will be created and all events previous to the passed time stamp will be replayed. Events that occur exactly at the target time will be included.


Triggers another action following the execution of the current.


Modify the state of the tracker according to an Event.