[flagged]
How Compaction Works in Pi
21–30 of 100 posts
Re: How Compaction Works in Pi
#22For example, sometimes context will be taken up by a side tangent, tool call outputs, or low-value codebase exploration.
Much of the time, I prefer to preserve the history of my conversation instead of summarizing it. I find summarized conversations lead to more frustrating future chats because the LLM misses intent and or context. (Or, the presence of paragraphs and paragraphs of LLM output makes the next token predictor dumber? Unsure.)
Re: How Compaction Works in Pi
#23Re: How Compaction Works in Pi
#24I don't like any of current solutions when it comes to compaction. I'd love to have a way to say what exactly should be summarized, because most of the time I just need to compact some noisy MCP tool calls, test runs and things like that. Just let me pick what should be summarized and keep the rest as is.
Sounds like you might like subagents. Agent > subagent receives agent context (presumably cached)->tool call->compact/summarise->return to main agent
Re: How Compaction Works in Pi
#25I expect Pi is mostly used with OpenAI plans, and OpenAI has a dedicated compaction endpoint you should probably be using with their models instead of a compaction prompt.
That said, from reading the pi subreddit I don't see people referencing these much.
Re: How Compaction Works in Pi
#26TLDR: It keeps ~20k tokens of recent conversations, then hands the rest of the conversation to another model with a special system & user prompt. This then fills out a template with relevant information. See: https://github.com/earendil-works/pi/blob/main/packages/codi...
Re: How Compaction Works in Pi
#27Re: How Compaction Works in Pi
#28Opencodes dynamic context pruning works by labeling tools and chat and the rest and the agent can collapse and expand summaries. I get it into 1M+ routinely on local models with operations between 50k-85k
Re: How Compaction Works in Pi
#29Instead of compaction, has anyone seen a successful implementation of pruning? That is, the agent looks at the conversation history and removes any low-value messages. For example, sometimes context will be taken up by a side tangent, tool call outputs, or low-value codebase exploration. Much of the time, I prefer to preserve the history of my conversation instead of summarizing it. I find summarized conversations le…
Re: How Compaction Works in Pi
#30Was expecting the article to go more in-depth. Say, what happens when chain of summaries grows so long, that it still overflows context window. Is summarization runned over the summaries in the context window?