Summarization Chain not summarizing

My summarization chains takes the following input with 12 items:

[
{...}, // 10 items
{...}, // 10 items
]

I then use this configuration:

My Individual Summary Prompt is to take the input variables and “Return a single line of valid JSON ONLY, no code-block fences.”

The Final Prompt to Combine is to take the {text} and take the “provided below as a JSON array, create one concise daily summary report for all”

However, I get this everytime:

How can I fix this? isn’t the purpose of this summarization chain to summarize into one output using an llm?

2 Likes

Bumping this

Thanks from mentioning this one, I am facing the same

Summary

  • I am using the “Summarization Chain” node to help me prepare internal communication based on my latest Slack activity → I want to get first draft of internal communication based on this content

Steps to reproduce

  1. Add a node with data in an array
  2. Add a node “Summarization Chain” linked to a model sub-node
  3. Add option to “Summarization Method and Prompts > Map reduce”

Current result

Expected result

Yeah sadly, I didn’t hear back from support and trial ended so I guess we will wait

Hi!

As is normal with the nodes in n8n, it processes each item individually. So it takes each item (in the last example, there were three items passed into the node), and it summarizes each item.

If you want to prevent that behavior, make sure to merge your items first.

The “map reduce” strategy is there for each item individually, and what it does is to split an item into smaller chunks (to make sure it fits in your context window), and then summarizes each chunk. All chunks are then passed to your LLM to be summarized in total.

This means that you get a summary for each item you pass in to the node. You may see a bunch of LLM calls per item, which is expected if you chunk everything.

To reduce the number of LLM calls, you can increase the number of characters per chunk.

Hope this helps!

1 Like

Ah yes - I understand.

To rephrase: default behavior is for multiple items is to loop over them by default as input nodes.
Therefore, on this example, it is expected to have an output with a summary per item.

To prevent this, I should merge the items first.
I will try it out and report back. Thanks a lot!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.