Context management
How PentAGI keeps long flows within the model's context window by summarizing older parts of each agent's chain, and the settings that tune it.
Long flowsflowOne run of PentAGI: a goal, the tasks created from your messages, and everything the agents did along the way. produce more conversation than any model can hold. PentAGI keeps each agentagentAn AI agent of PentAGI: a model with its own prompt, settings and tools that does one kind of work in a flow, such as testing, writing code or searching the web.'s chain within bounds with chain summarization: after every agent turn, older sections are condensed while the most recent ones stay in full unless they outgrow their size limits. If PentAGI knows the model's context window — from its built-in model catalogs, or from a custom endpoint whose model list reports it — and the chain still does not fit, it is compacted once more right before the model call. Ollama models and others with an unknown window get no such step, so lower the sizes below for a model with a small context.
Tuning
The defaults suit most models. Agents and the interactive assistantassistantThe interactive mode: you work with an agent in a chat and decide on the next step together. have separate settings; the assistant keeps more recent history.
| Setting | Agents | Assistant |
|---|---|---|
| Cap the recent sections | SUMMARIZER_ | ASSISTANT_ |
| Recent section size limit | SUMMARIZER_ | ASSISTANT_ |
| Largest single tooltoolWhat an agent acts through: a built-in capability such as the terminal, the isolated browser or web search, or a program in the sandbox such as nmap, metasploit or sqlmap. result | SUMMARIZER_ | ASSISTANT_ |
| Question-answer sections kept | SUMMARIZER_ | ASSISTANT_ |
| Size of those sections | SUMMARIZER_ | ASSISTANT_ |
| Recent sections not condensed | SUMMARIZER_ | ASSISTANT_ |
With false, the recent sections have no size limit of their own, and the single tool result limit does not apply either.
SUMMARIZER_ enables the question-answer strategy (on by default) and SUMMARIZER_ also summarizes your own messages inside it (off by default). Both apply to agents only: the assistant always uses the strategy and never summarizes your messages.
Last updated on