Mastra Launches SkillSearchProcessor to Cut Agent Costs
Mastra has released SkillSearchProcessor, allowing AI agents to load skills on demand to minimize context bloat, lower token usage, and reduce operational costs.

Mastra has introduced a new feature called SkillSearchProcessor to help developers optimize their AI agents. Available in version 1.18.0 or later of the Mastra core library, this update addresses the common issue of context bloat. Previously, Mastra workspaces relied on a default SkillsProcessor, which exposed every available skill to an agent during every single turn of a conversation. While functional, this approach quickly filled the agent's context window, leading to high token usage and increased API costs as conversations progressed.
The new SkillSearchProcessor resolves this by allowing agents to search for and load skills only when they are needed. It introduces two primary tools to the agent's toolkit: search_skills and load_skill. The search tool locates relevant skills using vector, bm25, or hybrid search methods based on keywords. Once the agent identifies the correct skill, it uses the load tool to inject those specific instructions into the active thread.
Developers can configure the processor within their workspaces by setting up a local filesystem and a skills directory. The processor accepts several configuration parameters, including topK to cap search results, minScore to establish a minimum relevance threshold, and a configurable time-to-live setting. By default, loaded skills remain in the thread state for one hour before they are automatically cleaned up, though developers can adjust this duration to fit their application's needs.
For AI practitioners, this update represents a significant shift in how agent memory and capabilities are managed. While there is a minor latency cost during the very first lookup of a skill, subsequent turns in the conversation benefit from a much smaller context window. This optimization directly translates to faster response times and lower token bills for complex, multi-turn agentic workflows. The feature was officially introduced in pull request 14596 of the Mastra repository.
This is our own summary of reporting by Mastra Blog


