Skip to content

Function: buildAgents()

buildAgents(opts): Promise<BuiltAgents>

Resolve every entry in config.agents into a Mastra Agent instance. When config.agents is omitted the plugin registers a single built-in default analyst so the bare mastra() call still yields a working agent.

Per-agent tool callbacks are invoked once with a typed MastraPlugins index built from registered sibling plugins (currently genie; extend MastraPlugins to surface more).

MastraPluginConfig

PluginContextLike | undefined

string[]

Local skill scan paths (remote skills provisioned to a temp dir at startup) folded into every agent that uses the auto-created default workspace.

Logger

MemoryBuilder

Promise<BuiltAgents>

when config.defaultAgent is set to an id that isn’t in the resolved registry; this is a wiring bug, not a runtime condition.