@@ -103,39 +103,28 @@ Add a processing node to the agent graph.
103103- ` node_id ` (string, required): Unique node identifier
104104- ` name ` (string, required): Human-readable name
105105- ` description ` (string, required): What this node does
106- - ` node_type ` (string, required): One of: ` llm_generate ` , ` llm_tool_use ` , ` router ` , ` function `
106+ - ` node_type ` (string, required): Must be ` event_loop ` (the only valid type)
107107- ` input_keys ` (string, required): JSON array of input variable names
108108- ` output_keys ` (string, required): JSON array of output variable names
109- - ` system_prompt ` (string, optional): System prompt for LLM nodes
110- - ` tools ` (string, optional): JSON array of tool names for tool_use nodes
111- - ` routes ` (string , optional): JSON object of route mappings for router nodes
109+ - ` system_prompt ` (string, optional): System prompt for the LLM
110+ - ` tools ` (string, optional): JSON array of tool names
111+ - ` client_facing ` (boolean , optional): Set to true for human-in-the-loop interaction
112112
113- ** Node Types :**
113+ ** Node Type :**
114114
115- 1 . ** llm_generate** : Uses LLM to generate output from inputs
116- - Requires: ` system_prompt `
117- - Tools: Not used
118-
119- 2 . ** llm_tool_use** : Uses LLM with tools to accomplish tasks
120- - Requires: ` system_prompt ` , ` tools `
121- - Tools: Array of tool names (e.g., ` ["web_search", "web_fetch"] ` )
122-
123- 3 . ** router** : LLM-powered routing to different paths
124- - Requires: ` system_prompt ` , ` routes `
125- - Routes: Object mapping route names to target node IDs
126- - Example: ` {"pass": "success_node", "fail": "retry_node"} `
127-
128- 4 . ** function** : Executes a pre-defined function
129- - System prompt describes the function behavior
130- - No LLM calls, pure computation
115+ ** event_loop** : LLM-powered node with self-correction loop
116+ - Requires: ` system_prompt `
117+ - Optional: ` tools ` (array of tool names, e.g., ` ["web_search", "web_fetch"] ` )
118+ - Optional: ` client_facing ` (set to true for HITL / user interaction)
119+ - Supports: iterative refinement, judge-based evaluation, tool use, streaming
131120
132121** Example:**
133122``` json
134123{
135124 "node_id" : " search_sources" ,
136125 "name" : " Search Sources" ,
137126 "description" : " Searches for relevant sources on the topic" ,
138- "node_type" : " llm_tool_use " ,
127+ "node_type" : " event_loop " ,
139128 "input_keys" : " [\" topic\" , \" search_queries\" ]" ,
140129 "output_keys" : " [\" sources\" , \" source_count\" ]" ,
141130 "system_prompt" : " Search for sources using the provided queries..." ,
@@ -198,7 +187,7 @@ Export the validated graph as an agent specification.
198187
199188** What it does:**
2001891 . Validates the graph
201- 2 . Auto-generates missing edges from router routes
190+ 2 . Validates edge connectivity
2021913 . Writes files to disk:
203192 - ` exports/{agent-name}/agent.json ` - Full agent specification
204193 - ` exports/{agent-name}/README.md ` - Auto-generated documentation
@@ -252,47 +241,6 @@ Test the complete agent graph with sample inputs.
252241
253242---
254243
255- ### Evaluation Rules
256-
257- #### ` add_evaluation_rule `
258- Add a rule for the HybridJudge to evaluate node outputs.
259-
260- ** Parameters:**
261- - ` rule_id ` (string, required): Unique rule identifier
262- - ` description ` (string, required): What this rule checks
263- - ` condition ` (string, required): Python expression to evaluate
264- - ` action ` (string, required): Action to take: ` accept ` , ` retry ` , ` escalate `
265- - ` priority ` (integer, optional): Rule priority (default: 0)
266- - ` feedback_template ` (string, optional): Feedback message template
267-
268- ** Condition Examples:**
269- - ` 'result.get("success") == True' ` - Check for success flag
270- - ` 'result.get("error_type") == "timeout"' ` - Check error type
271- - ` 'len(result.get("data", [])) > 0' ` - Check for non-empty data
272-
273- ** Example:**
274- ``` json
275- {
276- "rule_id" : " timeout_retry" ,
277- "description" : " Retry on timeout errors" ,
278- "condition" : " result.get('error_type') == 'timeout'" ,
279- "action" : " retry" ,
280- "priority" : 10 ,
281- "feedback_template" : " Timeout occurred, retrying..."
282- }
283- ```
284-
285- #### ` list_evaluation_rules `
286- List all configured evaluation rules.
287-
288- #### ` remove_evaluation_rule `
289- Remove an evaluation rule.
290-
291- ** Parameters:**
292- - ` rule_id ` (string, required): Rule to remove
293-
294- ---
295-
296244## Example Workflow
297245
298246Here's a complete workflow for building a research agent:
@@ -320,7 +268,7 @@ add_node(
320268 node_id = " planner" ,
321269 name = " Research Planner" ,
322270 description = " Creates research strategy" ,
323- node_type = " llm_generate " ,
271+ node_type = " event_loop " ,
324272 input_keys = ' ["topic"]' ,
325273 output_keys = ' ["strategy", "queries"]' ,
326274 system_prompt = " Analyze topic and create research plan..."
@@ -330,7 +278,7 @@ add_node(
330278 node_id = " searcher" ,
331279 name = " Search Sources" ,
332280 description = " Find relevant sources" ,
333- node_type = " llm_tool_use " ,
281+ node_type = " event_loop " ,
334282 input_keys = ' ["queries"]' ,
335283 output_keys = ' ["sources"]' ,
336284 system_prompt = " Search for sources..." ,
@@ -359,10 +307,9 @@ The exported agent will be saved to `exports/research-agent/`.
359307
3603081 . ** Start with the goal** : Define clear success criteria before building nodes
3613092 . ** Test nodes individually** : Use ` test_node ` to verify each node works
362- 3 . ** Use router nodes for branching** : Don't create edges manually for routers - define routes and they'll be auto-generated
363- 4 . ** Add evaluation rules** : Help the judge evaluate outputs deterministically
364- 5 . ** Validate early, validate often** : Run ` validate_graph ` after adding nodes/edges
365- 6 . ** Check exports** : Review the generated README.md to verify your agent structure
310+ 3 . ** Use conditional edges for branching** : Define condition_expr on edges for decision points
311+ 4 . ** Validate early, validate often** : Run ` validate_graph ` after adding nodes/edges
312+ 5 . ** Check exports** : Review the generated README.md to verify your agent structure
366313
367314---
368315
0 commit comments