Skip to content

Session History and Retention

Every AI session keeps its conversation. This page explains how long ended sessions stay available, what the history endpoint returns, and how to download the complete transcript of a long session.

Retention

An ended session stays available for 90 days after it ends. This applies to every organization and every session type: sessions started by D&R rules, by the API or CLI, and chats in the web console.

During those 90 days you can list the session, read its details, read its history and download its full transcript. After 90 days LimaCharlie deletes the session together with every stored copy of its conversation, including the full transcript download. Requests for it then return 404.

There is no limit on how many ended sessions you can keep during that time. An organization that runs hundreds of sessions a day can still look back over the last 90 days.

Retention is fixed. It is not a setting you change per organization.

To keep a transcript longer, download it within the 90 days. To keep a record of every session for longer than 90 days, forward the ai_session_ended event to your own storage with an Output. It carries the summary of every organization session (started by a D&R rule, the API, the CLI or another LimaCharlie feature): who started it, why it ended, the cost, and the final answer. Chats that people start in the web console do not produce it.

What the history endpoint returns

GET /v1/org/sessions/{id}/history (and GET /v1/sessions/{id}/history for your own chats) returns the most recent part of the conversation. The response is limited to about 2 MiB of compressed messages. Very long sessions can hold more than that.

Two fields tell you what you got:

Field Meaning
truncated true when older messages exist that this response does not include.
full_history_available true when you can download the complete transcript for this session.

When truncated is true, download the full transcript to read the beginning of the session.

Sessions that ended before this feature was released keep the history they already had. Their full download holds whatever was saved when they ended. LimaCharlie does not rebuild messages that were already dropped.

In rare cases a very long session can have a gap in its full transcript, for example if a storage write failed while the session was running. The gap is only in the oldest part of the conversation.

Download the full transcript

The full transcript is available once a session has ended. While a session is running or waiting (dormant), use the history endpoint.

API

GET /v1/org/sessions/{id}/history/full

For your own chats:

GET /v1/sessions/{id}/history/full

The permissions match the history endpoint. For org sessions you need ai_agent.get.

The response gives you a short-lived link to the file:

{
  "url": "https://storage.googleapis.com/...",
  "expires_at": "2026-12-01T18:15:00Z",
  "size_bytes": 482113,
  "content_type": "application/gzip",
  "filename": "ai-session-3f6c2a1e.json.gz"
}

The link works for 15 minutes. Request a new one if it expires. Opening the link in a browser saves the file with the name in filename.

Status Meaning
404 The session does not exist, it is past the 90 day retention, or it has no history.
409 The session is still running or waiting. The body is {"error": "session_running"}.

The file is gzip-compressed JSON:

{
  "session_id": "3f6c2a1e-0000-0000-0000-000000000000",
  "messages": [
    { "type": "user", "timestamp": "2026-11-30T10:30:00Z", "payload": { "text": "..." } },
    { "type": "assistant", "timestamp": "2026-11-30T10:30:04Z", "payload": { "content": [ { "type": "text", "text": "..." } ] } }
  ]
}

Each entry in messages has the same shape as an entry returned by the history endpoint.

Example with curl:

URL=$(curl -s -H "Authorization: Bearer $LC_JWT" -H "X-LC-OID: $LC_OID" \
  https://ai.limacharlie.io/v1/org/sessions/$SESSION_ID/history/full | jq -r .url)
curl -s "$URL" -o ai-session-$SESSION_ID.json.gz

CLI

# Save the full transcript to ai-session-<id>.json.gz
limacharlie ai session history --id <SESSION_ID> --full

# Choose the file name
limacharlie ai session history --id <SESSION_ID> --full --output transcript.json.gz

# Write plain JSON to stdout
limacharlie ai session history --id <SESSION_ID> --full --output - | jq '.messages | length'

Without --full, the command returns the recent window. When the session has more history than the window, the CLI prints one line on stderr that points you to --full.

The CLI download works for org sessions. For your own chats, use the API or the web console.

In the Python SDK, the AI class has get_session_full_history_url(session_id) to get the link, and download_session_full_history(session_id, path) to save the file.

Web console

Open an ended session in the AI sessions view and select Download full session. The button is disabled while the session is running.

When a session is truncated, the transcript starts with a notice: "Showing the most recent part of this session. Download the full session for everything."

See also