DOC: trim toolmessage #939

Closed
opened 2026-02-20 17:42:26 -05:00 by yindo · 3 comments
Owner

Originally created by @wangsiyu666 on GitHub (Aug 25, 2025).

Issue with current documentation:

How can I elegantly trim tool messages? I am currently facing a difficulty in building a browser use tool, but there are a large number of AIMessages and ToolMessages in the cycle. ToolMessages contain a large number of parsed web page viewport elements, which is not very user-friendly for me. There are also a large number of tokens and slow generation.

Idea or request for content:

No response

Originally created by @wangsiyu666 on GitHub (Aug 25, 2025). ### Issue with current documentation: How can I elegantly trim tool messages? I am currently facing a difficulty in building a browser use tool, but there are a large number of AIMessages and ToolMessages in the cycle. ToolMessages contain a large number of parsed web page viewport elements, which is not very user-friendly for me. There are also a large number of tokens and slow generation. ### Idea or request for content: _No response_
yindo added the documentation label 2026-02-20 17:42:26 -05:00
yindo closed this issue 2026-02-20 17:42:26 -05:00
Author
Owner

@wangsiyu666 commented on GitHub (Aug 25, 2025):

Cannot be removed directly. If the information before removal is used, React is likely to restart execution

@wangsiyu666 commented on GitHub (Aug 25, 2025): Cannot be removed directly. If the information before removal is used, React is likely to restart execution
Author
Owner

@sydney-runkle commented on GitHub (Sep 8, 2025):

Perhaps some sort of summarization node? See ref here: https://langchain-ai.github.io/langmem/guides/summarization/?h=summar

We're working on improving these docs on our new docs site!

@sydney-runkle commented on GitHub (Sep 8, 2025): Perhaps some sort of summarization node? See ref here: https://langchain-ai.github.io/langmem/guides/summarization/?h=summar We're working on improving these docs on our new docs [site](https://docs.langchain.com/oss/python/langchain/overview)!
Author
Owner

@ajaraglobaltraders-star commented on GitHub (Sep 16, 2025):

update

@ajaraglobaltraders-star commented on GitHub (Sep 16, 2025): update
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#939