Skip to main content
Intercept and modify agent operations with lifecycle hooks.
The TS HooksManager (via createHooksManager) is a standalone, opt-in utility, mirroring the Python memory.HooksManager. Its events fire only when your own code invokes the manager — it is not auto-wired into an agent’s tool/LLM loop. To gate an operation, run the manager at the point where the operation happens.

Quick Start

1

Simple Usage

Hook Events

Operation Hooks (Python Parity)

LLM/Tool Hooks (CrewAI/Agno Parity)

Lifecycle Hooks

Blocking Operations

Return null from a hook to block the operation:

Modifying Context

Return modified context to change the operation:

Factory Functions

Hook Priority

Hook Timeout

Callbacks

Display and approval callbacks

Workflow Hooks

Workflow lifecycle hooks

Guardrails

Input/output validation