[MEMPALACE][MP-3] Session scratchpad — ephemeral context that survives tool hops #370
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of epic #367 | Depends on #369
Why
Agents lose context between tool calls. When Timmy runs a search, processes results, then needs to act on them, the intermediate findings evaporate. The session scratchpad (L2 in the retrieval order) solves this by providing a lightweight, session-scoped scratch space that persists across tool hops but doesn't pollute the long-term palace.
This is how humans use working memory — you hold a phone number in your head long enough to dial it, then let it go.
Design
Scratchpad Structure
Each entry:
Lifecycle
Key Behaviors
Acceptance Criteria
SessionScratchpadclass with init/append/query/expire methodsPR #380 provides the sovereign backend that closes the scratchpad story.
The scratchpad code (
scratchpad.py) already exists on main. Itspromote_to_palace()function currently shells out to themempalaceCLI — which requires ONNX and a hardcoded binary path.With
sovereign_store.py(PR #380), the remaining wiring is:This is a ~10-line change once PR #380 is merged.