[{"data":1,"prerenderedAt":351},["ShallowReactive",2],{"navigation":3,"\u002Fconcepts\u002Fdurable-agents":169,"\u002Fconcepts\u002Fdurable-agents-surround":346},[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":35,"body":171,"description":339,"extension":340,"links":341,"meta":342,"navigation":343,"path":36,"seo":344,"stem":37,"__hash__":345},"docs\u002F2.concepts\u002F1.durable-agents.md",{"type":172,"value":173,"toc":329},"minimark",[174,178,183,186,189,193,201,204,213,217,224,228,236,259,269,276,280,305,316,320],[175,176,177],"p",{},"A teaspill agent keeps working — and keeps its memory — across process restarts, deploys, and crashes. This page explains the two ideas that make that true: durable execution and the wake model.",[179,180,182],"h2",{"id":181},"the-problem-your-agents-process-can-die-mid-run","The problem: your agent's process can die mid-run",[175,184,185],{},"An AI agent is a long chain of work: a model call, a few tool calls, another model call, maybe a sub-agent or two. Any link in that chain can take minutes. If the process dies partway — a crash, a deploy, a laptop lid closing — an ordinary agent loses everything in flight. Retrying from the top is worse than losing it: side effects run twice, sub-agents get duplicated, and the conversation forgets what already happened.",[175,187,188],{},"teaspill removes this problem at the platform layer, so you never write recovery code in an agent.",[179,190,192],{"id":191},"durable-execution","Durable execution",[175,194,195,196,200],{},"Durable execution is a way of running code as a journal of recorded steps: if the process dies, the run resumes from the last completed step instead of starting over. teaspill gets this from ",[197,198,199],"a",{"href":46},"Restate",", an open-source durable-execution engine that runs as part of the stack — you don't need to learn it to use teaspill.",[175,202,203],{},"Every model call and every tool call an agent makes is one of those recorded steps. After a crash, the run replays its journal, skips everything already done, and continues from where it stopped — same conversation, same partial results, no repeated side effects.",[205,206,207],"note",{},[175,208,209,210,212],{},"How Restate does this, and what a \"virtual object\" is, is covered in ",[197,211,45],{"href":46},".",[179,214,216],{"id":215},"one-agent-one-object","One agent, one object",[175,218,219,220,223],{},"Each agent is a single named object that processes one thing at a time. Two messages sent to the same agent never race each other: they are handled in order, one turn after another. That one-at-a-time rule sounds restrictive, but it is what makes an agent's recorded history — its ",[197,221,222],{"href":56},"timeline"," — trustworthy: there is exactly one order of events, and everyone who reads it sees the same one.",[179,225,227],{"id":226},"the-wake-model","The wake model",[175,229,230,231,235],{},"A ",[232,233,234],"strong",{},"wake"," is one turn of an agent's life. Something arrives — a message or a finished child — and the agent wakes: it does some work (maybe calls the model, maybe spawns children), then goes back to sleep. Agents never block or poll. Anything an agent is waiting for arrives as a later wake.",[175,237,238,239,242,243,247,248,251,252,258],{},"The part that surprises people: ",[232,240,241],{},"nothing in a wake ever waits synchronously."," When our ",[244,245,246],"code",{},"researcher"," agent spawns a ",[244,249,250],{},"summarizer"," child, the spawn returns the child's id immediately — never its result. The researcher then ends its turn, and the summarizer's result arrives later as a ",[197,253,255],{"href":254},"\u002Fconcepts\u002Fglossary#child_finished",[244,256,257],{},"child_finished"," message that starts a new wake:",[260,261,266],"pre",{"className":262,"code":264,"language":265},[263],"language-text","wake 1   spawn_agent(\"summarizer\", …)   → returns the child's id, immediately\n         wait()                         → the turn ends; the researcher sleeps\n\n         … minutes pass; the process may restart; nothing is lost …\n\nwake 2   child_finished arrives with the summary → the researcher finishes\n","text",[244,267,264],{"__ignoreMap":268},"",[175,270,271,272,275],{},"The ",[244,273,274],{},"wait"," call is not a pause — it returns immediately and ends the turn. Sleeping agents cost nothing and hold nothing open; the platform re-wakes them when there is something to do.",[179,277,279],{"id":278},"what-this-buys-you","What this buys you",[281,282,283,290,296],"ul",{},[284,285,286,289],"li",{},[232,287,288],{},"Agents survive deploys."," Restart your agent service mid-run and in-flight work resumes; sleeping agents don't even notice.",[284,291,292,295],{},[232,293,294],{},"No polling loops."," An agent that is waiting isn't running. There is no \"check every five seconds\" code anywhere.",[284,297,298,301,302,304],{},[232,299,300],{},"A trustworthy record."," Because each agent processes one turn at a time, everything it does lands on its ",[197,303,222],{"href":56}," in one definite order that your UI can replay.",[306,307,308],"accordion",{},[309,310,313],"accordion-item",{"icon":311,"label":312},"i-lucide-microscope","Under the hood: what exactly gets recorded",[175,314,315],{},"Each wake runs as a journaled invocation: every model call and every side-effecting tool call is a recorded step, and replay after a crash skips steps that already completed. Side-effecting tool calls additionally carry an idempotency key built from the agent, the run, and the specific tool call — so even if a step is retried at a coarser granularity, the effect (spawning a child, running a command) happens exactly once. Timers and inter-agent messages are durable too: a wake that was due before a crash is still due after it.",[179,317,319],{"id":318},"next-steps","Next steps",[175,321,322,323,325,326,328],{},"Two pages complete this picture: ",[197,324,45],{"href":46}," explains the machinery underneath, and ",[197,327,80],{"href":81}," covers what happens between wakes — idling, archiving, and coming back.",{"title":268,"searchDepth":330,"depth":331,"links":332},1,2,[333,334,335,336,337,338],{"id":181,"depth":331,"text":182},{"id":191,"depth":331,"text":192},{"id":215,"depth":331,"text":216},{"id":226,"depth":331,"text":227},{"id":278,"depth":331,"text":279},{"id":318,"depth":331,"text":319},"How teaspill agents survive crashes, restarts, and deploys — and the wake model that shapes every turn of their life.","md",null,{},{"icon":38},{"title":35,"description":339},"xd49-azSNcMWr3ugs5agfrV7nwAdwFJWE2bON_EEwAc",[347,349],{"title":23,"path":24,"stem":25,"description":348,"icon":26,"children":-1},"The gateway, the coordination core, the two planes you deploy, and the one-way flow that keeps every store honest.",{"title":40,"path":41,"stem":42,"description":350,"icon":43,"children":-1},"Every teaspill term in one place, alphabetically, with a link to the page that teaches it.",1784473422437]