Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Automatic context window management
compaction
# Show compaction status praisonai compaction status
praisonai compaction status
╭─ Context Compaction ─────────────────────────────────────────────────────────╮ │ Strategy: sliding │ │ Max Tokens: 8,000 │ │ Preserve Recent: 3 messages │ ╰──────────────────────────────────────────────────────────────────────────────╯
praisonai compaction set sliding
truncate
sliding
summarize
smart
llm_summarize
prune
praisonai compaction stats
from praisonaiagents.compaction import ( ContextCompactor, CompactionStrategy ) compactor = ContextCompactor( max_tokens=4000, strategy=CompactionStrategy.SLIDING, preserve_recent=3 ) messages = [...] # Your conversation history compacted, result = compactor.compact(messages) print(f"Compression: {result.compression_ratio:.1%}")