# History

Will hold historical events for the scene.

There are three types of historical entries:

- **Archived history (static)** - These are entries are manually defined and dated before the starting point of the scene. Things that happened in the past that are **IMPORTANT** for the understanding of the world. For anything that is not **VITAL**, use world entries instead.
- **Archived history (from summary)** - These are historical entries generated from the progress in the scene. Whenever a certain token (length) threshold is reached, the [Summarizer Agent](/talemate/user-guide/agents/summarizer/) will generate a summary of the progression and add it to the history.
- **Layered history (from summary)** - As summary archives are generated, they themselves will be summarized again and added to the history, leading to a natural compression of the history sent with the context while also keeping track of the most important events. (hopefully)

![History](/talemate/img/0.31.0/history.png)

## Layers 

There is always the **BASE** layer, which is where the archived history (both static and from summary) is stored. For all intents and purposes, this is layer 0.

At the beginning of a scene, there won't be any additional layers, as any layer past layer 0 will come from summarization down the line.

Note that layered history is managed by the [Summarizer Agent](/talemate/user-guide/agents/summarizer/) and can be disabled in its settings.

### Managing entries

- **All entries** can be edited by double-clicking the text.
- **Static entries** can be deleted by clicking the **:material-close-box-outline: Delete** button.
- **Summarized entries** can be regenerated by clicking the **:material-refresh: Regenerate** button. This will cause the LLM to re-summarize the entry and update the text.
- **Summarized entries** can be inspected by clicking the **:material-magnify-expand: Inspect** button. This will expand the entry and show the source entries that were used to generate the summary.

### Adding static entries

Static entries can be added by clicking the **:material-plus: Add Entry** button.

!!! note "Static entries must be older than any summary entries"
    Static entries must be older than any summary entries. This is to ensure that the history is always chronological.

    Trying to add a static entry that is more recent than any summary entry will result in an error.

##### Entry Text

The text of the entry. Should be at most 1 - 2 paragraphs. Less is more. Anything that needs great detail should be a world entry instead.

##### Unit

Defines the duration unit of the entry. So minutes, hours, days, weeks, months or years.

##### Amount

Defines the duration unit amount of the entry.

So if you want to define something that happened 10 months ago (from the current moment in the scene), you would set the unit to months and the amount to 10.

![Add Static Entry](/talemate/img/0.31.0/history-add-entry.png)

## Regenerate everything

It is possible to regenerate the entire history by clicking the **:material-refresh: Regenerate All History** button in the left sidebar. Static entries will remain unchanged.

![Regenerate All History](/talemate/img/0.31.0/history-regenerate-all.png)

!!! warning "This can take a long time"

    This will go through the entire scene progress and regenerate all summarized entries.

    If you have a lot of progress, be ready to wait for a while.
