02Chapter 2: Truncating with a sliding windowThis chapter assumes basic Python, chat API message roles, and the idea that tokens measure text size. A model sees only the messages sent in the current request. Your application must therefore choose which messages fit inside the model's context window.2 min read
03Chapter 3: Maintaining a rolling summary over timeAssume you know Python, chat message roles, and approximate token counting. A rolling summary compresses older messages into one shorter record. The application keeps that summary and a recent verbatim window.2 min read