soe-ai 0.2.0b1__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.
- soe/__init__.py +50 -0
- soe/broker.py +168 -0
- soe/builtin_tools/__init__.py +51 -0
- soe/builtin_tools/soe_add_signal.py +82 -0
- soe/builtin_tools/soe_call_tool.py +111 -0
- soe/builtin_tools/soe_copy_context.py +80 -0
- soe/builtin_tools/soe_explore_docs.py +290 -0
- soe/builtin_tools/soe_get_available_tools.py +42 -0
- soe/builtin_tools/soe_get_context.py +50 -0
- soe/builtin_tools/soe_get_context_schema.py +56 -0
- soe/builtin_tools/soe_get_identities.py +63 -0
- soe/builtin_tools/soe_get_workflows.py +63 -0
- soe/builtin_tools/soe_inject_context_schema_field.py +80 -0
- soe/builtin_tools/soe_inject_identity.py +64 -0
- soe/builtin_tools/soe_inject_node.py +86 -0
- soe/builtin_tools/soe_inject_workflow.py +105 -0
- soe/builtin_tools/soe_list_contexts.py +73 -0
- soe/builtin_tools/soe_remove_context_schema_field.py +61 -0
- soe/builtin_tools/soe_remove_identity.py +61 -0
- soe/builtin_tools/soe_remove_node.py +72 -0
- soe/builtin_tools/soe_remove_workflow.py +62 -0
- soe/builtin_tools/soe_update_context.py +54 -0
- soe/docs/_config.yml +10 -0
- soe/docs/advanced_patterns/guide_fanout_and_aggregations.md +318 -0
- soe/docs/advanced_patterns/guide_inheritance.md +435 -0
- soe/docs/advanced_patterns/hybrid_intelligence.md +237 -0
- soe/docs/advanced_patterns/index.md +49 -0
- soe/docs/advanced_patterns/operational.md +781 -0
- soe/docs/advanced_patterns/self_evolving_workflows.md +385 -0
- soe/docs/advanced_patterns/swarm_intelligence.md +211 -0
- soe/docs/builtins/context.md +164 -0
- soe/docs/builtins/context_schema.md +158 -0
- soe/docs/builtins/identity.md +139 -0
- soe/docs/builtins/soe_explore_docs.md +135 -0
- soe/docs/builtins/tools.md +164 -0
- soe/docs/builtins/workflows.md +199 -0
- soe/docs/guide_00_getting_started.md +341 -0
- soe/docs/guide_01_tool.md +206 -0
- soe/docs/guide_02_llm.md +143 -0
- soe/docs/guide_03_router.md +146 -0
- soe/docs/guide_04_patterns.md +475 -0
- soe/docs/guide_05_agent.md +159 -0
- soe/docs/guide_06_schema.md +397 -0
- soe/docs/guide_07_identity.md +540 -0
- soe/docs/guide_08_child.md +612 -0
- soe/docs/guide_09_ecosystem.md +690 -0
- soe/docs/guide_10_infrastructure.md +427 -0
- soe/docs/guide_11_builtins.md +126 -0
- soe/docs/index.md +104 -0
- soe/docs/primitives/backends.md +281 -0
- soe/docs/primitives/context.md +256 -0
- soe/docs/primitives/node_reference.md +259 -0
- soe/docs/primitives/primitives.md +331 -0
- soe/docs/primitives/signals.md +865 -0
- soe/docs_index.py +2 -0
- soe/init.py +165 -0
- soe/lib/__init__.py +0 -0
- soe/lib/child_context.py +46 -0
- soe/lib/context_fields.py +51 -0
- soe/lib/inheritance.py +172 -0
- soe/lib/jinja_render.py +113 -0
- soe/lib/operational.py +51 -0
- soe/lib/parent_sync.py +71 -0
- soe/lib/register_event.py +75 -0
- soe/lib/schema_validation.py +134 -0
- soe/lib/yaml_parser.py +14 -0
- soe/local_backends/__init__.py +18 -0
- soe/local_backends/factory.py +124 -0
- soe/local_backends/in_memory/context.py +38 -0
- soe/local_backends/in_memory/conversation_history.py +60 -0
- soe/local_backends/in_memory/identity.py +52 -0
- soe/local_backends/in_memory/schema.py +40 -0
- soe/local_backends/in_memory/telemetry.py +38 -0
- soe/local_backends/in_memory/workflow.py +33 -0
- soe/local_backends/storage/context.py +57 -0
- soe/local_backends/storage/conversation_history.py +82 -0
- soe/local_backends/storage/identity.py +118 -0
- soe/local_backends/storage/schema.py +96 -0
- soe/local_backends/storage/telemetry.py +72 -0
- soe/local_backends/storage/workflow.py +56 -0
- soe/nodes/__init__.py +13 -0
- soe/nodes/agent/__init__.py +10 -0
- soe/nodes/agent/factory.py +134 -0
- soe/nodes/agent/lib/loop_handlers.py +150 -0
- soe/nodes/agent/lib/loop_state.py +157 -0
- soe/nodes/agent/lib/prompts.py +65 -0
- soe/nodes/agent/lib/tools.py +35 -0
- soe/nodes/agent/stages/__init__.py +12 -0
- soe/nodes/agent/stages/parameter.py +37 -0
- soe/nodes/agent/stages/response.py +54 -0
- soe/nodes/agent/stages/router.py +37 -0
- soe/nodes/agent/state.py +111 -0
- soe/nodes/agent/types.py +66 -0
- soe/nodes/agent/validation/__init__.py +11 -0
- soe/nodes/agent/validation/config.py +95 -0
- soe/nodes/agent/validation/operational.py +24 -0
- soe/nodes/child/__init__.py +3 -0
- soe/nodes/child/factory.py +61 -0
- soe/nodes/child/state.py +59 -0
- soe/nodes/child/validation/__init__.py +11 -0
- soe/nodes/child/validation/config.py +126 -0
- soe/nodes/child/validation/operational.py +28 -0
- soe/nodes/lib/conditions.py +71 -0
- soe/nodes/lib/context.py +24 -0
- soe/nodes/lib/conversation_history.py +77 -0
- soe/nodes/lib/identity.py +64 -0
- soe/nodes/lib/llm_resolver.py +142 -0
- soe/nodes/lib/output.py +68 -0
- soe/nodes/lib/response_builder.py +91 -0
- soe/nodes/lib/signal_emission.py +79 -0
- soe/nodes/lib/signals.py +54 -0
- soe/nodes/lib/tools.py +100 -0
- soe/nodes/llm/__init__.py +7 -0
- soe/nodes/llm/factory.py +103 -0
- soe/nodes/llm/state.py +76 -0
- soe/nodes/llm/types.py +12 -0
- soe/nodes/llm/validation/__init__.py +11 -0
- soe/nodes/llm/validation/config.py +89 -0
- soe/nodes/llm/validation/operational.py +23 -0
- soe/nodes/router/__init__.py +3 -0
- soe/nodes/router/factory.py +37 -0
- soe/nodes/router/state.py +32 -0
- soe/nodes/router/validation/__init__.py +11 -0
- soe/nodes/router/validation/config.py +58 -0
- soe/nodes/router/validation/operational.py +16 -0
- soe/nodes/tool/factory.py +66 -0
- soe/nodes/tool/lib/__init__.py +11 -0
- soe/nodes/tool/lib/conditions.py +35 -0
- soe/nodes/tool/lib/failure.py +28 -0
- soe/nodes/tool/lib/parameters.py +67 -0
- soe/nodes/tool/state.py +66 -0
- soe/nodes/tool/types.py +27 -0
- soe/nodes/tool/validation/__init__.py +15 -0
- soe/nodes/tool/validation/config.py +132 -0
- soe/nodes/tool/validation/operational.py +16 -0
- soe/types.py +209 -0
- soe/validation/__init__.py +18 -0
- soe/validation/config.py +195 -0
- soe/validation/jinja.py +54 -0
- soe/validation/operational.py +110 -0
- soe_ai-0.2.0b1.dist-info/METADATA +262 -0
- soe_ai-0.2.0b1.dist-info/RECORD +145 -0
- soe_ai-0.2.0b1.dist-info/WHEEL +5 -0
- soe_ai-0.2.0b1.dist-info/licenses/LICENSE +21 -0
- soe_ai-0.2.0b1.dist-info/top_level.txt +1 -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,158 @@
|
|
|
1
|
+
|
|
2
|
+
# Built-in: Context Schema Management
|
|
3
|
+
|
|
4
|
+
## Runtime Schema Control
|
|
5
|
+
|
|
6
|
+
These built-in tools enable workflows to **manage context schemas at runtime**. Context schemas define the structure and types of context fields—querying, adding, and removing fields enables self-evolving data structures.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Available Tools
|
|
11
|
+
|
|
12
|
+
| Tool | Purpose |
|
|
13
|
+
|------|---------|
|
|
14
|
+
| `soe_get_context_schema` | Query current context schema |
|
|
15
|
+
| `soe_inject_context_schema_field` | Add or update a schema field |
|
|
16
|
+
| `soe_remove_context_schema_field` | Remove a schema field |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## soe_get_context_schema
|
|
21
|
+
|
|
22
|
+
Query the context schema for the current execution.
|
|
23
|
+
|
|
24
|
+
### Parameters
|
|
25
|
+
|
|
26
|
+
| Parameter | Type | Default | Description |
|
|
27
|
+
|-----------|------|---------|-------------|
|
|
28
|
+
| `field_name` | `Optional[str]` | `None` | Get a specific field's definition |
|
|
29
|
+
|
|
30
|
+
### Return Values
|
|
31
|
+
|
|
32
|
+
- **No parameters**: Returns full schema dict of `field_name -> field_definition`
|
|
33
|
+
- **`field_name` provided**: Returns `{"field_name": "...", "definition": {...}}`
|
|
34
|
+
- **Not found**: Returns `{"error": "...", "available": [...]}`
|
|
35
|
+
|
|
36
|
+
### Use Cases
|
|
37
|
+
|
|
38
|
+
- **Introspection** — Let LLMs understand expected data structure
|
|
39
|
+
- **Validation** — Check schema before writing context
|
|
40
|
+
- **Documentation** — Generate field descriptions dynamically
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## soe_inject_context_schema_field
|
|
45
|
+
|
|
46
|
+
Add or update a single field in the context schema.
|
|
47
|
+
|
|
48
|
+
### Parameters
|
|
49
|
+
|
|
50
|
+
| Parameter | Type | Description |
|
|
51
|
+
|-----------|------|-------------|
|
|
52
|
+
| `field_name` | `str` | Name of the field to add/update |
|
|
53
|
+
| `field_definition` | `str` | JSON or YAML string with field definition |
|
|
54
|
+
|
|
55
|
+
### Field Definition Format
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "User's preferred language",
|
|
61
|
+
"required": false,
|
|
62
|
+
"default": "en"
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or in YAML:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
type: object
|
|
70
|
+
description: User preferences
|
|
71
|
+
properties:
|
|
72
|
+
theme: string
|
|
73
|
+
language: string
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Return Value
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
{
|
|
80
|
+
"success": True,
|
|
81
|
+
"field_name": "user_preferences",
|
|
82
|
+
"action": "created", # or "updated"
|
|
83
|
+
"message": "Successfully created field 'user_preferences' in context schema"
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Use Cases
|
|
88
|
+
|
|
89
|
+
- **Dynamic schemas** — Add fields based on workflow needs
|
|
90
|
+
- **Self-evolution** — Workflows define their own data structures
|
|
91
|
+
- **Extension** — Add domain-specific fields at runtime
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## soe_remove_context_schema_field
|
|
96
|
+
|
|
97
|
+
Remove a single field from the context schema.
|
|
98
|
+
|
|
99
|
+
### Parameters
|
|
100
|
+
|
|
101
|
+
| Parameter | Type | Description |
|
|
102
|
+
|-----------|------|-------------|
|
|
103
|
+
| `field_name` | `str` | Name of field to remove |
|
|
104
|
+
|
|
105
|
+
### Return Value
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
{
|
|
109
|
+
"removed": True,
|
|
110
|
+
"field_name": "deprecated_field",
|
|
111
|
+
"message": "Successfully removed field 'deprecated_field' from context schema"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Raises `ValueError` if field not found.
|
|
116
|
+
|
|
117
|
+
### Use Cases
|
|
118
|
+
|
|
119
|
+
- **Cleanup** — Remove unused schema fields
|
|
120
|
+
- **Refactoring** — Remove deprecated fields
|
|
121
|
+
- **Evolution** — Replace outdated field definitions
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Schema Patterns
|
|
126
|
+
|
|
127
|
+
### Self-Documenting Workflows
|
|
128
|
+
|
|
129
|
+
A workflow that describes its own data requirements:
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
self_documenting:
|
|
134
|
+
DescribeNeeds:
|
|
135
|
+
node_type: llm
|
|
136
|
+
event_triggers: [START]
|
|
137
|
+
prompt: "Based on task {{ context.task }}, what data fields do we need?"
|
|
138
|
+
output_field: needed_fields
|
|
139
|
+
event_emissions:
|
|
140
|
+
- signal_name: NEEDS_DESCRIBED
|
|
141
|
+
|
|
142
|
+
CreateSchema:
|
|
143
|
+
node_type: tool
|
|
144
|
+
event_triggers: [NEEDS_DESCRIBED]
|
|
145
|
+
tool_name: soe_inject_context_schema_field
|
|
146
|
+
context_parameter_field: schema_field_config
|
|
147
|
+
output_field: schema_result
|
|
148
|
+
event_emissions:
|
|
149
|
+
- signal_name: SCHEMA_READY
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Related
|
|
156
|
+
|
|
157
|
+
- [Built-in Tools Overview](../guide_11_builtins.md) — All available built-ins
|
|
158
|
+
- [Context Schema Guide](../guide_06_schema.md) — Schema fundamentals
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
|
|
2
|
+
# Built-in: Identity Management
|
|
3
|
+
|
|
4
|
+
## Runtime Identity Control
|
|
5
|
+
|
|
6
|
+
These built-in tools enable workflows to **manage identities at runtime**. Identities define the system prompts for LLM personas—querying, adding, and removing them enables dynamic personality switching and self-evolving agents.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Available Tools
|
|
11
|
+
|
|
12
|
+
| Tool | Purpose |
|
|
13
|
+
|------|---------|
|
|
14
|
+
| `soe_get_identities` | Query current identity definitions |
|
|
15
|
+
| `soe_inject_identity` | Add or update an identity |
|
|
16
|
+
| `soe_remove_identity` | Remove an identity |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## soe_get_identities
|
|
21
|
+
|
|
22
|
+
Query identity definitions from the current execution.
|
|
23
|
+
|
|
24
|
+
### Parameters
|
|
25
|
+
|
|
26
|
+
| Parameter | Type | Default | Description |
|
|
27
|
+
|-----------|------|---------|-------------|
|
|
28
|
+
| `identity_name` | `Optional[str]` | `None` | Get a specific identity |
|
|
29
|
+
| `list_only` | `bool` | `False` | Return only identity names |
|
|
30
|
+
|
|
31
|
+
### Return Values
|
|
32
|
+
|
|
33
|
+
- **No parameters**: Returns full dict of `identity_name -> system_prompt`
|
|
34
|
+
- **`list_only=True`**: Returns `{"identity_names": ["assistant", "expert", ...]}`
|
|
35
|
+
- **`identity_name` provided**: Returns `{"identity_name": "...", "system_prompt": "..."}`
|
|
36
|
+
- **Not found**: Returns `{"error": "...", "available": [...]}`
|
|
37
|
+
|
|
38
|
+
### Use Cases
|
|
39
|
+
|
|
40
|
+
- **Introspection** — Let LLMs see available personas
|
|
41
|
+
- **Decision making** — Choose identity based on task
|
|
42
|
+
- **Debugging** — Inspect identity configuration
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## soe_inject_identity
|
|
47
|
+
|
|
48
|
+
Add or update a single identity definition.
|
|
49
|
+
|
|
50
|
+
### Parameters
|
|
51
|
+
|
|
52
|
+
| Parameter | Type | Description |
|
|
53
|
+
|-----------|------|-------------|
|
|
54
|
+
| `identity_name` | `str` | Name/key for the identity |
|
|
55
|
+
| `system_prompt` | `str` | The system prompt text |
|
|
56
|
+
|
|
57
|
+
### Return Value
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
{
|
|
61
|
+
"success": True,
|
|
62
|
+
"identity_name": "expert",
|
|
63
|
+
"action": "created", # or "updated"
|
|
64
|
+
"message": "Successfully created identity 'expert'"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Use Cases
|
|
69
|
+
|
|
70
|
+
- **Dynamic personas** — Create identities based on user needs
|
|
71
|
+
- **Self-evolution** — Workflows define their own personas
|
|
72
|
+
- **Specialization** — Add domain-specific identities at runtime
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## soe_remove_identity
|
|
77
|
+
|
|
78
|
+
Remove a single identity definition.
|
|
79
|
+
|
|
80
|
+
### Parameters
|
|
81
|
+
|
|
82
|
+
| Parameter | Type | Description |
|
|
83
|
+
|-----------|------|-------------|
|
|
84
|
+
| `identity_name` | `str` | Name of identity to remove |
|
|
85
|
+
|
|
86
|
+
### Return Value
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
{
|
|
90
|
+
"removed": True,
|
|
91
|
+
"identity_name": "old_persona",
|
|
92
|
+
"message": "Successfully removed identity 'old_persona'"
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Raises `ValueError` if identity not found.
|
|
97
|
+
|
|
98
|
+
### Use Cases
|
|
99
|
+
|
|
100
|
+
- **Cleanup** — Remove unused personas
|
|
101
|
+
- **Reset** — Clear identities before reconfiguration
|
|
102
|
+
- **Evolution** — Replace outdated personas
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Identity Patterns
|
|
107
|
+
|
|
108
|
+
### Dynamic Persona Selection
|
|
109
|
+
|
|
110
|
+
A workflow that chooses its identity based on task:
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
dynamic_persona:
|
|
115
|
+
AnalyzeTask:
|
|
116
|
+
node_type: llm
|
|
117
|
+
event_triggers: [START]
|
|
118
|
+
prompt: "Analyze this task and suggest a persona: {{ context.task }}"
|
|
119
|
+
output_field: suggested_persona
|
|
120
|
+
event_emissions:
|
|
121
|
+
- signal_name: PERSONA_SUGGESTED
|
|
122
|
+
|
|
123
|
+
CreatePersona:
|
|
124
|
+
node_type: tool
|
|
125
|
+
event_triggers: [PERSONA_SUGGESTED]
|
|
126
|
+
tool_name: soe_inject_identity
|
|
127
|
+
context_parameter_field: persona_config
|
|
128
|
+
output_field: identity_result
|
|
129
|
+
event_emissions:
|
|
130
|
+
- signal_name: PERSONA_READY
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Related
|
|
137
|
+
|
|
138
|
+
- [Built-in Tools Overview](../guide_11_builtins.md) — All available built-ins
|
|
139
|
+
- [Identity Guide](../guide_07_identity.md) — Identity fundamentals
|
|
@@ -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
|