slimtoken.prune_context
Prune conversation memory by removing low-value text, retrieving query-relevant entries, summarizing old turns, and enforcing token budgets to produce a ready-to-inject context block.
Instructions
RAG-style context pruning for a memory/conversation store: strip low-value text, retrieve warm entries relevant to a query, sliding-window summarize old turns, and enforce a token budget. Returns a ready-to-inject / prompt block.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | current query for relevance retrieval | |
| cold_data | No | cold memory keyed by category (each value is a list of entries) | |
| max_tokens | No | ||
| warm_entries | Yes | warm/conversation entries (role+content dicts) |