Enable language models to actively manage their context using memory tools (read, index, note-take, delete). Models receive agency to self-engineer context rather than passively consume pre-staged information, maintaining compact high-quality reasoning states through strategic deletion of irrelevant information while preserving distilled notes.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
The Pensieve Paradigm: Stateful Language Models Mastering Context
version
0.0.2
engine
skillxiv-v0.0.2-claude-opus-4.6
license
MIT
url
https://arxiv.org/abs/2602.12108
keywords
["Stateful Language Models","Context Management","Memory Tools","Long-Horizon Tasks","Active State Engineering"]
description
Enable language models to actively manage their context using memory tools (read, index, note-take, delete). Models receive agency to self-engineer context rather than passively consume pre-staged information, maintaining compact high-quality reasoning states through strategic deletion of irrelevant information while preserving distilled notes.
The Pensieve Paradigm: Stateful Language Models Mastering Context
Problem Context
Current language models passively receive context that humans curate, creating a bottleneck: they cannot adapt information selection to specific reasoning needs. The Pensieve Paradigm shifts agency to the model itself: models receive memory tools and actively manage context throughout long-horizon tasks. The key insight is transforming from monotonic context accumulation (until context window exhaustion) to sawtooth profiles (strategically deleting irrelevant information while preserving high-value summaries).
Core Concept
Models coordinate four memory operations: (1) read: retrieve chunks from document corpus, (2) index: catalog retrieved information, (3) note: take distilled notes on key facts, (4) delete: remove irrelevant context. This maintains a compact, high-quality reasoning state throughout extended tasks. The model gains the "wand" to use memory tools directly (unlike external retrieval systems that manipulate context without model input).
"""
Retrieve relevant document chunks.
Args:
query: Natural language query
num_chunks: Number of chunks to retrieve
Returns:
retrieved_chunks: List of document excerpts
"""
# Simplified: keyword matching (would use semantic search)
for
in
self
sum
for
in
if
0
# Get top-k documents
sorted
lambda
1
True
self
for
in
# Store in memory
for
in
self
self
return
def
index
self,
facts: List[str],
category: str = "general"
"""
Index and catalog facts from current context.
Args:
facts: List of factual statements to index
category: Topic category for organization
"""
When to use: Long-horizon reasoning (100+ steps); information-rich domains; tasks requiring selective fact retention
Hyperparameters:
context_limit: 4K-32K tokens (window size)
cleanup_threshold: 0.7-0.9 (when to trigger compression)
note_importance_weight: 0.5-2.0 (value of notes vs. raw facts)
deletion_incentive: 0.1-0.5 (bonus for removing facts)
Key advantages:
Models adapt information selection to tasks
Maintains compact reasoning state
Handles 100+ step trajectories
Transparent memory operations
Common pitfalls:
Over-deletion → loses important context
Under-deletion → context window exhaustion
Notes too verbose → defeats compression
Tool calls not grounded in actual retrieval
Scaling: Number of documents linearly affects retrieval cost; use semantic indexing for large corpora.
Reference
Paper: https://arxiv.org/abs/2602.12108
Related work: Retrieval-augmented generation, active learning, state management
Benchmarks: Long-horizon question-answering, multi-document reasoning
Metaphor: Pensieve (Harry Potter) — memory tool controlled by the user