I am building an ai agent in n8n and i am stuck

Hey, I’ am building an ai agent workflow and i am stuck . My is using two OpenAI nodes: one to for the user’s question and a second one to answer it using some data I fetched in between.
The problem is the final node keeps giviing error out because I’m hitting the token limit. All the context from the first ai call and my database is too much for the second one to handle. How do I stop the first AI call from clogging up the chat history of the second one

1 Like

Yes i thought as much but how ?

Yes sir i am using Chat for the first node

thank you sir