Context Window issue with Semantic Recall

I have a tool call that has a very large return object. When the agent processes the result and it was previously was called somewhere in the semantic recall window, I get an context window error. Semantic recall is setup using fastembed and I have memory processors of ToolCallFilter and TokenLimiter. I noticed the ToolCallFilter did not filter anything and obviously the TokenLimiter did not work.

Using "@mastra/core": "^0.24.8" , "@mastra/memory": "0.15.13", and "@mastra/fastembed": "0.10.7". Attached is the input field of the AI trace span for the step: 1, output of chunk: 'error' is :
{
  "type": "error",
  "error": {
    "type": "error",
    "error": {
      "code": "context_length_exceeded",
      "type": "invalid_request_error",
      "param": "input",
      "message": "Your input exceeds the context window of this model. Please adjust your input and try again."
    },
    "sequence_number": 2
  }
}
Was this page helpful?