Skip to main content

Resonate documentation

Resonate documentation banner

Resonate is a dead simple durable execution framework for building reliable and scalable cloud applications with a delightful developer experience. Build agents, workflows, pipelines, and services without thinking about retries or recovery. Resonate handles the hard parts of distributed systems—you focus on your application logic.

Complex problems, simple code. Write functions that scale across dozens or hundreds of machines and run for hours, days, weeks, or months, in just a few lines of code.

TypeScript
// An AI agent that recursively spawns subagents
function* agent(context: Context, prompt: string) {
const messages = [{ role: "user", content: prompt }];
// The agent loop
while (true) {
const response = yield* context.run(think, messages);
messages.push(response);

if (response.subprompts) {
// Spawn concurrent subagents
const futures = [];
for (const subprompt of response.subprompts) {
futures.push(yield* context.beginRpc(agent, subprompt));
}
// Collect results
for (const future of futures) {
messages.push({ role: "tool", content: yield* future });
}
} else {
return response.content;
}
}
}