Convenience wrapper around [build_custom_agent()] that returns both runnable agent and Mermaid graph artifacts.
compile_graph(
node_functions,
entry_point,
edges = list(),
conditional_edges = list(),
default_state = list(),
checkpointer = NULL,
direction = c("TD", "LR"),
subgraphs = NULL,
style = TRUE
)A list with `run`, `graph`, and `mermaid`.
Named list of node functions. Each function takes `state` and returns a named list or [make_command()].
Name of the start node (must exist in `node_functions`).
Optional list of static edges. Each item can be: - a character vector of length 2: `c("from", "to")`, or - a list with `from` and `to`.
Optional list where each item contains: - `from` (or `node_name`), - `condition` (or `condition_fun`), - `mapping` (or `mapping_list`) as a named list of label -> node.
Optional named list merged into `state` for missing keys.
Optional callback `function(state, current_node)` executed after each transition.
Mermaid direction used when `output` includes Mermaid.
Optional named list of subgraph groups for Mermaid rendering.
Logical; include default Mermaid class styling.