bamboo-compression 2026.4.26

Compression utilities for Bamboo sessions and memory workflows
Documentation

Token budget management for LLM conversations.

This module provides token budget management to prevent context window overflow while maintaining conversation continuity. It implements a hybrid approach combining rolling summary with recent message windowing.

Key Components

  • [types]: Core types like TokenBudget, BudgetStrategy, PreparedContext
  • [counter]: Token counting via BPE tokenizer (tiktoken) or heuristic estimation
  • [segmenter]: Message segmentation preserving tool-call atomicity
  • [limits]: Model context window limits registry
  • [preparation]: Context preparation with budget enforcement
  • [summarizer]: Conversation summarization for context preservation