Multi-agent systems
Foundry assembles agents; it does not force one orchestration pattern. Use focused subagents inside a run, mesh calls between durable instances, layered speech agents for S2S and S2V, or background fan-out that returns through shared work.
Choose the smallest boundary
| Primitive | Use it when |
|---|---|
| Subagent | A parent needs an isolated specialist within the same logical run. |
| Typed call | Another component needs a schema-checked function with a known output. |
| Spawn | Work needs a separate run, instance, or conversation now. |
| Background | Work can proceed independently and reconvene later. |
| Mesh | Durable agents need direct, broadcast, or acknowledged messages. |
| Layered voice | A speaking agent delegates reasoning or vision while keeping the live session responsive. |
Provision specialists from the message
subagents: (_agent, { message }) => [
defineSubagent({
name: "critic",
description: "Find concrete weaknesses in proposed brand work",
systemPrompt: "Review the work. Return risks and exact revisions.",
tools: message.text.includes("visual") ? [imageReview] : [],
}),
],
calls: (_agent, ctx) => [
defineCall({
name: "campaign_scope",
input: z.object({ campaign: z.string() }),
output: CampaignScope,
handler: ({ campaign }) => scopeFrom(ctx.workspaceId, campaign),
}),
],Parallel campaigns are conversations, not prompt branches
Create one conversation or workspace task per campaign and run them concurrently up to the application limit. The lead can monitor shared tasks and receive artifacts through the workspace inbox. Sequential dependencies are explicit handoffs; independent work remains parallel.
Layer S2S and S2V agents
The live voice agent can remain a thin conversational layer while Foundry resolves a reasoning agent, visual reviewer, or tool-bearing worker behind it. Calls and message passing are correlated in the same run timeline. The voice transport stays an adapter; the agent definition remains provider-neutral.
Make orchestration visible
Give every handoff a source, target, purpose, conversation, and artifact path. Emit safe work-intent events at milestones. Foundry shows message passing and progress without exposing private hidden reasoning or pretending a stream of low-level logs is a usable explanation.