soe-ai 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. soe/builtin_tools/__init__.py +39 -0
  2. soe/builtin_tools/soe_add_signal.py +82 -0
  3. soe/builtin_tools/soe_call_tool.py +111 -0
  4. soe/builtin_tools/soe_copy_context.py +80 -0
  5. soe/builtin_tools/soe_explore_docs.py +290 -0
  6. soe/builtin_tools/soe_get_available_tools.py +42 -0
  7. soe/builtin_tools/soe_get_context.py +50 -0
  8. soe/builtin_tools/soe_get_workflows.py +63 -0
  9. soe/builtin_tools/soe_inject_node.py +86 -0
  10. soe/builtin_tools/soe_inject_workflow.py +105 -0
  11. soe/builtin_tools/soe_list_contexts.py +73 -0
  12. soe/builtin_tools/soe_remove_node.py +72 -0
  13. soe/builtin_tools/soe_remove_workflow.py +62 -0
  14. soe/builtin_tools/soe_update_context.py +54 -0
  15. soe/docs/_config.yml +10 -0
  16. soe/docs/advanced_patterns/guide_fanout_and_aggregations.md +318 -0
  17. soe/docs/advanced_patterns/guide_inheritance.md +435 -0
  18. soe/docs/advanced_patterns/hybrid_intelligence.md +237 -0
  19. soe/docs/advanced_patterns/index.md +49 -0
  20. soe/docs/advanced_patterns/operational.md +781 -0
  21. soe/docs/advanced_patterns/self_evolving_workflows.md +385 -0
  22. soe/docs/advanced_patterns/swarm_intelligence.md +211 -0
  23. soe/docs/builtins/context.md +164 -0
  24. soe/docs/builtins/explore_docs.md +135 -0
  25. soe/docs/builtins/tools.md +164 -0
  26. soe/docs/builtins/workflows.md +199 -0
  27. soe/docs/guide_00_getting_started.md +341 -0
  28. soe/docs/guide_01_tool.md +206 -0
  29. soe/docs/guide_02_llm.md +143 -0
  30. soe/docs/guide_03_router.md +146 -0
  31. soe/docs/guide_04_patterns.md +475 -0
  32. soe/docs/guide_05_agent.md +159 -0
  33. soe/docs/guide_06_schema.md +397 -0
  34. soe/docs/guide_07_identity.md +540 -0
  35. soe/docs/guide_08_child.md +612 -0
  36. soe/docs/guide_09_ecosystem.md +690 -0
  37. soe/docs/guide_10_infrastructure.md +427 -0
  38. soe/docs/guide_11_builtins.md +118 -0
  39. soe/docs/index.md +104 -0
  40. soe/docs/primitives/backends.md +281 -0
  41. soe/docs/primitives/context.md +256 -0
  42. soe/docs/primitives/node_reference.md +259 -0
  43. soe/docs/primitives/primitives.md +331 -0
  44. soe/docs/primitives/signals.md +865 -0
  45. soe/docs_index.py +1 -1
  46. soe/lib/__init__.py +0 -0
  47. soe/lib/child_context.py +46 -0
  48. soe/lib/context_fields.py +51 -0
  49. soe/lib/inheritance.py +172 -0
  50. soe/lib/jinja_render.py +113 -0
  51. soe/lib/operational.py +51 -0
  52. soe/lib/parent_sync.py +71 -0
  53. soe/lib/register_event.py +75 -0
  54. soe/lib/schema_validation.py +134 -0
  55. soe/lib/yaml_parser.py +14 -0
  56. soe/local_backends/__init__.py +18 -0
  57. soe/local_backends/factory.py +124 -0
  58. soe/local_backends/in_memory/context.py +38 -0
  59. soe/local_backends/in_memory/conversation_history.py +60 -0
  60. soe/local_backends/in_memory/identity.py +52 -0
  61. soe/local_backends/in_memory/schema.py +40 -0
  62. soe/local_backends/in_memory/telemetry.py +38 -0
  63. soe/local_backends/in_memory/workflow.py +33 -0
  64. soe/local_backends/storage/context.py +57 -0
  65. soe/local_backends/storage/conversation_history.py +82 -0
  66. soe/local_backends/storage/identity.py +118 -0
  67. soe/local_backends/storage/schema.py +96 -0
  68. soe/local_backends/storage/telemetry.py +72 -0
  69. soe/local_backends/storage/workflow.py +56 -0
  70. soe/nodes/__init__.py +13 -0
  71. soe/nodes/agent/__init__.py +10 -0
  72. soe/nodes/agent/factory.py +134 -0
  73. soe/nodes/agent/lib/loop_handlers.py +150 -0
  74. soe/nodes/agent/lib/loop_state.py +157 -0
  75. soe/nodes/agent/lib/prompts.py +65 -0
  76. soe/nodes/agent/lib/tools.py +35 -0
  77. soe/nodes/agent/stages/__init__.py +12 -0
  78. soe/nodes/agent/stages/parameter.py +37 -0
  79. soe/nodes/agent/stages/response.py +54 -0
  80. soe/nodes/agent/stages/router.py +37 -0
  81. soe/nodes/agent/state.py +111 -0
  82. soe/nodes/agent/types.py +66 -0
  83. soe/nodes/agent/validation/__init__.py +11 -0
  84. soe/nodes/agent/validation/config.py +95 -0
  85. soe/nodes/agent/validation/operational.py +24 -0
  86. soe/nodes/child/__init__.py +3 -0
  87. soe/nodes/child/factory.py +61 -0
  88. soe/nodes/child/state.py +59 -0
  89. soe/nodes/child/validation/__init__.py +11 -0
  90. soe/nodes/child/validation/config.py +126 -0
  91. soe/nodes/child/validation/operational.py +28 -0
  92. soe/nodes/lib/conditions.py +71 -0
  93. soe/nodes/lib/context.py +24 -0
  94. soe/nodes/lib/conversation_history.py +77 -0
  95. soe/nodes/lib/identity.py +64 -0
  96. soe/nodes/lib/llm_resolver.py +142 -0
  97. soe/nodes/lib/output.py +68 -0
  98. soe/nodes/lib/response_builder.py +91 -0
  99. soe/nodes/lib/signal_emission.py +79 -0
  100. soe/nodes/lib/signals.py +54 -0
  101. soe/nodes/lib/tools.py +100 -0
  102. soe/nodes/llm/__init__.py +7 -0
  103. soe/nodes/llm/factory.py +103 -0
  104. soe/nodes/llm/state.py +76 -0
  105. soe/nodes/llm/types.py +12 -0
  106. soe/nodes/llm/validation/__init__.py +11 -0
  107. soe/nodes/llm/validation/config.py +89 -0
  108. soe/nodes/llm/validation/operational.py +23 -0
  109. soe/nodes/router/__init__.py +3 -0
  110. soe/nodes/router/factory.py +37 -0
  111. soe/nodes/router/state.py +32 -0
  112. soe/nodes/router/validation/__init__.py +11 -0
  113. soe/nodes/router/validation/config.py +58 -0
  114. soe/nodes/router/validation/operational.py +16 -0
  115. soe/nodes/tool/factory.py +66 -0
  116. soe/nodes/tool/lib/__init__.py +11 -0
  117. soe/nodes/tool/lib/conditions.py +35 -0
  118. soe/nodes/tool/lib/failure.py +28 -0
  119. soe/nodes/tool/lib/parameters.py +67 -0
  120. soe/nodes/tool/state.py +66 -0
  121. soe/nodes/tool/types.py +27 -0
  122. soe/nodes/tool/validation/__init__.py +15 -0
  123. soe/nodes/tool/validation/config.py +132 -0
  124. soe/nodes/tool/validation/operational.py +16 -0
  125. soe/validation/__init__.py +18 -0
  126. soe/validation/config.py +195 -0
  127. soe/validation/jinja.py +54 -0
  128. soe/validation/operational.py +110 -0
  129. {soe_ai-0.1.1.dist-info → soe_ai-0.1.2.dist-info}/METADATA +4 -4
  130. soe_ai-0.1.2.dist-info/RECORD +137 -0
  131. {soe_ai-0.1.1.dist-info → soe_ai-0.1.2.dist-info}/WHEEL +1 -1
  132. soe_ai-0.1.1.dist-info/RECORD +0 -10
  133. {soe_ai-0.1.1.dist-info → soe_ai-0.1.2.dist-info}/licenses/LICENSE +0 -0
  134. {soe_ai-0.1.1.dist-info → soe_ai-0.1.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,164 @@
1
+
2
+ # Built-in: Context Management
3
+
4
+ ## Execution State Control
5
+
6
+ These built-in tools enable workflows to **manage execution context**. Context is the shared state that flows through nodes—reading, updating, and copying it enables sophisticated patterns like parallel execution, state persistence, and dynamic behavior.
7
+
8
+ ---
9
+
10
+ ## Available Tools
11
+
12
+ | Tool | Purpose |
13
+ |------|---------|
14
+ | `soe_get_context` | Read the current execution context |
15
+ | `soe_update_context` | Modify context fields |
16
+ | `soe_copy_context` | Clone context for parallel execution |
17
+ | `soe_list_contexts` | Discover available contexts |
18
+
19
+ ---
20
+
21
+ ## soe_get_context
22
+
23
+ Read the current execution context snapshot.
24
+
25
+ ```yaml
26
+ example_workflow:
27
+ GetContext:
28
+ node_type: tool
29
+ event_triggers: [START]
30
+ tool_name: soe_get_context
31
+ output_field: current_context
32
+ event_emissions:
33
+ - signal_name: CONTEXT_RETRIEVED
34
+ ```
35
+
36
+ Returns the full context dictionary including all fields and `__operational__` state.
37
+
38
+ ### Use Cases
39
+
40
+ - **Introspection** — Let LLMs see full workflow state
41
+ - **Debugging** — Inspect context during development
42
+ - **Decision making** — Base routing on complete state
43
+
44
+ ---
45
+
46
+ ## soe_update_context
47
+
48
+ Modify context fields programmatically.
49
+
50
+ ```yaml
51
+ example_workflow:
52
+ UpdateContext:
53
+ node_type: tool
54
+ event_triggers: [START]
55
+ tool_name: soe_update_context
56
+ context_parameter_field: context_updates
57
+ output_field: update_result
58
+ event_emissions:
59
+ - signal_name: CONTEXT_UPDATED
60
+ ```
61
+
62
+ ### Context Setup
63
+
64
+ The `context_updates` field should contain key-value pairs:
65
+
66
+ ```python
67
+ {
68
+ "new_field": "new_value",
69
+ "counter": 42,
70
+ "nested": {"key": "value"}
71
+ }
72
+ ```
73
+
74
+ ### Use Cases
75
+
76
+ - **State injection** — Add computed values to context
77
+ - **Reset/clear** — Modify state for retry patterns
78
+ - **Enrichment** — Add metadata or derived values
79
+
80
+ ---
81
+
82
+ ## soe_copy_context
83
+
84
+ Clone context for parallel execution or branching.
85
+
86
+ ```yaml
87
+ example_workflow:
88
+ CopyContext:
89
+ node_type: tool
90
+ event_triggers: [START]
91
+ tool_name: soe_copy_context
92
+ context_parameter_field: copy_params
93
+ output_field: copy_result
94
+ event_emissions:
95
+ - signal_name: CONTEXT_COPIED
96
+ ```
97
+
98
+ ### Context Setup
99
+
100
+ The `copy_params` field specifies target:
101
+
102
+ ```python
103
+ {
104
+ "target_execution_id": "new_execution_123",
105
+ "fields_to_copy": ["user_data", "config"] # Optional: copy specific fields only
106
+ }
107
+ ```
108
+
109
+ ### Use Cases
110
+
111
+ - **Parallel workers** — Each worker gets its own context copy
112
+ - **Branching** — Create alternative execution paths
113
+ - **Snapshotting** — Save state before risky operations
114
+
115
+ ---
116
+
117
+ ## soe_list_contexts
118
+
119
+ Discover available contexts (useful for multi-execution patterns).
120
+
121
+ ```yaml
122
+ example_workflow:
123
+ ListAllContexts:
124
+ node_type: tool
125
+ event_triggers: [START]
126
+ tool_name: soe_list_contexts
127
+ output_field: available_contexts
128
+ event_emissions:
129
+ - signal_name: CONTEXTS_LISTED
130
+ ```
131
+
132
+ Returns a list of execution IDs with contexts.
133
+
134
+ ### Use Cases
135
+
136
+ - **Orchestration** — Manage multiple parallel executions
137
+ - **Cleanup** — Find old contexts to archive
138
+ - **Aggregation** — Collect results from multiple executions
139
+
140
+ ---
141
+
142
+ ## Context Patterns
143
+
144
+ ### Context Inspection for LLMs
145
+
146
+ Let an LLM reason about full state:
147
+
148
+ ```yaml
149
+ reflective_workflow:
150
+ GatherState:
151
+ node_type: tool
152
+ event_triggers: [START]
153
+ tool_name: soe_get_context
154
+ output_field: full_state
155
+ event_emissions:
156
+ - signal_name: STATE_GATHERED
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Related
162
+
163
+ - [Built-in Tools Overview](../guide_11_builtins.md) — All available built-ins
164
+ - [Operational Features](../advanced_patterns/operational.md) — Context structure details
@@ -0,0 +1,135 @@
1
+
2
+ # Built-in: soe_explore_docs
3
+
4
+ ## Making SOE Self-Aware
5
+
6
+ The `soe_explore_docs` built-in tool enables workflows to **explore their own documentation**. This is the foundation for self-awareness—a workflow can discover what SOE is capable of, understand its own structure, and reason about available patterns.
7
+
8
+ ---
9
+
10
+ ## Why Self-Awareness Matters
11
+
12
+ Self-awareness transforms a static workflow into an intelligent system that can:
13
+
14
+ - **Discover capabilities** — Find out what node types, patterns, and features exist
15
+ - **Learn from examples** — Read documentation to understand how to use features
16
+ - **Adapt behavior** — Make decisions based on available functionality
17
+ - **Evolve intelligently** — Create new nodes based on documented patterns
18
+
19
+ Without `soe_explore_docs`, an LLM in a workflow would be "blind"—it couldn't know what SOE can do. With it, the LLM becomes a partner that understands the orchestration engine itself.
20
+
21
+ ---
22
+
23
+ ## Basic Usage
24
+
25
+ ### List Documentation Structure
26
+
27
+ ```yaml
28
+ example_workflow:
29
+ ExploreDocs:
30
+ node_type: tool
31
+ event_triggers: [START]
32
+ tool_name: soe_explore_docs
33
+ context_parameter_field: explore_params
34
+ output_field: docs_list
35
+ event_emissions:
36
+ - signal_name: DOCS_LISTED
37
+ ```
38
+
39
+ Returns entries like:
40
+ ```
41
+ [DIR] advanced_patterns/
42
+ [FILE] guide_01_tool.md
43
+ [FILE] guide_02_llm.md
44
+ ```
45
+
46
+ ### Search Documentation
47
+
48
+ ```yaml
49
+ example_workflow:
50
+ SearchDocs:
51
+ node_type: tool
52
+ event_triggers: [START]
53
+ tool_name: soe_explore_docs
54
+ context_parameter_field: explore_params
55
+ output_field: search_results
56
+ event_emissions:
57
+ - signal_name: SEARCH_COMPLETE
58
+ ```
59
+
60
+ Search finds relevant paths matching the query.
61
+
62
+ ### Read Documentation Content
63
+
64
+ ```yaml
65
+ example_workflow:
66
+ ReadGuide:
67
+ node_type: tool
68
+ event_triggers: [START]
69
+ tool_name: soe_explore_docs
70
+ context_parameter_field: explore_params
71
+ output_field: guide_content
72
+ event_emissions:
73
+ - signal_name: GUIDE_READ
74
+ ```
75
+
76
+ Returns the full markdown content of the file.
77
+
78
+ ---
79
+
80
+ ## Actions Reference
81
+
82
+ | Action | Description | Required Args |
83
+ |--------|-------------|---------------|
84
+ | `list` | Show children at path (files, dirs, sections) | `path` |
85
+ | `read` | Get content of file or section | `path` |
86
+ | `tree` | Recursive structure from path | `path` |
87
+ | `search` | Find docs matching query/tag | `query` or `tag` |
88
+ | `get_tags` | List all available tags | none |
89
+
90
+ ---
91
+
92
+ ## Path Navigation
93
+
94
+ The `path` argument navigates the documentation hierarchy:
95
+
96
+ | Path | What It Returns |
97
+ |------|-----------------|
98
+ | `/` | Root documentation listing |
99
+ | `soe/docs/guide_01_tool.md` | File content or sections within |
100
+ | `soe/docs/guide_01_tool.md/Your First Tool Node` | Specific section content |
101
+ | `soe/docs/advanced_patterns/` | Directory contents |
102
+
103
+ ---
104
+
105
+ ## Integration with LLM Nodes
106
+
107
+ The power of `soe_explore_docs` comes from combining it with LLM reasoning:
108
+
109
+ ```yaml
110
+ metacognitive_workflow:
111
+ DiscoverCapabilities:
112
+ node_type: tool
113
+ event_triggers: [START]
114
+ tool_name: soe_explore_docs
115
+ context_parameter_field: explore_params
116
+ output_field: soe_capabilities
117
+ event_emissions:
118
+ - signal_name: CAPABILITIES_DISCOVERED
119
+
120
+ ReadRelevantGuide:
121
+ node_type: tool
122
+ event_triggers: [READ_GUIDE]
123
+ tool_name: soe_explore_docs
124
+ context_parameter_field: guide_params
125
+ output_field: guide_content
126
+ event_emissions:
127
+ - signal_name: KNOWLEDGE_ACQUIRED
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Related
133
+
134
+ - [Built-in Tools Overview](../guide_11_builtins.md) — All available built-ins
135
+ - [Self-Evolving Workflows](../advanced_patterns/self_evolving_workflows.md) — Using soe_explore_docs for evolution
@@ -0,0 +1,164 @@
1
+
2
+ # Built-in: Tool Management
3
+
4
+ ## Dynamic Tool Discovery and Invocation
5
+
6
+ These built-in tools enable workflows to **discover and invoke tools dynamically**. Rather than hardcoding tool references, workflows can query available capabilities and invoke tools by name at runtime—enabling truly flexible, self-evolving systems.
7
+
8
+ ---
9
+
10
+ ## Available Tools
11
+
12
+ | Tool | Purpose |
13
+ |------|---------|
14
+ | `soe_get_available_tools` | List all registered tools |
15
+ | `soe_call_tool` | Invoke a tool by name dynamically |
16
+
17
+ ---
18
+
19
+ ## soe_get_available_tools
20
+
21
+ Discover all tools registered in the current orchestration context.
22
+
23
+ ```yaml
24
+ example_workflow:
25
+ ListTools:
26
+ node_type: tool
27
+ event_triggers: [START]
28
+ tool_name: soe_get_available_tools
29
+ output_field: available_tools
30
+ event_emissions:
31
+ - signal_name: TOOLS_LISTED
32
+ ```
33
+
34
+ Returns a list of tool names that can be invoked with `soe_call_tool`.
35
+
36
+ ### Use Cases
37
+
38
+ - **Self-awareness** — Let LLMs understand available capabilities
39
+ - **Dynamic routing** — Choose tools based on current needs
40
+ - **Validation** — Check if a required tool exists before invoking
41
+
42
+ ---
43
+
44
+ ## soe_call_tool
45
+
46
+ Invoke any registered tool by name with JSON arguments.
47
+
48
+ ```yaml
49
+ example_workflow:
50
+ CallDynamicTool:
51
+ node_type: tool
52
+ event_triggers: [START]
53
+ tool_name: soe_call_tool
54
+ context_parameter_field: tool_invocation
55
+ output_field: tool_result
56
+ event_emissions:
57
+ - signal_name: TOOL_CALLED
58
+ ```
59
+
60
+ ### Context Setup
61
+
62
+ The node expects `tool_invocation` in context with:
63
+
64
+ ```python
65
+ {
66
+ "tool_name": "name_of_tool",
67
+ "arguments": '{"arg1": "value1", "arg2": "value2"}'
68
+ }
69
+ ```
70
+
71
+ ### Return Value
72
+
73
+ Returns a result dictionary:
74
+
75
+ ```python
76
+ {
77
+ "success": True,
78
+ "result": { ... } # Tool's return value
79
+ }
80
+ ```
81
+
82
+ Or on error:
83
+
84
+ ```python
85
+ {
86
+ "success": False,
87
+ "error": "Error message"
88
+ }
89
+ ```
90
+
91
+ ### Use Cases
92
+
93
+ - **LLM-driven tool selection** — Let LLMs choose and invoke tools
94
+ - **Dynamic dispatch** — Route to tools based on runtime conditions
95
+ - **Tool orchestration** — Build meta-tools that compose other tools
96
+
97
+ ---
98
+
99
+ ## Dynamic Tool Pattern
100
+
101
+ Combine discovery and invocation for fully dynamic behavior:
102
+
103
+ ```yaml
104
+ dynamic_tool_workflow:
105
+ DiscoverTools:
106
+ node_type: tool
107
+ event_triggers: [START]
108
+ tool_name: soe_get_available_tools
109
+ output_field: available_tools
110
+ event_emissions:
111
+ - signal_name: TOOLS_DISCOVERED
112
+
113
+ InvokeTool:
114
+ node_type: tool
115
+ event_triggers: [TOOLS_DISCOVERED]
116
+ tool_name: soe_call_tool
117
+ context_parameter_field: tool_invocation
118
+ output_field: invocation_result
119
+ event_emissions:
120
+ - signal_name: INVOCATION_COMPLETE
121
+ ```
122
+
123
+ This pattern enables:
124
+
125
+ 1. **Discovery** — First, query available tools
126
+ 2. **Decision** — LLM or router selects appropriate tool
127
+ 3. **Invocation** — Execute the chosen tool dynamically
128
+
129
+ ---
130
+
131
+ ## When to Use
132
+
133
+ ### Use Dynamic Invocation When:
134
+
135
+ - Tool selection depends on runtime context
136
+ - LLMs need to choose from available capabilities
137
+ - Building meta-tools that orchestrate other tools
138
+ - Creating plugin-like architectures
139
+
140
+ ### Use Direct Tool Nodes When:
141
+
142
+ - Tool is always the same
143
+ - No runtime decision needed
144
+ - Performance is critical (direct is faster)
145
+
146
+ ---
147
+
148
+ ## Security Considerations
149
+
150
+ `soe_call_tool` can only invoke tools in the `tools_registry`. It cannot:
151
+
152
+ - Execute arbitrary code
153
+ - Access tools not explicitly registered
154
+ - Bypass tool retry/error handling
155
+
156
+ The registry acts as a whitelist—only tools you register are available.
157
+
158
+ ---
159
+
160
+ ## Related
161
+
162
+ - [Context Management](context.md) — Managing execution state
163
+ - [Workflow Management](workflows.md) — Runtime workflow modification
164
+ - [Self-Evolving Workflows](../advanced_patterns/self_evolving_workflows.md) — Building autonomous systems
@@ -0,0 +1,199 @@
1
+
2
+ # Built-in: Workflow Modification
3
+
4
+ ## Runtime Workflow Evolution
5
+
6
+ These built-in tools enable workflows to **modify themselves at runtime**. This is the core capability for self-evolution—a workflow can inspect its structure, add new nodes, inject new workflows, and remove obsolete components.
7
+
8
+ ---
9
+
10
+ ## Available Tools
11
+
12
+ | Tool | Purpose |
13
+ |------|---------|
14
+ | `soe_get_workflows` | Query registered workflow definitions |
15
+ | `soe_inject_workflow` | Add new workflows to the registry |
16
+ | `soe_inject_node` | Add or modify nodes in existing workflows |
17
+ | `soe_remove_workflow` | Remove workflows from registry |
18
+ | `soe_remove_node` | Remove nodes from workflows |
19
+
20
+ ---
21
+
22
+ ## soe_get_workflows
23
+
24
+ Query the current workflow registry to see all registered workflows and their structure.
25
+
26
+ ```yaml
27
+ example_workflow:
28
+ GetWorkflows:
29
+ node_type: tool
30
+ event_triggers: [START]
31
+ tool_name: soe_get_workflows
32
+ output_field: workflows_list
33
+ event_emissions:
34
+ - signal_name: WORKFLOWS_RETRIEVED
35
+ ```
36
+
37
+ Returns a dictionary of all registered workflows with their node configurations.
38
+
39
+ ### Use Cases
40
+
41
+ - **Introspection** — See what workflows are available
42
+ - **Validation** — Check if a workflow exists before spawning it
43
+ - **Evolution planning** — Understand current structure before modifying
44
+
45
+ ---
46
+
47
+ ## soe_inject_workflow
48
+
49
+ Add a completely new workflow to the registry at runtime.
50
+
51
+ ```yaml
52
+ example_workflow:
53
+ InjectNew:
54
+ node_type: tool
55
+ event_triggers: [START]
56
+ tool_name: soe_inject_workflow
57
+ context_parameter_field: workflow_to_inject
58
+ output_field: injection_result
59
+ event_emissions:
60
+ - signal_name: WORKFLOW_INJECTED
61
+ condition: "{{ result.status == 'success' }}"
62
+ - signal_name: INJECTION_FAILED
63
+ condition: "{{ result.status != 'success' }}"
64
+ ```
65
+
66
+ ### Context Setup
67
+
68
+ The `workflow_to_inject` context field should contain:
69
+
70
+ ```python
71
+ {
72
+ "workflow_name": "new_workflow",
73
+ "workflow_definition": {
74
+ "StartNode": {
75
+ "node_type": "router",
76
+ "event_triggers": ["START"],
77
+ "event_emissions": [{"signal_name": "READY"}]
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ ### Use Cases
84
+
85
+ - **Dynamic workflow creation** — LLM designs new workflows
86
+ - **Plugin systems** — Load workflows based on configuration
87
+ - **A/B testing** — Inject alternative workflow versions
88
+
89
+ ---
90
+
91
+ ## soe_inject_node
92
+
93
+ Add or modify a single node in an existing workflow.
94
+
95
+ ```yaml
96
+ example_workflow:
97
+ InjectNode:
98
+ node_type: tool
99
+ event_triggers: [START]
100
+ tool_name: soe_inject_node
101
+ context_parameter_field: node_to_inject
102
+ output_field: node_injection_result
103
+ event_emissions:
104
+ - signal_name: NODE_INJECTED
105
+ condition: "{{ result.status == 'success' }}"
106
+ ```
107
+
108
+ ### Context Setup
109
+
110
+ The `node_to_inject` context field should contain:
111
+
112
+ ```python
113
+ {
114
+ "workflow_name": "example_workflow",
115
+ "node_name": "NewProcessor",
116
+ "node_configuration": {
117
+ "node_type": "tool",
118
+ "event_triggers": ["PROCESS"],
119
+ "tool_name": "process_data",
120
+ "output_field": "result",
121
+ "event_emissions": [{"signal_name": "PROCESSED"}]
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### Use Cases
127
+
128
+ - **Incremental evolution** — Add nodes one at a time
129
+ - **Patching** — Modify existing node behavior
130
+ - **Extension** — Add new capabilities to existing workflows
131
+
132
+ ---
133
+
134
+ ## soe_remove_workflow
135
+
136
+ Remove a workflow from the registry.
137
+
138
+ ```yaml
139
+ example_workflow:
140
+ RemoveOldWorkflow:
141
+ node_type: tool
142
+ event_triggers: [START]
143
+ tool_name: soe_remove_workflow
144
+ context_parameter_field: remove_params
145
+ output_field: removal_result
146
+ event_emissions:
147
+ - signal_name: WORKFLOW_REMOVED
148
+ ```
149
+
150
+ ---
151
+
152
+ ## soe_remove_node
153
+
154
+ Remove a specific node from a workflow.
155
+
156
+ ```yaml
157
+ example_workflow:
158
+ RemoveNode:
159
+ node_type: tool
160
+ event_triggers: [START]
161
+ tool_name: soe_remove_node
162
+ context_parameter_field: remove_params
163
+ output_field: node_removal_result
164
+ event_emissions:
165
+ - signal_name: NODE_REMOVED
166
+ ```
167
+
168
+ ---
169
+
170
+ ## Evolution Pattern
171
+
172
+ Combine these tools for full self-evolution:
173
+
174
+ ```yaml
175
+ evolving_workflow:
176
+ AnalyzeState:
177
+ node_type: tool
178
+ event_triggers: [START]
179
+ tool_name: soe_get_workflows
180
+ output_field: current_state
181
+ event_emissions:
182
+ - signal_name: STATE_ANALYZED
183
+
184
+ ApplyImprovement:
185
+ node_type: tool
186
+ event_triggers: [STATE_ANALYZED]
187
+ tool_name: soe_inject_node
188
+ context_parameter_field: designed_node
189
+ output_field: injection_result
190
+ event_emissions:
191
+ - signal_name: EVOLVED
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Related
197
+
198
+ - [Built-in Tools Overview](../guide_11_builtins.md) — All available built-ins
199
+ - [Self-Evolving Workflows](../advanced_patterns/self_evolving_workflows.md) — Complete evolution patterns