MastraM
Mastra10mo ago
Omicrxn

[AgentNetworks] Unable to execute agent, model context length

Hey! I started playing with networks as promised yesterday and got the first issues. So i converted A workflow I had into an agent network to see how well it performed, I gave it two simple agents, one researches on the internet, another creates and structure the data. There is an issue with the first one that after running it sais the following:

[Information_Retrieval_Agent]: Unable to execute agent "Information_Retrieval_Agent": This model's maximum context length is 128000 tokens. However, your messages resulted in 251186 tokens (250555 in the messages, 631 in the functions). Please reduce the length of the messages or functions.


this didn't happen once on the workflow, also isn't the agent suppose to generate the response based on the context? Why is this error happening? It is not something that happens always, I executed a run again and it worked well.
Was this page helpful?