My agent consumes so much tokens for a message

My agent is consuming so much memory, because it uses last 5 previous conversation plus prompt plus user input. So i created separate agents for separate usecases (1 to 6).
I want to reduce the content the conversation by using another agent , before itself the subagents save the response in the memory.
so i want to make the subagents to use it as read only memory . How to do it
Is there any other way to reduce tokens.
is there any way to store reduced reply messages in memory

Hey @RAJESHKANNAN my suggestion, you can add a summarizer agent that shrinks long conversations into short summaries before saving to memory. This way your other agents read only the important points instead of the full chat history, saving lots of memory.

2 Likes

I thought the same, but the agents[1 to 6] that have connected with postgres, automatically saves inside the memory

@RAJESHKANNAN

How many messages do you extract from the database? Decide on a limit for this.

Also, if possible, store data as a vector in PostgreSQL.

last 5 messages

1 Like

Hey @RAJESHKANNAN has the issues been resolved???

1 Like

The problem is all the agent already has been connecetd with the memory directly, so the entire response gets stored on the memory

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