Skip to content
Last updated

In-Session Memory

WebDesktopMobile

Long analysis sessions stay productive because Studio manages the AI's context window for you. When a conversation grows large enough to approach the model's context limit, Studio automatically compacts older exchanges into a summary — the AI keeps working without losing the decisions, query results, and segment logic that matter. There is nothing to configure and no command to run.

Note

Compaction is automatic. It runs in the background when the conversation approaches the context limit, preserving key context (decisions, query results, schema definitions) while summarizing the rest. You do not trigger it and cannot tune what it keeps.

Objective

Keep long-running sessions productive by understanding how the context window fills, recognizing when automatic compaction has occurred, and structuring your work so the AI always has room for the task at hand.

Prerequisites


How Context Works

Every message you send and every response the AI generates adds to the context window. This includes:

  • Your messages and the AI's replies
  • Tool call inputs and outputs (query results, file contents, API responses)
  • System messages and status updates

The AI can only reference content within the current context window. As the conversation fills that window, Studio uses auto-compaction to summarize older content and free space for new exchanges.

Auto-Compaction

When the conversation approaches the context limit, Studio compacts older messages automatically. This happens in the background, and the conversation continues without interruption.

What You See

When compaction completes, two elements appear in the chat:

  1. A "Context compacted" marker — a small centered pill, marked with an amber dot, showing how many tokens were compacted:

    "Context compacted ({tokens} tokens)"

  2. A "Conversation summary" card — a collapsible summary of the compacted portion. Expand it to read the full text. The summary captures the key decisions, results, and context carried forward from the earlier messages.

The original messages stay visible in the chat history. They are simply no longer part of the AI's active context — the summary stands in for them when the AI generates its next responses.

Cross-Conversation Memory

Compaction manages a single conversation. To carry context across conversations, use a work folder. A work folder keeps a server-side instructions file that the AI reads at the start of every chat in that work folder, and can update as work progresses. This carries standing context — table names, conventions, goals — across sessions without you restating it.

Best Practices for Long Sessions

For Data Analysts

  1. Use work folders to carry context across chats. Rather than extending one conversation indefinitely, create a work folder and start new chats within it. The work folder's instructions stay available across sessions.

  2. Start a fresh chat when you pivot. Finishing a query-exploration phase and moving on to build segments or set up activations? A new chat gives the next phase the full context window instead of carrying forward exploration that no longer matters.

  3. Watch for large tool outputs. Query results, file contents, and API responses consume significant context. If a query returns a large result set, the AI may summarize it rather than keep the full output in context.

  4. Review the conversation summary. After compaction, expand the summary to confirm that key information (table schemas, column definitions, segment logic) was preserved. If something important was dropped, re-query or re-state it.

For Marketers

  1. Start a new chat for each distinct task. Audience building, journey creation, and activation setup are best handled in separate conversations, each with the full context window available.

  2. Let Studio handle the rest. For most campaign and activation workflows, you never need to think about context — compaction is automatic.

Differences from Treasure Studio Labs

FeatureTreasure Studio LabsTreasure AI Studio
Context managementLocal context windowServer-side context with automatic compaction
Compaction feedbackNoneVisual "Context compacted" marker and an expandable conversation summary
Cross-session memoryWork folder instructions persisted locallyWork folder instructions persisted server-side; the AI reads and updates the work folder instructions file to carry standing context (table names, conventions, goals) across conversations in the same work folder

Verification

  • In a long conversation, after the window approaches its limit, see a "Context compacted" marker followed by an expandable "Conversation summary"
  • Continue the conversation normally, with the AI still referencing key prior decisions

Troubleshooting

IssueSolution
AI "forgot" something from earlierCompaction may have summarized it. Expand the most recent Conversation summary to see what was carried forward, and re-state any critical detail the AI needs
Session feels heavily loadedLarge tool outputs (query results, file contents) fill the window fastest. Start a new chat — inside a work folder if you want the AI to retain access to the prior conversation

Next Steps