Solved- Using AI agent to simultaneously consider multiple sets of data?

Newbie to N8N and running into an issue that I’m unable to resolve. I have a chat trigger that feeds into two different AI agents each running a different LLM. The idea is to take the best of each response into a combined response. To do this I merge the responses, and then merge it again with the initial query. This combined data stream is then fed to a third AI agent which is told that the issue to solve comes from the initial query and it should review the two action plans and synthesize a combined plan with the best features, That’s the goal.

Unfortunately what happens is the third AI Agent gets passed a json or table of three things and it acts on each of them independently instead of considering them all together. I can’t seem to fix this, I’ve tried multiple variations of the merge settings. Tried adding an aggregator after the merge, tried changing the prompt instructions for the third AI agent, tried adding memory to the third AI agent. None of it has seemed to help. Is there something obvious I am missing?

Maybe I’ve found the solution. Instead of aggregate I am not trying the summarize action using the concatenate setting. This seems to have merged my first two answers into a single string. Each answer has an identifying label at the start so I think my LLM will understand.

Can confirm, with some juggling around and a few hacky things it now works :slight_smile:

I used a summarize after each merge, although the one after the second merge is not really concatenating anything and instead is essentially renaming the variables but I was having trouble refering to the variables in the third AI Agent I think because of name collisions. With that I can now get the workflow to behave as intended.