Multi-agent
Human in the loop
The agent drafts; a person approves before anything happens.
The run pauses before a step that matters, here sending a refund email, and waits for a person to approve, edit or reject the draft. Nothing is sent until they decide.
In CriogenAI the pause is durable: it is saved in the database, so the decision can come from another process, days later, and is recorded in the audit trail.
- Use it when
- Money, messages to customers, deletions, anything hard to undo
- Regulated work that needs a named approver
- Building trust in a new agent
- Skip it when
- High-volume, low-risk steps (people become the bottleneck)
Run it
Scripted model · no key needed · CriogenAI engine in your browserThe runmodel 0 · tools 0
- Press Run to watch the pattern work, step by step.
Try it with your own key optional: a real model makes the decisions; the tools stay simulated
- Your key stays in this tab's memory: not saved, not in cookies or the address bar. Reload or close the tab and it is gone.
- Your browser calls OpenAI directly. Nothing passes through criogenai.com, and nothing is logged.
- Each run makes at most 16 short model calls, billed to your account. Tools, data and side effects are simulated.
This run is the TypeScript code below, running on the CriogenAI engine in your browser (WebAssembly). Without a key, a scripted model stands in for MODEL; with your key, your provider answers, called from this tab. The tools return made-up data.
Build it with CriogenAI
Ready-made:patterns.human_review (Approval on tools)drafter = Agent(MODEL, instructions="Draft a short refund email to the customer.")
flow = patterns.human_review(("draft", drafter))
paused = await flow.run("Refund $180 for damaged order A-2077.")
print(paused.suspended, paused.waiting_for) # True, {"draft": ..., "question": ...}
# Later, after a person has read the draft (with compile(storage), even days later):
done = await flow.resume(paused, "approve") # or {"decision": "edit", "text": ...} / {"decision": "reject"}
print(done.output, done.stop_reason)const drafter = new Agent({ model: MODEL, instructions: "Draft a short refund email to the customer." });
const flow = patterns.humanReview(["draft", drafter]);
const paused = await flow.run(task);
console.log(paused.suspended, paused.waitingFor); // true, { draft, question }
// Later, after a person has read the draft (with compile(storage), even days later):
const done = await flow.resume(paused, await askPerson(paused.waitingFor)); // "approve", { decision: "edit", text } or { decision: "reject" }
console.log(done.output, done.stopReason);