Overview
KaireonAI stores interaction history, summaries, suppressions, and decision traces that grow continuously. The Retention & Archival system lets you control how long data is kept, automatically purge expired records, and export historical interactions to durable file storage before deletion. All retention settings are configured per tenant in Settings > Retention.Tenant Settings
Two retention periods are configurable per organization:
Update these via the Settings UI or the API. Tenant-scoped retention windows live on the
/api/v1/tenant-settings resource:
Audit-log retention
Audit-log entries follow the tenant’s retention configuration for theaudit data class. With no audit retention row configured, the default is 2555 days (~7 years) — audit trails are compliance evidence, so the fallback errs long. A retention row with legalHold set on the audit class suspends audit-log purging entirely. A 30-day minimum floor applies to any configured value.
Per-class retention configuration and Legal Hold
Beyond the two tenant-settings windows above, KaireonAI has a second, finer-grained retention surface: Settings > Retention (backed by/api/v1/admin/retention-configs), which sets a retention window per data class and can place any class under Legal Hold.
Read and write these via the admin API (admin role required):
attachments has no default — it is skipped entirely until a row is configured).
Legal Hold
Every row above has alegalHold boolean. When true, that data class is completely exempt from automatic purging — every cron listed in the table above skips it — regardless of retentionDays. There is no separate “legal hold” data class; it’s a flag on each real class row.
The Settings UI’s single Legal Hold switch applies legalHold to every class it manages in one save (fans the same boolean out across interactions, decisions, metrics, audit, attachments, and system_health), so flipping it on suspends purging platform-wide for that tenant. Placing a hold on an individual class via the API directly (e.g. only decisions) suspends purging for just that class.
Automated Cleanup
The cleanup cron purges expired data on a schedule. Trigger it via:- Expired suppressions — Deletes suppression records where
expiresAt < now(). This keeps the suppression table lean for fast decision-time reads. - Old daily summaries — Deletes daily summary rows older than
summaryRetentionDays. - Old interaction history — Deletes interaction records older than
interactionHistoryRetentionDays(run the export cron first if you need to preserve them). - Old decision traces — Deletes
DecisionTracerows past the tenant’sdecisionsretention class. - Old metrics — Deletes
MetricValuerows past the tenant’smetricsretention class.
legalHold set — see Legal Hold above.
Interaction History Export
The export cron writes interaction history to Hive-partitioned files for long-term storage and analytics:Hive Directory Structure
Exported files follow a date-partitioned layout compatible with Spark, Athena, Trino, and other query engines:GDPR & Right to Erasure
KaireonAI supports configurable retention to help meet data protection requirements:- Right to erasure: Use the GDPR erasure API at
POST /api/v1/gdpr/erasurewith body{ "customerId": "..." }(admin role required) to atomically delete all interaction history, summaries, suppressions, decision traces, and attribution records for a customer. Returns per-table delete counts for audit. - Configurable per org: Each tenant can set retention periods appropriate to their regulatory environment. Financial services may require 7-year retention; consumer apps may set 1 year.
- Audit trail: Cleanup and export operations are logged in the audit log with the number of records affected, timestamps, and the initiating user or cron trigger.
The erasure endpoint performs a hard delete across all tables in a single transaction. Exported Hive files must be purged separately from your file storage if a customer exercises their right to erasure.
Related
Behavioral Metrics
Configure computed aggregations over interaction history, materialized as MetricValue rows.
Contact Policies
Suppression records managed by retention cleanup.
Infrastructure Backends
Choose the right storage backend for your interaction volume.