Hi team, I have a question about how to handle cas...
# koog-agentic-framework
t
Hi team, I have a question about how to handle cases where tools return very large responses. When sending the tool results back to the model, the input sometimes exceeds the maximum token limit. My current approach is to truncate or reduce the output from the tools, but this can lead to loss of important information. Are there any better alternative solutions?
d
Make your tools have a finer granularity, and let your agent "decide" what it needs and call multiple tools accordingly. (For example, Koog's file list tool shows the line count of files, while Koog's file read tool allows start and end locations to read part of a file.) Use summarization and fact extraction regularly, to let the agent "decide" what information is important relative to your task.
t
Hi. Thanks for your answer. As I understand it, instead of creating a single tool that returns a large response, I should create multiple smaller tools that each return a part of the response, provide them to the agent, and let the agent decide which tools it should call. Please correct me if I’m wrong.
👍 1
d
Yep, exactly! 😊
kodee greetings 1