[{"data":1,"prerenderedAt":498},["ShallowReactive",2],{"navigation":3,"\u002Fconcepts\u002Fmulti-agent":169,"\u002Fconcepts\u002Fmulti-agent-surround":493},[4,28,85,127,157],{"title":5,"path":6,"stem":7,"children":8,"icon":27},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17,22],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":23,"path":24,"stem":25,"icon":26},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F4.architecture","i-lucide-layers","i-lucide-rocket",{"title":29,"icon":30,"path":31,"stem":32,"children":33,"page":84},"Concepts","i-lucide-lightbulb","\u002Fconcepts","2.concepts",[34,39,44,49,54,59,64,69,74,79],{"title":35,"path":36,"stem":37,"icon":38},"Durable agents","\u002Fconcepts\u002Fdurable-agents","2.concepts\u002F1.durable-agents","i-lucide-infinity",{"title":40,"path":41,"stem":42,"icon":43},"Glossary","\u002Fconcepts\u002Fglossary","2.concepts\u002F10.glossary","i-lucide-book-a",{"title":45,"path":46,"stem":47,"icon":48},"Restate in five minutes","\u002Fconcepts\u002Frestate-primer","2.concepts\u002F2.restate-primer","i-lucide-cpu",{"title":50,"path":51,"stem":52,"icon":53},"Entities & addressing","\u002Fconcepts\u002Fentities-addressing","2.concepts\u002F3.entities-addressing","i-lucide-at-sign",{"title":55,"path":56,"stem":57,"icon":58},"Timelines & events","\u002Fconcepts\u002Ftimelines-events","2.concepts\u002F4.timelines-events","i-lucide-list-ordered",{"title":60,"path":61,"stem":62,"icon":63},"Projections & the catalog","\u002Fconcepts\u002Fprojections-catalog","2.concepts\u002F5.projections-catalog","i-lucide-database",{"title":65,"path":66,"stem":67,"icon":68},"Workspaces & execution","\u002Fconcepts\u002Fworkspaces","2.concepts\u002F6.workspaces","i-lucide-terminal",{"title":70,"path":71,"stem":72,"icon":73},"Harnesses","\u002Fconcepts\u002Fharnesses","2.concepts\u002F7.harnesses","i-lucide-plug",{"title":75,"path":76,"stem":77,"icon":78},"Multi-agent patterns","\u002Fconcepts\u002Fmulti-agent","2.concepts\u002F8.multi-agent","i-lucide-network",{"title":80,"path":81,"stem":82,"icon":83},"Lifecycle & control","\u002Fconcepts\u002Flifecycle","2.concepts\u002F9.lifecycle","i-lucide-sliders-horizontal",false,{"title":86,"icon":87,"path":88,"stem":89,"children":90,"page":84},"Guides","i-lucide-book-open","\u002Fguides","3.guides",[91,106],{"title":92,"icon":93,"path":94,"stem":95,"children":96,"page":84},"Agents","i-lucide-bot","\u002Fguides\u002Fagents","3.guides\u002F1.agents",[97,101],{"title":98,"path":99,"stem":100,"icon":93},"Building agents","\u002Fguides\u002Fagents\u002Fbuilding-agents","3.guides\u002F1.agents\u002F1.building-agents",{"title":102,"path":103,"stem":104,"icon":105},"Frontend integration","\u002Fguides\u002Fagents\u002Ffrontend-integration","3.guides\u002F1.agents\u002F2.frontend-integration","i-lucide-monitor",{"title":107,"icon":108,"path":109,"stem":110,"children":111,"page":84},"Operations","i-lucide-server-cog","\u002Fguides\u002Foperations","3.guides\u002F2.operations",[112,117,122],{"title":113,"path":114,"stem":115,"icon":116},"Self-hosting","\u002Fguides\u002Foperations\u002Fself-hosting","3.guides\u002F2.operations\u002F1.self-hosting","i-lucide-server",{"title":118,"path":119,"stem":120,"icon":121},"Auth & API keys","\u002Fguides\u002Foperations\u002Fauth-api-keys","3.guides\u002F2.operations\u002F2.auth-api-keys","i-lucide-key-round",{"title":123,"path":124,"stem":125,"icon":126},"Backup & restore","\u002Fguides\u002Foperations\u002Fbackup-restore","3.guides\u002F2.operations\u002F3.backup-restore","i-lucide-database-backup",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":84},"Reference","i-lucide-book-marked","\u002Freference","4.reference",[133,138,143,148,153],{"title":134,"path":135,"stem":136,"icon":137},"Event schema","\u002Freference\u002Fevents","4.reference\u002F1.events","i-lucide-list-tree",{"title":139,"path":140,"stem":141,"icon":142},"Addressing","\u002Freference\u002Faddressing","4.reference\u002F2.addressing","i-lucide-map-pin",{"title":144,"path":145,"stem":146,"icon":147},"Gateway HTTP API","\u002Freference\u002Fgateway-api","4.reference\u002F3.gateway-api","i-lucide-webhook",{"title":149,"path":150,"stem":151,"icon":152},"CLI","\u002Freference\u002Fcli","4.reference\u002F4.cli","i-lucide-square-terminal",{"title":154,"path":155,"stem":156,"icon":83},"Configuration","\u002Freference\u002Fconfiguration","4.reference\u002F5.configuration",{"title":158,"path":159,"stem":160,"children":161,"icon":163},"Contributing","\u002Fcontributing","5.contributing\u002F1.index",[162,164],{"title":158,"path":159,"stem":160,"icon":163},"i-lucide-git-pull-request",{"title":165,"path":166,"stem":167,"icon":168},"The package map","\u002Fcontributing\u002Fpackage-map","5.contributing\u002F2.package-map","i-lucide-boxes",{"id":170,"title":75,"body":171,"description":486,"extension":487,"links":488,"meta":489,"navigation":490,"path":76,"seo":491,"stem":77,"__hash__":492},"docs\u002F2.concepts\u002F8.multi-agent.md",{"type":172,"value":173,"toc":476},"minimark",[174,191,196,213,217,220,230,236,240,264,270,274,277,360,371,375,390,394,419,458,462,472],[175,176,177,178,182,183,186,187,190],"p",{},"Multi-agent coordination in teaspill is three primitives: ",[179,180,181],"strong",{},"spawn"," a child, ",[179,184,185],{},"send"," a message, ",[179,188,189],{},"observe"," what others are doing. Everything else on this page is a pattern built from those three.",[192,193,195],"h2",{"id":194},"the-golden-rule","The golden rule",[175,197,198,199,203,204,207,208,212],{},"Worth restating from ",[200,201,202],"a",{"href":36},"the wake model",", because every pattern below leans on it: ",[179,205,206],{},"spawn returns the child's id immediately — never its result."," The child runs concurrently; its result arrives later as a ",[209,210,211],"code",{},"child_finished"," message that wakes the parent. An agent that has delegated everything it can ends its turn, and the platform wakes it when there is news.",[192,214,216],{"id":215},"fan-out-gather","Fan-out \u002F gather",[175,218,219],{},"The workhorse pattern: split a task across N children in one wake, gather results as they arrive, finish when all are in.",[221,222,227],"pre",{"className":223,"code":225,"language":226},[224],"language-text","wake 1      spawn_agent × 3         → three child ids, immediately\n            wait()                  → turn ends\n\nwakes 2–4   child_finished arrives  → record the result in state,\n            (one wake per child)      count 1\u002F3 … 2\u002F3 … 3\u002F3\n\nfinal wake  all results present     → finish(combined result)\n","text",[209,228,225],{"__ignoreMap":229},"",[175,231,232,233,235],{},"The children run concurrently with each other and with anything else the parent does. Order of completion doesn't matter — each ",[209,234,211],{}," is its own wake, and the parent's state (a counter, a list of findings) carries the gather across wakes.",[192,237,239],{"id":238},"pipeline","Pipeline",[175,241,242,243,246,247,250,251,254,255,258,259,263],{},"For staged work, chain instead of fanning out: each agent ",[209,244,245],{},"send_message","s its output to the next stage and finishes. A ",[209,248,249],{},"researcher"," hands findings to a ",[209,252,253],{},"summarizer",", which hands a draft to a ",[209,256,257],{},"reviewer",". No stage waits on another — each sleeps until its input arrives, and the pipeline's state ",[260,261,262],"em",{},"is"," the messages in flight, all durable.",[175,265,266,267,269],{},"The alternative shape — a parent orchestrating each stage in sequence, spawning stage N+1 when stage N's ",[209,268,211],{}," arrives — trades a little latency for one place that sees the whole flow. Both are idiomatic; prefer the orchestrator when you want one timeline that tells the whole story.",[192,271,273],{"id":272},"deterministic-spawn","Deterministic spawn",[175,275,276],{},"A parent that might retry — or that must never double-create a worker — supplies the child's id itself, derived from the task:",[221,278,282],{"className":279,"code":280,"language":281,"meta":229,"style":229},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","spawn_agent({ type: \"summarizer\", args: { text }, id: `summary-of-${articleId}` })\n","ts",[209,283,284],{"__ignoreMap":229},[285,286,289,293,297,301,305,308,311,314,317,320,323,325,328,331,334,337,339,342,345,348,351,354,357],"span",{"class":287,"line":288},"line",1,[285,290,292],{"class":291},"s2Zo4","spawn_agent",[285,294,296],{"class":295},"sTEyZ","(",[285,298,300],{"class":299},"sMK4o","{",[285,302,304],{"class":303},"swJcz"," type",[285,306,307],{"class":299},":",[285,309,310],{"class":299}," \"",[285,312,253],{"class":313},"sfazB",[285,315,316],{"class":299},"\"",[285,318,319],{"class":299},",",[285,321,322],{"class":303}," args",[285,324,307],{"class":299},[285,326,327],{"class":299}," {",[285,329,330],{"class":295}," text ",[285,332,333],{"class":299},"},",[285,335,336],{"class":303}," id",[285,338,307],{"class":299},[285,340,341],{"class":299}," `",[285,343,344],{"class":313},"summary-of-",[285,346,347],{"class":299},"${",[285,349,350],{"class":295},"articleId",[285,352,353],{"class":299},"}`",[285,355,356],{"class":299}," }",[285,358,359],{"class":295},")\n",[175,361,362,363,366,367,370],{},"Spawning the same ",[209,364,365],{},"(type, id)"," twice reattaches to the same child instead of creating a duplicate (",[200,368,369],{"href":51},"how reattach behaves","). This makes \"one worker per subtask\" a naming convention instead of bookkeeping code.",[192,372,374],{"id":373},"watching-another-agent","Watching another agent",[175,376,377,378,381,382,385,386,389],{},"Observation doesn't need messages. Any agent's ",[200,379,380],{"href":61},"catalog"," row — type, status, parent, tags — is subscribable, and its ",[200,383,384],{"href":56},"timeline"," is readable, by UIs and backends alike. A dashboard watching a fleet of workers is a catalog subscription; an audit view of one worker is its timeline. Agents themselves get ",[209,387,388],{},"list_children()"," for a snapshot of their own children's status.",[192,391,393],{"id":392},"what-arrives-on-a-parents-wake","What arrives on a parent's wake",[175,395,396,397,399,400,403,404,403,407,410,411,414,415,418],{},"When a child finishes, the parent's next wake carries a ",[209,398,211],{}," message with the child's id, its outcome (",[209,401,402],{},"success",", ",[209,405,406],{},"error",[209,408,409],{},"interrupted",", or ",[209,412,413],{},"archived","), and whatever result the child passed to ",[209,416,417],{},"finish",". Messages from non-child agents arrive as ordinary messages tagged with the sender's entity URL. Either way it arrives as an ordinary wake — the parent's harness sees the news as input and acts on it.",[420,421,422,425],"warning",{},[175,423,424],{},"Three anti-patterns, all versions of fighting the wake model:",[426,427,428,439,452],"ul",{},[429,430,431,434,435,438],"li",{},[179,432,433],{},"Don't wait synchronously for a child."," There is nothing to wait ",[260,436,437],{},"on"," — spawn, end the turn, and the result wakes you.",[429,440,441,444,445,448,449,451],{},[179,442,443],{},"Don't poll."," An agent that re-checks ",[209,446,447],{},"list_children"," in a loop is burning turns to learn what a ",[209,450,211],{}," wake would have told it for free.",[429,453,454,457],{},[179,455,456],{},"Don't use timelines as a message bus."," Timelines are history — one agent reading another's timeline to decide what to do next recreates the coupling teaspill removes. Coordination is messages; timelines are for reading the story afterward.",[192,459,461],{"id":460},"next-steps","Next steps",[175,463,464,465,468,469,471],{},"Patterns cover agents talking to each other — including steering a busy peer mid-run. For intervening from the ",[260,466,467],{},"outside"," — interrupting, pausing, archiving — continue to ",[200,470,80],{"href":81},", which also covers where steer fits.",[473,474,475],"style",{},"html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":229,"searchDepth":288,"depth":477,"links":478},2,[479,480,481,482,483,484,485],{"id":194,"depth":477,"text":195},{"id":215,"depth":477,"text":216},{"id":238,"depth":477,"text":239},{"id":272,"depth":477,"text":273},{"id":373,"depth":477,"text":374},{"id":392,"depth":477,"text":393},{"id":460,"depth":477,"text":461},"Spawn, send, observe — the whole coordination surface, and the patterns you build with it.","md",null,{},{"icon":78},{"title":75,"description":486},"AMmAXHW206qFo9l0yQpSWokQ1Ao9vs-9uX3Mjua4fcc",[494,496],{"title":70,"path":71,"stem":72,"description":495,"icon":73,"children":-1},"The engine that runs the model loop inside a wake — native for any provider, or Claude Agent SDK for Claude Code semantics.",{"title":80,"path":81,"stem":82,"description":497,"icon":83,"children":-1},"Active, idle, archived — and the four verbs for intervening from outside, including bringing an archived agent back.",1784473423226]