Skip to content

Commit fad5332

Browse files
committed
Update documentation
1 parent e55788f commit fad5332

File tree

6 files changed

+388
-240
lines changed

6 files changed

+388
-240
lines changed

docs/experimental/config-loader/agent-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Agent Configuration Loading
22

3-
The Agent Configuration Loader enables you to create and configure Strands Agents using Python dictionaries. This approach provides a declarative way to define agent behavior, making it easier to manage complex agent configurations, version control agent definitions, and dynamically create agents at runtime.
3+
The Agent Configuration Loader enables you to create and configure Strands Agents using Python dictionaries. This approach provides a programmatic way to define agent behavior, making it easier to manage complex agent configurations, build configuration management systems, and dynamically create agents at runtime.
44

5-
**Note**: This is an experimental feature that provides programmatic configuration loading. For file-based configuration (YAML/JSON), use the main Agent constructor's `config` parameter.
5+
**Note**: This is an experimental feature that provides programmatic configuration loading through dictionaries. For file-based configuration (YAML/JSON), use the main Agent constructor's `config` parameter.
66

77
## Quick Start
88

docs/experimental/config-loader/graph-config.md

Lines changed: 50 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# GraphConfigLoader
22

3-
The GraphConfigLoader enables serialization and deserialization of Strands `Graph` instances to/from YAML configurations, supporting persistence, version control, and dynamic graph construction. This implementation allows complex multi-agent workflows to be defined declaratively and managed as configuration.
3+
The GraphConfigLoader enables serialization and deserialization of Strands `Graph` instances to/from dictionary configurations, supporting persistence, version control, and dynamic graph construction. This implementation allows complex multi-agent workflows to be defined programmatically and managed as configuration.
4+
5+
**Note**: This is an experimental feature that provides programmatic graph configuration loading through dictionaries. For file-based configuration, use the main Graph constructor's `config` parameter.
46

57
## Overview
68

79
The GraphConfigLoader provides functionality to:
8-
- Load graphs from YAML/dictionary configurations
9-
- Serialize existing graphs to YAML-compatible configurations
10+
- Load graphs from dictionary configurations
11+
- Serialize existing graphs to dictionary configurations
1012
- Support all graph elements: nodes, edges, entry points, and conditions
1113
- Maintain referential integrity between graph components
1214
- Enable dynamic graph construction from configuration
@@ -17,12 +19,51 @@ The GraphConfigLoader provides functionality to:
1719
### Method 1: Using GraphConfigLoader directly
1820

1921
```python
20-
import yaml
2122
from strands.experimental.config_loader.graph import GraphConfigLoader
2223

23-
# Load graph from YAML configuration
24-
with open('workflow.yml', 'r') as f:
25-
config = yaml.safe_load(f)
24+
# Define graph configuration
25+
config = {
26+
"graph_id": "research_workflow",
27+
"name": "Research Team Workflow",
28+
"description": "Processes research requests through specialized team members",
29+
"nodes": [
30+
{
31+
"node_id": "classifier",
32+
"type": "agent",
33+
"config": {
34+
"name": "classifier",
35+
"model": "us.amazon.nova-lite-v1:0",
36+
"system_prompt": "You are a request classifier.",
37+
"tools": []
38+
}
39+
},
40+
{
41+
"node_id": "processor",
42+
"type": "agent",
43+
"config": {
44+
"name": "processor",
45+
"model": "us.amazon.nova-pro-v1:0",
46+
"system_prompt": "You are a request processor.",
47+
"tools": []
48+
}
49+
}
50+
],
51+
"edges": [
52+
{
53+
"from_node": "classifier",
54+
"to_node": "processor",
55+
"condition": {
56+
"type": "expression",
57+
"expression": "state.results.get('classifier', {}).get('status') == 'completed'"
58+
}
59+
}
60+
],
61+
"entry_points": ["classifier"],
62+
"max_node_executions": 100,
63+
"execution_timeout": 300.0,
64+
"node_timeout": 30.0,
65+
"reset_on_revisit": False
66+
}
2667

2768
loader = GraphConfigLoader()
2869
graph = loader.load_graph(config)
@@ -31,12 +72,12 @@ graph = loader.load_graph(config)
3172
result = graph("Analyze the impact of remote work on productivity")
3273
```
3374

34-
### Method 2: Using GraphBuilder.from_config() (Recommended)
75+
### Method 2: Using GraphBuilder.from_config() (File-based)
3576

3677
```python
3778
from strands.multiagent import GraphBuilder
3879

39-
# Load from YAML file and customize
80+
# Load from YAML file and customize (not GraphConfigLoader)
4081
builder = GraphBuilder.from_config('workflow.yml')
4182

4283
# Add custom nodes or modify configuration
@@ -46,58 +87,6 @@ builder.set_max_node_executions(100)
4687
# Build final graph
4788
graph = builder.build()
4889
```
49-
50-
## Configuration Schema
51-
52-
### Basic Structure
53-
54-
```yaml
55-
# Basic graph configuration
56-
graph_id: "research_workflow"
57-
name: "Research Team Workflow"
58-
description: "Processes research requests through specialized team members"
59-
60-
nodes:
61-
- node_id: "classifier"
62-
type: "agent"
63-
config:
64-
name: "classifier"
65-
model: "us.amazon.nova-lite-v1:0"
66-
system_prompt: "You are a request classifier."
67-
tools: []
68-
69-
- node_id: "processor"
70-
type: "agent"
71-
config:
72-
name: "processor"
73-
model: "us.amazon.nova-pro-v1:0"
74-
system_prompt: "You are a request processor."
75-
tools: []
76-
77-
edges:
78-
- from_node: "classifier"
79-
to_node: "processor"
80-
condition:
81-
type: "expression"
82-
expression: "state.results.get('classifier', {}).get('status') == 'completed'"
83-
84-
entry_points:
85-
- "classifier"
86-
87-
# Graph execution configuration
88-
max_node_executions: 100
89-
execution_timeout: 300.0
90-
node_timeout: 30.0
91-
reset_on_revisit: false
92-
```
93-
94-
### Node Types
95-
96-
#### Agent Nodes
97-
98-
```yaml
99-
nodes:
100-
- node_id: "data_processor"
10190
type: "agent"
10291
config:
10392
# Full agent configuration (as supported by AgentConfigLoader)

0 commit comments

Comments
 (0)