Problem
During long sessions, context compression removes older messages. Once compressed, those messages are:
- Gone from active context (can't be referenced)
- Not in MEMORY.md (requires explicit extraction)
- Not searchable via session_search (only indexes past sessions)
This creates a "forgetfulness" gap mid-conversation. The agent cannot recall what was discussed earlier in the same session.
Example:
User discusses topic X at 09:30. By 15:30, context compression has removed those messages. If the user asks "what did we say about X earlier?", the agent cannot answer — the context is gone, and session_search won't help because the session hasn't ended yet.
Proposed Solution
A current-session buffer — a rolling archive of messages that were compressed out:
Features:
- Searchable mid-session — tool that queries the buffer:
- Lighter than MEMORY.md — not facts, just raw message history
- Auto-cleanup — buffer is discarded when session ends (already in session_search)
- Token-efficient — stored as text, not in active context
Implementation options:
| Option |
Storage |
Query |
| A. SQLite temp table |
|
SQL LIKE or FTS5 |
| B. Append-only log |
|
grep/ripgrep |
| C. Reuse session DB |
Extend SessionDB with table |
FTS5 |
Related
Alternative: Extend session_search
Current only indexes completed sessions. Could extend it to:
- Index current session in real-time
- Include "current session" results with a flag
But this changes session_search semantics and may not want all transient messages indexed permanently.
Use case: I lost context from 3 hours ago in this conversation. User asked "what did we discuss about Tavily?" and I couldn't recall because compression had already removed those messages from my context window.
Problem
During long sessions, context compression removes older messages. Once compressed, those messages are:
This creates a "forgetfulness" gap mid-conversation. The agent cannot recall what was discussed earlier in the same session.
Example:
User discusses topic X at 09:30. By 15:30, context compression has removed those messages. If the user asks "what did we say about X earlier?", the agent cannot answer — the context is gone, and session_search won't help because the session hasn't ended yet.
Proposed Solution
A current-session buffer — a rolling archive of messages that were compressed out:
Features:
Implementation options:
Related
Alternative: Extend session_search
Current only indexes completed sessions. Could extend it to:
But this changes session_search semantics and may not want all transient messages indexed permanently.
Use case: I lost context from 3 hours ago in this conversation. User asked "what did we discuss about Tavily?" and I couldn't recall because compression had already removed those messages from my context window.