Skip to content

Sentinels & predicates

Sentinels declare where a Plan step's input comes from; the when DSL declares when a route fires. Both are validated at Plan construction time — a typo in from_step("reseach") raises PlanCompileError before any LLM call.

For narrative usage see Guides → Full → Sentinels and Guides → Full → Routing.

Symbol Resolves to Scope
from_prev The previous step's payload In-Plan only
from_start The Plan's initial input In-Plan only
from_step("name") The named step's output In-Plan only
from_parallel("name") A single named parallel branch's output In-Plan only
from_parallel_all("name") All consecutive parallel siblings, labelled-text joined In-Plan only
from_memory("name") An agent's live conversation history Cross-run, via Memory
from_agent("name") An agent's last persisted output Cross-run, via Store
when Routing predicate DSL builder Step(routes={…})

Plan-only sentinels

lazybridge.from_prev module-attribute

from_prev = _FromPrev()

lazybridge.from_start module-attribute

from_start = _FromStart()

lazybridge.from_step

from_step(name: str) -> _FromStep
Source code in lazybridge/sentinels.py
def from_step(name: str) -> _FromStep:
    return _FromStep(name=name)

lazybridge.from_parallel

from_parallel(name: str) -> _FromParallel
Source code in lazybridge/sentinels.py
def from_parallel(name: str) -> _FromParallel:
    return _FromParallel(name=name)

lazybridge.from_parallel_all

from_parallel_all(name: str) -> _FromParallelAll

Aggregate every consecutive parallel sibling starting at name.

Source code in lazybridge/sentinels.py
def from_parallel_all(name: str) -> _FromParallelAll:
    """Aggregate every consecutive parallel sibling starting at ``name``."""
    return _FromParallelAll(name=name)

Universal sentinels

lazybridge.from_memory

from_memory(name: str) -> _FromMemory

Inject the live memory of the agent registered as name at execution time.

Source code in lazybridge/sentinels.py
def from_memory(name: str) -> _FromMemory:
    """Inject the live memory of the agent registered as ``name`` at execution time."""
    return _FromMemory(name=name)

lazybridge.from_agent

from_agent(name: str) -> _FromAgent

Read the last output of the agent registered as name from the shared store.

Source code in lazybridge/sentinels.py
def from_agent(name: str) -> _FromAgent:
    """Read the last output of the agent registered as ``name`` from the shared store."""
    return _FromAgent(name=name)

Routing predicates

lazybridge.when module-attribute

when: _When = _When()