Why a Graph
Business workflows are rarely linear. Hive models execution as a directed graph so agents can branch, retry, loop, and escalate.Nodes
Nodes are units of work that read from shared memory, perform logic, and write outputs. Core node types:event_loop: multi-turn LLM + tools loop (primary autonomous workhorse)function: deterministic Python logicrouter: rule-based or model-assisted path selectionhuman_input: pause for supervised inputllm_tool_useandllm_generate: simpler one-shot LLM nodes
Self-Correction in event_loop
Each iteration can end with:
- Accept
- Retry
- Escalate
Edges
Edges define control flow:- On success
- On failure
- Conditional
- LLM-decided
Shared Memory
Shared memory is session-scoped state used for cross-node communication.- Nodes declare read/write contracts
- Execution remains traceable and structured
- Final state represents run output and side effects