Branch & Spread
nae.node.Branch ¶
Group returned by node > [a, b, ...]; its members are branch tails,
and its > wires the fan-in/join.
Hold the fan-out branches (tails) so the next > can join them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tails
|
list
|
The branch nodes (each may be a chain tail such as |
required |
__gt__ ¶
Wire every branch tail into join (the fan-in).
Points each tail's child at join and marks join a deferred join so it
runs once, after all branches complete (see graph.py). Returns join
so the chain continues.
nae.node.Spread ¶
Map-reduce wrapper: worker.map(field) fans worker across
state[field] via LangGraph Send, joining into the collector wired by
> collector. Built specially in AgenticGraph._build_graph — a Spread
has no graph identity of its own; the worker is the real node.
Capture the map-reduce intent from worker.map(field).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
worker
|
Node
|
The node to run once per item of |
required |
field
|
str
|
The state key whose items are fanned out (one |
required |
__gt__ ¶
Wire the map's fan-in: all worker replies join into collector.
Records collector and marks it a deferred join so it runs exactly once,
after every Send-fanned worker has finished. Returns collector.