Thread retention is an Enterprise feature, enabled per organization on
request — contact us to turn it on. Self-hosted Enterprise
deployments set
LIGHTDASH_ENABLE_FEATURE_FLAGS=ai-thread-retention — see
feature flag environment
variables.How retention works
Retention is configured in whole hours (presets from 1 hour to 90 days, or a custom value), at two levels:- Organization default — applies to every agent in the organization, including threads that aren’t linked to an agent.
- Per-agent window — an agent can set a shorter window than the organization default, making the organization value the ceiling.
What gets deleted
When a thread expires, everything derived from it is deleted with it:- prompts, responses, tool calls and tool results, and reasoning
- share links (revoked)
- agent memories learned from the thread
- evaluation prompts that reference the thread (evaluation suites may shrink), and past evaluation runs’ threads
What retention does not cover
The retention window applies to AI agent thread content stored by Lightdash. Adjacent stores keep their own, separately bounded retention:Configuring retention
Organization default: go to Organization settings → Ask AI → General → Thread retention. Lowering the window (or setting one where there was none) asks for confirmation and shows how many existing threads will be deleted.

Agents as code
Agents managed as code can set the per-agent window with the optionalthreadRetentionHours field:
- a number sets the window (validated against the organization ceiling)
- an explicit
nullclears the agent’s window, inheriting the organization default - omitting the field leaves the stored setting unchanged

