HumanEngine vs SupervisorEngine¶
Which human-in-the-loop engine?
Two HIL engines under lazybridge.ext.hil. The split is by what
the human is allowed to do during the gate, not by integration
shape.
Decision tree¶
Simple "wait for input / approve / fill a form"?
→ HumanEngine
Agent(engine=HumanEngine(timeout=120, default="approve"),
output=ReviewForm)
# one prompt, one answer (or per-field prompts when output= is
# a Pydantic model)
Interactive REPL where the operator can call tools, retry agents
with feedback, and inspect the store?
→ SupervisorEngine
Agent(engine=SupervisorEngine(tools=[search],
agents=[researcher],
store=store))
# commands: continue [text] | retry <agent>: <feedback> |
# store <key> | <tool>(<args>)
Automated verification at runtime (no human, LLM judge)?
→ verify=judge_agent
# NOT human-in-the-loop — see verify-placement.md
Quick reference¶
| Need | Use |
|---|---|
| Approve / reject / fill form | HumanEngine |
| REPL with tool dispatch + agent retry + store inspection | SupervisorEngine |
| LLM-as-judge with retry feedback | verify=judge_agent (not HIL) |
Notes¶
HumanEngineis the lighter variant. One prompt, one answer; withoutput=PydanticModelthe terminal UI prompts field-by-field for a structured form.SupervisorEngineis the REPL. The operator calls tools registered on the engine, retries any agent passed inagents=[…]with feedback, and inspectsstore=keys via thestore <key>command. Heavier but interactive.- Both are drop-in
Engines.Agent(engine=HumanEngine(...))/Agent(engine=SupervisorEngine(...))plug into any pipeline that takes anEngine. Use them as aPlanstep like any other agent. - Sugar exists.
human_agent(...)andsupervisor_agent(...)inlazybridge.ext.hilskip the explicitAgent(engine=…)wrap. Use the sugar for one-liners; the canonical form when the engine choice should be visible at the call site. - Set
timeout=for unattended pipelines. Both engines hang forever ontimeout=None(the default) when no human shows up. Pairtimeout=withdefault=for graceful fallback.
See also¶
- HumanEngine — full reference,
custom UI adapter via
ui=. - SupervisorEngine — REPL
command surface, scripted-input tests, async UI via
ainput_fn. verify=placement — automated LLM judge, distinct from HIL.- Canonical vs sugar —
human_agent(...)/supervisor_agent(...)mapped to theirAgent(engine=...)canonical equivalents.