[GH-ISSUE #5718] [FEAT]: Rework summarize tool #5256

Closed
opened 2026-06-05 14:52:57 -04:00 by yindo · 0 comments
Owner

Originally created by @shatfield4 on GitHub (May 28, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5718

Originally assigned to: @shatfield4 on GitHub.

What would you like to see?

The summarize tool tends to lock up on small local models. We should remove langchain from this tool and do it in a simpler way where we chunk it and prompt the user after 3 chunks if they would like to continue. This will greatly improve the UX on smaller context window models.

When entering the summary loop:

  • Get model context window (if needed again)
  • Chunk the content to be 45% of context window of the model
  • Send these chunks one at a time asking ONLY for the key points of this section
  • Include the previous points in the next loop iteration, but previous points should not make up more than 5% of the window. If it exceeds that truncate the content from the start so that the details of the last chunk summary are appended to the next chunk in case we split in the middle of a piece of content.
  • After 3 chunk loops, before doing chunk 4 if it exists - ask the user if it is OK to continue or if it should skip
  • We can count details/concepts from non-empty newlines?

User Experience:

  • I ask model to do some deep research in an on-demand chat (regular chat)
  • Model finds some VERY verbose website or content
  • Event sent to UI that this content is very long and will need to be summarized
  • chunk logic applied to content -> start processing chunk by chunk
  • if chunks <4 model finishes and returns its bullet list from the tool
  • if more:
    • Model returns to user a requestToolApproval event asking if it is okay to continue
    • Inform the user via this action "There are x more pieces of content I can summarize - Continue?"
    • If they say yes -> continue again without asking through the whole document
    • If they deny -> return the content as it is in its current state.

This should prevent this tool from needlessly locking up the whole UI because it comes across some large content.

Originally created by @shatfield4 on GitHub (May 28, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5718 Originally assigned to: @shatfield4 on GitHub. ### What would you like to see? The summarize tool tends to lock up on small local models. We should remove langchain from this tool and do it in a simpler way where we chunk it and prompt the user after 3 chunks if they would like to continue. This will greatly improve the UX on smaller context window models. When entering the summary loop: - Get model context window (if needed again) - Chunk the content to be 45% of context window of the model - Send these chunks one at a time asking ONLY for the key points of this section - Include the previous points in the next loop iteration, but previous points should not make up more than 5% of the window. If it exceeds that truncate the content from the start so that the details of the last chunk summary are appended to the next chunk in case we split in the middle of a piece of content. - After 3 chunk loops, before doing chunk 4 if it exists - ask the user if it is OK to continue or if it should skip - We can count details/concepts from non-empty newlines? User Experience: - I ask model to do some deep research in an on-demand chat (regular chat) - Model finds some VERY verbose website or content - Event sent to UI that this content is very long and will need to be summarized - chunk logic applied to content -> start processing chunk by chunk - if chunks <4 model finishes and returns its bullet list from the tool - if more: - Model returns to user a `requestToolApproval` event asking if it is okay to continue - Inform the user via this action "There are x more pieces of content I can summarize - Continue?" - If they say yes -> continue again without asking through the whole document - If they deny -> return the content as it is in its current state. This should prevent this tool from needlessly locking up the whole UI because it comes across some large content.
yindo added the enhancementfeature request labels 2026-06-05 14:52:57 -04:00
yindo closed this issue 2026-06-05 14:52:57 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5256