Conversation History
Heiryn maintains conversation history per channel so follow-up questions can use earlier context. Normal mention-based conversations share the history of their Discord channel.
Each stored user message retains its Discord author identity, so participants in a shared channel remain distinct. When a request replies to an older message or to one outside the active history, the model also receives a bounded, attributed copy of the reply target. This extra copy is omitted when the target is already the latest message in history.
If Discord does not provide the replied-to message content, the bot stops before inference and asks the requester to use Ask Heiryn on the target message or quote its relevant content directly.
The /ask command and both Ask Heiryn message actions are
one-shot interactions. They receive the selected message and requester
context needed for that request, but do not read, update, or compact channel
history.
Context Budget and Compaction #
Conversation history uses an estimated 128,000-token context budget instead of a fixed number of messages. At the start of a new persistent request, an existing history estimated at 100,000 tokens or more is eligible for automatic compaction. Compaction is never started in the middle of a model's tool loop. It aims to reduce retained context to about 32,000 tokens, leaving room for the new request, tools, and response.
The four most recent complete exchanges remain verbatim. The first complete exchange is also retained when it is estimated at no more than 8,192 tokens, as is the exchange containing the Discord message targeted by the current reply. Eligible exchanges between those protected parts are summarized.
A model may advertise a smaller context window. In that case, its limit also constrains the effective history budget. Selecting a model explicitly keeps that model selected; compaction does not replace it with another model.
Compaction is intentionally lossy. It preserves useful facts, decisions, constraints, participant attribution, unresolved work, and confirmed action outcomes. Older images, files, tool calls, and lengthy quoted material may be represented by a concise description rather than their original content. Recent exchanges remain available verbatim.
Both recent messages and compacted conversation memory are encrypted at rest. Current system, personal, and community instructions are applied separately on every request rather than being copied into the summary.
When automatic compaction is needed, the request's Discord status explicitly says that the conversation context is being compacted instead of saying that the model is thinking. The request has been received and continues once the same background compaction task finishes. Cancelling that waiting request does not cancel or discard the compaction. A later request or Retry can attach to the same task, display the same waiting state, and continue after it finishes. Automatic compaction does not post a separate completion message.
Manual Compaction #
Use the slash-only /compact command to summarize eligible older history
before automatic compaction is required. It works below the automatic
threshold when at least four complete exchanges or about 8,000 estimated
tokens are available for compaction beyond the content that must remain
verbatim. Otherwise, the bot explains that there is not enough history yet.
In servers, /compact requires the Manage Messages permission; bot owners
can always use it. In DMs, it compacts the current user's conversation. The
command refuses to run while a persistent query owns the same channel history,
but an independent one-shot Ask interaction does not block it.
History Expiry #
Conversation history expires automatically after a period of inactivity:
- Public channel history expires after 2 hours and 30 minutes.
- DM and group-DM history expires after 600,000 seconds, or just under 7 days.
- Thread history expires after 25 hours.
Thread history lasts longer because threads are often used for focused, extended conversations.
Clearing History #
Use /reset_history in any channel to immediately clear its recent messages
and compacted memory. This is useful when you want to start a fresh
conversation or when the existing context is no longer relevant.
In servers, this command requires the Manage Messages permission.
Resetting history cancels any compaction for that history internally, without posting a separate compaction-cancellation notice. A persistent query using that history is also cancelled, and its existing Discord status still shows the normal visible cancellation result.
One-shot /ask and Ask Heiryn interactions remain independent:
they neither use nor write the channel history, so resetting that history does
not cancel them. This distinction avoids stopping unrelated work while still
preventing a persistent request from recreating context that a moderator just
cleared.
Moving to Threads #
When a response includes a Move to Thread button, clicking it creates a new thread, or uses an existing one, attached to the original message. The current recent history and compacted memory are copied into the thread, which then maintains an independent history.
This is useful for branching off a conversation without cluttering the main channel.