You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dsl-reference.md
+51-9Lines changed: 51 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -875,11 +875,52 @@ node("research") {
875
875
}
876
876
```
877
877
878
+
#### Planner Agent
879
+
880
+
Dynamic planning requires an agent to generate the plan. By default the node's own agent handles both planning and execution. To use a dedicated planner agent, pass its ID to `dynamic()`:
881
+
882
+
```kotlin
883
+
agents {
884
+
agent("planner") {
885
+
role ="Plan generation specialist"
886
+
model =Models.GEMINI_3_1_FLASH_LITE
887
+
temperature =0.2
888
+
}
889
+
agent("researcher") {
890
+
role ="Deep research analyst"
891
+
model =Models.GEMINI_3_1_PRO
892
+
temperature =0.7
893
+
}
894
+
}
895
+
896
+
graph {
897
+
node("research") {
898
+
agent ="researcher"
899
+
planning {
900
+
dynamic("planner") // explicit planner agent
901
+
maxSteps =15
902
+
review =true
903
+
}
904
+
prompt ="Research and analyze topic X"
905
+
onSuccess goto "synthesize"
906
+
}
907
+
}
908
+
```
909
+
910
+
Resolution order:
911
+
1.**Explicit** – the `agent` property set in the `planning { }` block (or passed to `dynamic()`).
912
+
2.**Fallback** – the node's own `agent`.
913
+
914
+
If neither is set, execution fails fast before the first node runs.
915
+
916
+
#### Convenience Methods
917
+
878
918
Convenience methods simplify common configurations:
879
919
880
920
```kotlin
881
921
planning {
882
922
dynamic() // Sets DYNAMIC mode with sensible defaults
923
+
dynamic("planner") // Sets DYNAMIC mode with explicit planner agent
883
924
withReview() // Pause for human review before execution
884
925
noReplan() // Disable automatic replanning on failure
0 commit comments