Repository navigation
ctxkeeper lets an AI agent keep working on one long task after its conversation has grown far past what the model can read at once, without forgetting what it was told.
It is a small proxy between your agent (or chat app) and any OpenAI-compatible model server: vLLM, llama.cpp, SGLang and others. Your agent keeps sending its whole history; the model is shown a short, current view of it: the opening instructions, notes it keeps up to date (standing rules, current facts, open questions) and the newest turns. Everything older is archived word for word on disk and the model gets a recall tool to search it. Python 3.10+, standard library only.
1.2.0 carries the fixes and options from the lab's two-million-token hostile campaigns (39-49), where forged notices and quiet retroactive corrections are planted in the stream. On both seeds (lab campaign 49, hash-bound public audits): 421/423 and 417/423, 16/16 corrections applied on both seeds; every forged line the notes carried was flagged, and no forged value, method, rule or removal was ever adopted. Two of 97 forgery-target answers slipped on silent arithmetic while the notes held the right value, so the lab's strictest preregistered bar is not claimed. The per-step record is in the README's Changes section.
Release gate (lab campaign 50, 2026-10-20) — these exact assets, installed exactly as below:
- pip from this page's wheel into a fresh venv, then the bug-fixing task through a separate agent program (
--recipe qwen, nothing else): 40/40 fixed, 40/40 following every rule, 7/7 questions, 12 minutes - the 300K-token demo through a Docker image built from this page's source archive (longer than the server's own window): 4/4
- the README's OpenAI SDK example: plain reply, tool call and streaming all in the SDK's types
- Gemma 4 26B on llama.cpp, 100K demo: 4/4 (one smoke run, not a measurement)
Install
R=https://github.com/steveseguin/b70-optimization-lab/releases/download/ctxkeeper-v1.2.0
# pip (gives you the `ctxkeeper` command)
python3 -m venv .venv-ctxkeeper && . .venv-ctxkeeper/bin/activate
python -m pip install "$R/ctxkeeper-1.2.0-py3-none-any.whl"
# Docker
docker build -t ctxkeeper $R/ctxkeeper-1.2.0.tar.gz
# or just the two files
curl -LO $R/ctxkeeper.py && curl -LO $R/notesdelta.pyVerify against SHA256SUMS below. Guide and test results: https://skindeep.ai/context-use.html · Source: tools/ctxkeeper