> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Inworld Graph Runtime Data Event History

[Overview](../overview) > [Inworld Graph Runtime Data](./InworldGraphRuntimeData) > Inworld Graph Runtime Data Event History

**Class:** `UInworldGraphRuntimeData_EventHistory` | **Inherits from:** `UInworldGraphRuntimeData`

Runtime data class for managing event history in Inworld graphs. This class creates and manages an event history system that tracks various types of events (primarily speech events) during graph execution. It provides functionality for adding, retrieving, and formatting event history with configurable capacity and formatting options.

## Methods

* [AddGenericEvent](#addgenericevent)
* [AddSpeechEvent](#addspeechevent)
* [Clear](#clear)
* [DebugDumpEventHistory](#debugdumpeventhistory)
* [GetHistoryEventData](#gethistoryeventdata)
* [GetHistoryString](#gethistorystring)
* [GetSpeechEvents](#getspeechevents)
* [Set](#set)

## Reference

### AddGenericEvent

Adds a generic event to the event history.
This function stores the provided text event and appends it to the history.
If the history reaches its capacity, the oldest event is removed.

<img src="https://mintcdn.com/inworldai/StlB2j_TRDiuzJEK/img/unreal/runtime/nd_img_AddGenericEvent.png?fit=max&auto=format&n=StlB2j_TRDiuzJEK&q=85&s=60893b179c9e38fd75e32e3a8dab047f" alt="AddGenericEvent Blueprint Node" width="212" height="143" data-path="img/unreal/runtime/nd_img_AddGenericEvent.png" />

## Examples

```c++ theme={"system"}
void AddGenericEvent(const FString& Event)
```

#### Parameters

| Parameter | Type             | Description                                |
| --------- | ---------------- | ------------------------------------------ |
| Event     | `const FString&` | The text event to be added to the history. |

***

### AddSpeechEvent

Adds a speech event to the event history.
This function records a speech event, storing the agent's name and utterance.
The event is formatted based on the SpeechEventFormatter and appended to the history.
If the history reaches its capacity, the oldest event is removed.

<img src="https://mintcdn.com/inworldai/StlB2j_TRDiuzJEK/img/unreal/runtime/nd_img_AddSpeechEvent.png?fit=max&auto=format&n=StlB2j_TRDiuzJEK&q=85&s=1f784e727aef6a1279923e0464069a9a" alt="AddSpeechEvent Blueprint Node" width="212" height="138" data-path="img/unreal/runtime/nd_img_AddSpeechEvent.png" />

## Examples

```c++ theme={"system"}
void AddSpeechEvent(const FInworldEventSpeech& Speech)
```

#### Parameters

| Parameter | Type                         | Description                                                      |
| --------- | ---------------------------- | ---------------------------------------------------------------- |
| Speech    | `const FInworldEventSpeech&` | The speech event data containing the agent's name and utterance. |

***

### Clear

Clear the event history. This function removes all stored events and resets the history string.

<img src="https://mintcdn.com/inworldai/StlB2j_TRDiuzJEK/img/unreal/runtime/nd_img_Clear.png?fit=max&auto=format&n=StlB2j_TRDiuzJEK&q=85&s=f815533dfe6f831aefb62ae04611fcc3" alt="Clear Blueprint Node" width="212" height="108" data-path="img/unreal/runtime/nd_img_Clear.png" />

## Examples

```c++ theme={"system"}
void Clear()
```

***

### DebugDumpEventHistory

Outputs debug information about the event history to the console. This function prints detailed information about the current event history state, including all stored events, for debugging and development purposes.

<img src="https://mintcdn.com/inworldai/mZNEEtl7pbzQ55cC/img/unreal/runtime/nd_img_DebugDumpEventHistory.png?fit=max&auto=format&n=mZNEEtl7pbzQ55cC&q=85&s=d25f2806b8c91daf0e57990fe4c1f630" alt="DebugDumpEventHistory Blueprint Node" width="221" height="108" data-path="img/unreal/runtime/nd_img_DebugDumpEventHistory.png" />

## Examples

```c++ theme={"system"}
void DebugDumpEventHistory()
```

***

### GetHistoryEventData

Retrieves the speech event history as structured data.

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetHistoryEventData.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=4580f88d4f6d55f7350a172c4742bda0" alt="GetHistoryEventData Blueprint Node" width="212" height="76" data-path="img/unreal/runtime/nd_img_GetHistoryEventData.png" />

## Examples

```c++ theme={"system"}
FInworldHistoryEventData GetHistoryEventData()
```

#### Returns

**Type:** `FInworldHistoryEventData`
**Description:** Structured event history data containing all speech events

***

### GetHistoryString

Retrieves the full event  history as a formatted string.
This function returns a concatenated string representation of all stored events.

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetHistoryString.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=52c405c39b49119d97769d9caf2c23c1" alt="GetHistoryString Blueprint Node" width="212" height="76" data-path="img/unreal/runtime/nd_img_GetHistoryString.png" />

## Examples

```c++ theme={"system"}
const FString& GetHistoryString()
```

#### Returns

**Type:** `const FString&`
**Description:** A reference to the history string containing all recorded events.

***

### GetSpeechEvents

Retrieves the speech event history.
This function returns a representation of all stored speech events.

<img src="https://mintcdn.com/inworldai/FLbWLM7DwaqfvDaU/img/unreal/runtime/nd_img_GetSpeechEvents.png?fit=max&auto=format&n=FLbWLM7DwaqfvDaU&q=85&s=193e39223fdb3b1f2f4177ea3739af7a" alt="GetSpeechEvents Blueprint Node" width="212" height="76" data-path="img/unreal/runtime/nd_img_GetSpeechEvents.png" />

## Examples

```c++ theme={"system"}
const TArray<FInworldEventSpeech>& GetSpeechEvents()
```

#### Returns

**Type:** `const TArray<FInworldEventSpeech>&`
**Description:** A reference to the history containing all recorded speech events.

***

### Set

Sets the initial event history data table.

<img src="https://mintcdn.com/inworldai/UjBJ5lUznbajzMw5/img/unreal/runtime/nd_img_Set.png?fit=max&auto=format&n=UjBJ5lUznbajzMw5&q=85&s=cfaf0a12692e49dc755b7538b2329e8b" alt="Set Blueprint Node" width="229" height="162" data-path="img/unreal/runtime/nd_img_Set.png" />

## Examples

```c++ theme={"system"}
void Set(UDataTable* InEventHistoryTable)
```

#### Parameters

| Parameter           | Type          | Description                                             |
| ------------------- | ------------- | ------------------------------------------------------- |
| InEventHistoryTable | `UDataTable*` | The data table containing initial event history entries |

***
