[ // ROOT FUNCTIONS ]
Functions that live inside the brain.
Deploy durable functions that run next to your memory — they read, remember, branch, and call tools with no round-trip, and survive restarts.
[ // DURABLE ]
Durable by default.
Timers, retries, and idempotency are built in. A function can pause, schedule itself for later, and pick up exactly where it left off — no queue to babysit.
- Timers & self-scheduling
- Automatic retries with idempotency
- Survives restarts — deterministic replay
- Runs co-located with the graph
root-function.ts
export default rootFunction(async (ctx) => {
const facts = await ctx.memory.recall("open tickets");
const skill = await ctx.acquire("summarize-thread");
await ctx.scheduleSelf({ in: "1h" }); // durable timer
return skill.run(facts);
});[ // CO-LOCATED ]
No round-trip to your memory.
Your function has direct access to memory, prompts, branches, and MCP tools — no network hop between the logic and the data it reasons over.
ctx.memory
Remember and recall inside the function.
ctx.prompt
Assemble versioned, cacheable prompts.
ctx.acquire
Route to a skill, or forge a new one just-in-time.
Self-extending.
When a task needs a capability that doesn't exist yet, the function can forge it — author, deploy, verify, and keep it or roll back — all at runtime.
- acquire(task) — route-or-forge
- author → deploy → verify → keep or revert
- New skills persist for next time
- Every step is durable and auditable