# createHistoryManager
Source: https://docs.maelstrom-ai.co/0.2/reference/engine/functions/createhistorymanager/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **createHistoryManager**<`TMeta`\>(`config`): [`HistoryManager`](https://docs.maelstrom-ai.co/0.2/reference/engine/interfaces/historymanager/)<`TMeta`\>

Defined in: packages/engine/src/lib/history/history-manager.ts:150

Construct a [HistoryManager](https://docs.maelstrom-ai.co/0.2/reference/engine/interfaces/historymanager/) from the given config. The passed-in [HistoryStore](https://docs.maelstrom-ai.co/0.2/reference/engine/interfaces/historystore/) is the only persistence boundary; this manager adds per-session mutual exclusion (for `recordTurn`), truncation policy, and the default LLM-context projection on top.

Most consumers should let `createEngine` wire this up via [EngineConfig.history](https://docs.maelstrom-ai.co/0.2/reference/engine/interfaces/engineconfig/#history). Construct directly only when assembling a custom engine pipeline that needs the manager outside `createEngine`.

## Type Parameters

### TMeta

`TMeta` = `unknown`

## Parameters

### config

[`HistoryConfig`](https://docs.maelstrom-ai.co/0.2/reference/engine/interfaces/historyconfig/)<`TMeta`\>

## Returns

[`HistoryManager`](https://docs.maelstrom-ai.co/0.2/reference/engine/interfaces/historymanager/)<`TMeta`\>
