| Name | Type | Description |
|---|---|---|
research_fn* | Callable[[Any], dict[str, Any]] | Node that gathers research data. |
write_fn* | Callable[[Any], dict[str, Any]] | |
eval_optimize_graph* | Any | |
build_completed_fn* | Callable[[Any], dict[str, Any]] | |
state_schema* | type | |
max_iterations | int | Default: 3 |
state_to_eval_input | Callable[[dict[str, Any], int], dict[str, Any]] | None | Default: None |
eval_output_to_state | Callable[[dict[str, Any], dict[str, Any]], dict[str, Any]] | None |
Build a compiled analyst subgraph with embedded eval-optimize loop.
Creates a LangGraph StateGraph for a specialist analyst:
research → write → eval-optimize (subgraph) → build_completed.
The eval-optimize loop is invoked as a subgraph with a different state schema, demonstrating the parent→child→grandchild pattern with state transformation.
NoneNode that writes the section draft.
Compiled eval-optimize subgraph.
Node that packages final output.
The analyst TypedDict state.
Safety limit passed to the eval-optimize subgraph.
Optional callback that maps the analyst state to the
eval-optimize subgraph input. When omitted, the helper uses the
conventional analyst state keys section, draft_content,
evaluation_feedback, evaluation_result, accepted,
iteration/iteration_count, and max_iterations.
section may be either a mapping or an object with area and
title attributes.
Optional callback that maps the eval-optimize
output back into analyst state updates. When omitted, the helper
returns draft_content, evaluation_result, and
iteration_count updates.