Re: the lcm_expand(summaryID) tool > Because expansion can recover arbitrarily large volumes of earlier conversation, this tool is restricted to sub-agents spawned via the Task tool; the main agent cannot call it directly. This restriction prevents uncontrolled context growth in the primary interaction loop. What if the lcm_expand is called for a summary that has 1000s of messages that immediately floods the sub-agen…
LCM: Lossless Context Management [pdf]
21–30 of 32 posts
Re: LCM: Lossless Context Management [pdf]
#22Much of this feels like a technical report of what they did, and makes me feel like we've reached the ICO whitepaper phase. I have very similar features in my custom coding agent, they seem pretty common sense to have. Are you really throwing away the compacted history? Saving it doesn't seem like a feature, the opposite seems like a gap. Same for making it available via toos/search, pretty standard stuff. Then too, ADK framework I use handles parallel agents/tools.
Re: LCM: Lossless Context Management [pdf]
#23Do you have any resources or youtube videos that might also help someone understand the lcm context management a bit better. I think there's something to this, but i'm having trouble wrapping my head around it. i learn well with analogies and im trying to really grok the concept here. If there are other ways you could explain it it would be appreciated. mind you i have built my own agents from scratch so im not a tot…
We don't have any other materials yet, but let's see if this lands for you. I can run you through a couple simpler versions of the system, why they don't work, and how that informs our ultimate design.
The most basic part of the system is "two layers". Layer 1 is the "ground truth" of the conversation - the whole text the user sees. Layer 2 is what the model sees, i.e., the active context window.
In a perfect world, those would be the same thing. But, as you know, context lengths aren't long enough for that, so we can't fit everything from Layer 1 into Layer 2.
So instead we keep a "pointer" to the appropriate part of Layer 1 in Layer 2. That pointer takes the form of a summary. But it's not a summary designed to contain all information. It's more like a "label" that makes sure the model knows where to look.
The naive version of the system would allow the main model to expand Layer 2 summaries by importing all of the underlying data from Layer 1. But this doesn't work well, because then you just end up re-filling the Layer 2 context window.
So instead you let the main model clone itself, the clone expands the summary in its context (and can do this for multiple summaries, transforming each into the original uncompressed text), and then the clone returns whatever information the main thread requires.
Where this system would not fully match the capabilities of RLMs is that, by writing a script that calls itself e.g. thousands of times, an RLM has the ability to make many more recursive tool calls than can fit in a context window. So we fix that using operator-level recursion, i.e., we give the LLM a tool, map, that executes arbitrary recursion, without the LLM having to write a custom script to accomplish that.
Hope this helps!
- Clint
Re: LCM: Lossless Context Management [pdf]
#24Very cool! Excited to incorporate this into https://toolkami.com which is built upon RLM. Thanks for the great work!
Re: LCM: Lossless Context Management [pdf]
#25Re: the lcm_expand(summaryID) tool > Because expansion can recover arbitrarily large volumes of earlier conversation, this tool is restricted to sub-agents spawned via the Task tool; the main agent cannot call it directly. This restriction prevents uncontrolled context growth in the primary interaction loop. What if the lcm_expand is called for a summary that has 1000s of messages that immediately floods the sub-agen…
The reason that the volume is potentially arbitrarily large is that one sub-agent can call lcm_expand multiple times - either vertically or horizontally. But that's a process that occurs gradually as the tool is used repeatedly.
This has not been a problem in our testing, but if it were a problem it would be easy to prevent sub-agents from invoking lcm_expand once their context buffer has reached a specified threshold.
Re: LCM: Lossless Context Management [pdf]
#26Re: the lcm_expand(summaryID) tool > Because expansion can recover arbitrarily large volumes of earlier conversation, this tool is restricted to sub-agents spawned via the Task tool; the main agent cannot call it directly. This restriction prevents uncontrolled context growth in the primary interaction loop. What if the lcm_expand is called for a summary that has 1000s of messages that immediately floods the sub-agen…
Another question is, why would earlier conversations need to be stored and recalled? They're irrelevant. Only records of the initial requirements and the work done, or work in progress, needs to be stored.
1. In our use of coding agents, we find that there are often things referenced earlier in the conversation (API keys, endpoint addresses, feedback to the agent, etc.) that it's useful to have persist.
2. This is a general-purpose LLM memory system, which we've just used here to build a coding agent. But it is also designed for personal assistants, legal LLMs, etc.
Re: LCM: Lossless Context Management [pdf]
#27Earlier quoted context omitted.
Riffing on this a little, there’s a few things that would be useful: 1 - global namespace - for the gateway agent/coordinator - would make inspecting results of subagent tasks much more safe and efficient, and all the benefits of precision across compaction boundaries for the main chat thread. I could see giving the subagents access to it, or just prompting them fresh and storing results in the global memory - probab…
Just passed this on to my co-author who is working on the plug-in. Really appreciate the suggestions! We will probably ship a fairly basic version to start, but I think there are a lot of cool things that can be added.
Re: LCM: Lossless Context Management [pdf]
#28Do you have any resources or youtube videos that might also help someone understand the lcm context management a bit better. I think there's something to this, but i'm having trouble wrapping my head around it. i learn well with analogies and im trying to really grok the concept here. If there are other ways you could explain it it would be appreciated. mind you i have built my own agents from scratch so im not a tot…
Hi NWU, We don't have any other materials yet, but let's see if this lands for you. I can run you through a couple simpler versions of the system, why they don't work, and how that informs our ultimate design. The most basic part of the system is "two layers". Layer 1 is the "ground truth" of the conversation - the whole text the user sees. Layer 2 is what the model sees, i.e., the active context window. In a perfect…
Re: LCM: Lossless Context Management [pdf]
#29Re: LCM: Lossless Context Management [pdf]
#30Re: the lcm_expand(summaryID) tool > Because expansion can recover arbitrarily large volumes of earlier conversation, this tool is restricted to sub-agents spawned via the Task tool; the main agent cannot call it directly. This restriction prevents uncontrolled context growth in the primary interaction loop. What if the lcm_expand is called for a summary that has 1000s of messages that immediately floods the sub-agen…
By construction, individual summaries are not typically large enough to overload the context window when expanded. The reason that the volume is potentially arbitrarily large is that one sub-agent can call lcm_expand multiple times - either vertically or horizontally. But that's a process that occurs gradually as the tool is used repeatedly. This has not been a problem in our testing, but if it were a problem it woul…
Summary A = summarise(message 1 to P)
Summary B = summarise(Summary A, message P+1 to Q)
Summary C = summarise(Summary B, message Q+1 to R)
What does calling lcm_expand(Summary C) do? Does it unroll all messages from message 1 to message R or does it unroll to Summary B and message Q+1 to R?> volume is potentially arbitrarily large is that one sub-agent can call lcm_expand multiple times - either vertically or horizontally
I'm assuming from this that it's the latter? In that case, that addresses my concern about not blowing up the context window immediately.