How can I insert a message list JSON into the agent and make it as the context?

Describe the problem/error/question

How can I insert a message list JSON into the agent and make it as the context?

I just want to pass it to the agent as a temporary message context.

hey @blowsnow Welcome to the n8n community!

I think if you just use the simple memory option and connect it to the ai agent, it will retain the context of the conversation you are having with the ai agent.

Let me know if this helps or if i’m misunderstanding the problem.

Hi @blowsnow Welcome!
You can do something like this:

This can help you give JSON as a context to your AI Agent, hope this helps.

I think Chat Memory Manager node is what you are looking for:

You could try adding a Chat Memory Manager node with an If node before the agent node, depending on your logic..