repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

extensions/forget/README.md

Raw

forget

Experimental active-context forgetting for Pi.

Install / load

Loaded through the root pi-ext package. See root README.

Commands / tools / settings

Commands: none.

Tools:

Settings: none.

Hooks/events:

Behavior

forget mode="inspect" lists active branch entries. Content previews are hidden by default so inspection does not copy soon-to-be-forgotten text into newer context. The latest user prompt is marked current_user=yes and repeated as current_user_entry_id=... near the top. Use show_preview=true only for debugging.

forget mode="before" entry_id="..." appends a Pi compaction entry. Active LLM context becomes:

  1. a short tombstone summary saying prior context was intentionally forgotten;
  2. branch messages from entry_id onward;
  3. future messages.

History is not physically deleted from the JSONL session file. It is removed from the active context path by Pi compaction semantics and can be recovered through tree/session history.

Forget is a context-budget tool, not a secrecy/redaction tool. If sensitive text appears in the current request, assistant reasoning, tool results, or later messages, Forget cannot remove that middle/newer span without also dropping the newer branch.

Middle deletion is intentionally unsupported.

The injected reminder is intentionally turn-local system prompt text, not a stored reminder message. It costs a short line each turn but does not accumulate inside the session transcript.

Markdown source
File outline
# forget

Experimental active-context forgetting for Pi.

## Install / load

Loaded through the root `pi-ext` package.
See [root README](../../README.md).

## Commands / tools / settings

Commands:
none.

Tools:

- `forget`:
  inspect active branch or forget all context before an entry.

Settings:
none.

Hooks/events:

- `before_agent_start`: injects one short reminder so the agent considers Forget
  when a new user prompt changes task/objective.

## Behavior

`forget mode="inspect"` lists active branch entries. Content previews are hidden
by default so inspection does not copy soon-to-be-forgotten text into newer
context. The latest user prompt is marked `current_user=yes` and repeated as
`current_user_entry_id=...` near the top. Use `show_preview=true` only for
debugging.

`forget mode="before" entry_id="..."` appends a Pi compaction entry. Active LLM
context becomes:

1. a short tombstone summary saying prior context was intentionally forgotten;
2. branch messages from `entry_id` onward;
3. future messages.

History is not physically deleted from the JSONL session file. It is removed from
the active context path by Pi compaction semantics and can be recovered through
tree/session history.

Forget is a context-budget tool, not a secrecy/redaction tool. If sensitive text
appears in the current request, assistant reasoning, tool results, or later
messages, Forget cannot remove that middle/newer span without also dropping the
newer branch.

Middle deletion is intentionally unsupported.

The injected reminder is intentionally turn-local system prompt text, not a
stored reminder message. It costs a short line each turn but does not accumulate
inside the session transcript.