Solving Context Window Overflow in AI Agents
Anton Bulle Labate, Valesca Moura de Sousa, Sandro Rama Fiorini, Leonardo Guerreiro Azevedo, Raphael Melo Thiago, Viviane Torres da Silva

TL;DR
This paper presents a novel method for LLMs to handle arbitrarily large tool outputs by using memory pointers, enabling complete data processing without overflow, reducing token usage, and improving workflow efficiency in knowledge-intensive tasks.
Contribution
It introduces a memory pointer-based approach that allows LLMs to process unlimited tool responses, overcoming context window limitations in complex workflows.
Findings
Method reduces token usage by approximately seven times.
Successfully applied to a real-world Materials Science task.
Both traditional and proposed methods succeed in experiments.
Abstract
Large Language Models (LLMs) have become increasingly capable of interacting with external tools, granting access to specialized knowledge beyond their training data - critical in dynamic, knowledge-intensive domains such as Chemistry and Materials Science. However, large tool outputs can overflow the LLMs' context window, preventing task completion. Existing solutions such as truncation or summarization fail to preserve complete outputs, making them unsuitable for workflows requiring the full data. This work introduces a method that enables LLMs to process and utilize tool responses of arbitrary length without loss of information. By shifting the model's interaction from raw data to memory pointers, the method preserves tool functionality, allows seamless integration into agentic workflows, and reduces token usage and execution time. The proposed method is validated on a real-world…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning in Materials Science · Scientific Computing and Data Management · Explainable Artificial Intelligence (XAI)
