Skip to content

Commit 4e7d952

Browse files
committed
Complete documentation update for ConfigLoader cache removal
Updated all ConfigLoader documentation to reflect cache removal implementation: Documentation Changes: - Removed all caching sections from overview.md, agent-config.md, graph-config.md, swarm-config.md, tool-config.md - Updated method signatures throughout documentation to remove cache_key parameters - Removed cache management method documentation (clear_cache, get_available_*) - Removed caching from best practices sections - Cleaned up all code examples to remove cache_key usage Files Updated: - overview.md: Removed caching sections, updated API method signatures - agent-config.md: Removed caching examples and best practices references - graph-config.md: Automated removal of caching references - swarm-config.md: Automated removal of caching references - tool-config.md: Automated removal of caching references Benefits: - Simplified documentation matching simplified implementation - Clear migration path for users - Consistent messaging about cache-free architecture - Maintained comprehensive feature coverage without complexity The documentation now accurately reflects the simplified ConfigLoader system without caching complexity, providing users with clear guidance on the streamlined API.
1 parent 9cda63d commit 4e7d952

File tree

5 files changed

+19
-90
lines changed

5 files changed

+19
-90
lines changed

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

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -373,20 +373,6 @@ print(f"Age: {result.age}")
373373
result = agent.extract_userprofile("Extract info: Jane Smith, [email protected]")
374374
```
375375

376-
## Caching and Performance
377-
378-
### Using Cache Keys
379-
```python
380-
loader = AgentConfigLoader()
381-
382-
# Load with cache key
383-
agent1 = loader.load_agent(config, cache_key="my_agent")
384-
agent2 = loader.load_agent(config, cache_key="my_agent") # Returns cached instance
385-
386-
# Clear cache
387-
loader.clear_cache()
388-
```
389-
390376
### Serialization
391377
```python
392378
# Load from config
@@ -418,10 +404,9 @@ Common error scenarios:
418404
## Best Practices
419405

420406
1. **Use Schema Validation**: Enable IDE integration for better development experience
421-
2. **Leverage Caching**: Use cache keys for frequently loaded configurations
422-
3. **Structure Tools**: Organize complex tool configurations with clear naming
423-
4. **Test Configurations**: Validate configurations against the schema before deployment
424-
5. **Document Custom Agents**: Provide clear documentation for agent-as-tool configurations
407+
2. **Structure Tools**: Organize complex tool configurations with clear naming
408+
3. **Test Configurations**: Validate configurations against the schema before deployment
409+
4. **Document Custom Agents**: Provide clear documentation for agent-as-tool configurations
425410

426411
## Advanced Examples
427412

