A Bounded-Memory Protocol for Multi-Session LLM Work
Status: superseded by AIS (reference-based context). Context Renormalization held the working knowledge in-band, in a single bounded
context.txtledger rewritten to a fixed budget each session. AIS supersedes that model: it keeps durable knowledge in an associative index and supplies context as references (pointers recalled on demand), so the in-band ledger and the renormalization step become unnecessary. AIS is both the durable store this protocol migrated to when the ledger overflowed, and the retrieve-by-reference mechanism that replaces it. This repository remains for reference.
Context Renormalization is a simple, model-agnostic protocol for maintaining continuity across multiple LLM sessions. Instead of relying on long, slow conversations or re-explaining project history, the method uses a small text file (context.txt) as a bounded knowledge ledger. Each LLM session adds new durable knowledge and rewrites the ledger back down to a fixed size budget.
This repository contains:
- The research paper in PDF form
- A minimal example context.txt
- Illustrations explaining the workflow
- Optional starter templates for your own projects
Working with LLMs over long periods exposes a practical failure mode:
- Browser chat UIs slow down as the DOM tree grows.
- Context windows get filled with redundant history.
- Users restart the chat, losing continuity.
- Knowledge must be manually re-fed into the model.
Context Renormalization solves this by:
- Storing all durable knowledge in a small file.
- Using a strict immutable header to define update rules.
- Rewriting and compressing the knowledge region at every session boundary.
- Keeping the project state portable across models, vendors, and time.
The ledger acts as a "bounded working memory" shared between you and any future LLM instance.
- paper/
- context_renormalization.pdf
- examples/
- sample_context.txt
- images/
- workflow_diagram.png
- profile_icon.png
- templates/
- empty_context_template.txt
- You maintain a file called context.txt.
- The top block is the immutable Control Header.
- Below it is the Knowledge Region, which the LLM is allowed to rewrite.
- At the end of each LLM session, you say: "End of session. Update context according to the control header protocol."
- The LLM:
- Increments the session counter.
- Adds a new session summary.
- Compresses older sessions to fit a fixed character budget.
- Computes a Compression Difficulty Score (CDS).
- The resulting file becomes the starting point for the next session.
This procedure is recursive and deterministic: same input, same output.
The paper proposes creating a formal metalanguage for:
- Header grammar and invariants
- Safety constraints
- Verification of compression steps
- Cross-vendor interoperability
- Ideally to be defined in BNF
This would make Context Renormalization a standardized continuity protocol for LLM systems.
context-renormalization
bounded-memory
llm-continuity
multi-session-llm
recursive-summarization
knowledge-ledger
compression-protocol
model-agnostic
ai-research
human-ai-collaboration
If you reference this work, please cite:
Vasili Gavrilov and ChatGPT 5.1
"Context Renormalization: A Bounded-Memory Protocol for Multi-Session LLM Work."
2025.
You may choose one of the following depending on your preference:
- MIT License (recommended for maximum reuse)
- CC-BY 4.0 (recommended for academic credit)
- Apache 2.0 (recommended when contributions are expected)
Add the license as a LICENSE file at the repository root.
For discussion, feedback, or contributions:
- GitHub Issues
- https://www.facebook.com/profile.php?id=61585168733135