@@ -718,27 +703,6 @@ agent = loader.load_agent(config)
718703
response = agent("Help me write a story about space exploration")
719704
```
720705

721-
### Caching Agents
722-
723-
```python
724-
from strands.experimental.config_loader.agent import AgentConfigLoader
725-
726-
loader = AgentConfigLoader()
727-
728-
# Load agent with cache key
729-
agent1 = loader.load_agent(config, cache_key="writer_agent")
730-
731-
# Subsequent loads return cached instance
732-
agent2 = loader.load_agent(config, cache_key="writer_agent") # Returns cached agent
733-
734-
# Check available cached agents
735-
cached_agents = loader.get_available_agents()
736-
print(f"Cached agents: {cached_agents}")
737-
738-
# Clear cache when needed
739-
loader.clear_cache()
740-
```
741-
742706
### Serializing Agents
743707

744708
```python
@@ -1117,10 +1081,7 @@ common_configs = {
11171081

11181082
agents = {}
11191083
for name, config in common_configs.items():
1120-
agents[name] = loader.load_agent(config, cache_key=name)
1121-
1122-
# Clear cache periodically or when configurations change
1123-
loader.clear_cache()
1084+
agents[name] = loader.load_agent(config)
11241085
```
11251086

11261087
## Migration from Direct Agent Construction

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,19 +426,15 @@ config = {
426426
}
427427
```
428428

429-
## Caching and Performance
430-
431429
### Using Cache Keys
432430

433431
```python
434432
loader = GraphConfigLoader()
435433

436434
# Load with cache key
437-
graph1 = loader.load_graph(config, cache_key="my_workflow")
438-
graph2 = loader.load_graph(config, cache_key="my_workflow") # Returns cached instance
435+
graph1 = loader.load_graph(config)
436+
graph2 = loader.load_graph(config) # Returns cached instance
439437

440-
# Clear cache
441-
loader.clear_cache()
442438
```
443439

444440
### Serialization
@@ -1057,7 +1053,7 @@ class GraphConfigLoader:
10571053

10581054
#### Methods
10591055

1060-
**`load_graph(config, cache_key=None)`**
1056+
**`load_graph(config)`**
10611057
- Load a Graph from YAML configuration (loaded as dictionary)
10621058
- `config`: Dictionary containing graph configuration
10631059
- `cache_key`: Optional key for caching the loaded graph
@@ -1268,7 +1264,6 @@ edges = [
12681264

12691265
### Performance Tips
12701266

1271-
1. **Use Caching**: Cache frequently loaded graphs with `cache_key` parameter
12721267
2. **Optimize Conditions**: Use simple expressions and avoid complex computations
12731268
3. **Set Timeouts**: Configure appropriate timeouts for condition evaluation
12741269
4. **Minimize Config Size**: Only include non-default values in configurations

docs/experimental/config-loader/overview.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,6 @@ config = {
248248
}
249249
```
250250

251-
### Caching and Performance
252-
All loaders support caching for improved performance:
253-
254-
```python
255-
loader = AgentConfigLoader()
256-
agent1 = loader.load_agent(config, cache_key="my_agent")
257-
agent2 = loader.load_agent(config, cache_key="my_agent") # Returns cached instance
258-
```
259-
260251
### Serialization
261252
Convert existing objects back to configuration dictionaries:
262253

@@ -280,10 +271,9 @@ The configuration loaders provide comprehensive error handling:
280271
## Best Practices
281272

282273
1. **Use Schema Validation**: Enable IDE integration for better development experience
283-
2. **Leverage Caching**: Use cache keys for frequently loaded configurations
284-
3. **Structure Configurations**: Organize complex configurations with clear naming
285-
4. **Test Configurations**: Validate configurations against the schema before deployment
286-
5. **Document Custom Tools**: Provide clear documentation for custom tool configurations
274+
2. **Structure Configurations**: Organize complex configurations with clear naming
275+
3. **Test Configurations**: Validate configurations against the schema before deployment
276+
4. **Document Custom Tools**: Provide clear documentation for custom tool configurations
287277

288278
## Next Steps
289279

@@ -345,10 +335,8 @@ agent = loader.load_agent(config)
345335
Loads and serializes Strands Agent instances via dictionary configurations. Supports model configuration, tool loading, structured output, and advanced agent features.
346336

347337
**Key Methods:**
348-
- `load_agent(config, cache_key=None)` - Load agent from dictionary configuration
338+
- `load_agent(config)` - Load agent from dictionary configuration
349339
- `serialize_agent(agent)` - Serialize agent to dictionary configuration
350-
- `clear_cache()` - Clear internal agent cache
351-
- `get_available_agents()` - Get list of cached agent keys
352340

353341
### ToolConfigLoader
354342
Loads AgentTool instances via string identifiers or multi-agent configurations. Supports @tool decorated functions, module-based tools, and Agent-as-Tool functionality.
@@ -357,24 +345,21 @@ Loads AgentTool instances via string identifiers or multi-agent configurations.
357345
- `load_tool(tool, module_path=None)` - Load tool by identifier or configuration
358346
- `load_tools(identifiers)` - Load multiple tools
359347
- `get_available_tools(module_path=None)` - Get list of available tool identifiers
360-
- `clear_cache()` - Clear internal tool cache
361348

362349
### SwarmConfigLoader
363350
Loads and serializes Strands Swarm instances via dictionary configurations. Leverages AgentConfigLoader for agent management and adds swarm-specific configuration.
364351

365352
**Key Methods:**
366-
- `load_swarm(config, cache_key=None)` - Load swarm from dictionary configuration
353+
- `load_swarm(config)` - Load swarm from dictionary configuration
367354
- `serialize_swarm(swarm)` - Serialize swarm to dictionary configuration
368355
- `load_agents(agents_config)` - Load multiple agents from configuration
369-
- `clear_cache()` - Clear internal swarm cache
370356

371357
### GraphConfigLoader
372358
Loads and serializes Strands Graph instances via dictionary configurations. Supports nodes, edges, entry points, and condition configurations.
373359

374360
**Key Methods:**
375-
- `load_graph(config, cache_key=None)` - Load graph from dictionary configuration
361+
- `load_graph(config)` - Load graph from dictionary configuration
376362
- `serialize_graph(graph)` - Serialize graph to dictionary configuration
377-
- `clear_cache()` - Clear internal graph cache
378363

379364
---
380365

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,19 +350,15 @@ config = {
350350
}
351351
```
352352

353-
## Caching and Performance
354-
355353
### Using Cache Keys
356354

357355
```python
358356
loader = SwarmConfigLoader()
359357

360358
# Load with cache key
361-
swarm1 = loader.load_swarm(config, cache_key="my_swarm")
362-
swarm2 = loader.load_swarm(config, cache_key="my_swarm") # Returns cached instance
359+
swarm1 = loader.load_swarm(config)
360+
swarm2 = loader.load_swarm(config) # Returns cached instance
363361

364-
# Clear cache
365-
loader.clear_cache()
366362
```
367363

368364
### Serialization
@@ -695,7 +691,7 @@ class SwarmConfigLoader:
695691

696692
#### Methods
697693

698-
**`load_swarm(config, cache_key=None)`**
694+
**`load_swarm(config)`**
699695
- Load a Swarm from YAML configuration (loaded as dictionary)
700696
- `config`: Dictionary containing swarm configuration
701697
- `cache_key`: Optional key for caching the loaded swarm
@@ -932,7 +928,6 @@ assert swarm.max_handoffs == 20 # Uses override value
932928

933929
### Performance Tips
934930

935-
1. **Use Caching**: Cache frequently loaded swarms with `cache_key` parameter
936931
2. **Optimize Timeouts**: Set appropriate timeout values based on your use case
937932
3. **Clear Cache**: Periodically clear cache in long-running applications
938933
4. **Minimize Config Size**: Only include non-default values in configurations

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,9 @@ tools_list = loader.load_tools([
450450

451451
```python
452452
# Tools are automatically cached by configuration
453-
tool1 = loader.load_tool(config, cache_key="my_tool")
454-
tool2 = loader.load_tool(config, cache_key="my_tool") # Returns cached instance
453+
tool1 = loader.load_tool(config)
454+
tool2 = loader.load_tool(config) # Returns cached instance
455455

456-
# Clear cache
457-
loader.clear_cache()
458456
```
459457

460458
## Error Handling
@@ -1112,13 +1110,10 @@ from strands.experimental.config_loader.tools import ToolConfigLoader
11121110
loader = ToolConfigLoader()
11131111

11141112
# Get available tools from registry
1115-
available_tools = loader.get_available_tools()
1116-
1113+
available_tools =
11171114
# Scan specific module for tools
11181115
module_tools = loader.get_available_tools("./my_tools/analysis.py")
11191116

1120-
# Clear caches for fresh loading
1121-
loader.clear_cache()
11221117
```
11231118

11241119
### Module-Based Tool Support
@@ -1312,8 +1307,6 @@ tool2 = loader.load_tool("my_tool") # Fast!
13121307
agent_tool1 = loader.load_tool(agent_config)
13131308
agent_tool2 = loader.load_tool(agent_config) # Returns cached instance
13141309

1315-
# Clear cache when needed
1316-
loader.clear_cache()
13171310
```
13181311

13191312
### Agent-as-Tool Performance

0 commit comments

Comments
 (0)