Skip to content

Commit 4350047

Browse files
awsarroncagataycaliCagatay Cali
authored
v0.1.1 (#3)
* feat(config): maximize Bedrock model configuration settings (#1) - Set Claude 3.7 Sonnet as default model with max tokens (64000) - Extend timeouts to 15 minutes (900s) to prevent API timeouts - Add adaptive retries for improved reliability - Enable thinking capability with 2048 token budget - Add STRANDS_MAX_TOKENS and STRANDS_BUDGET_TOKENS env variables - Document configuration options in README Co-authored-by: Cagatay Cali <[email protected]> * chore(release): bump version to 0.1.1 and update project descriptions (#2) * feat(config): maximize Bedrock model configuration settings - Set Claude 3.7 Sonnet as default model with max tokens (64000) - Extend timeouts to 15 minutes (900s) to prevent API timeouts - Add adaptive retries for improved reliability - Enable thinking capability with 2048 token budget - Add STRANDS_MAX_TOKENS and STRANDS_BUDGET_TOKENS env variables - Document configuration options in README * chore(release): bump version to 0.1.1 and update project descriptions * Improve README.md to better reflect agent-building focus * Improve README.md to better reflect agent-building focus * Improve README.md to better reflect agent-building focus --------- Co-authored-by: Cagatay Cali <[email protected]> --------- Co-authored-by: ./c² <[email protected]> Co-authored-by: Cagatay Cali <[email protected]>
1 parent b1d808b commit 4350047

File tree

5 files changed

+106
-39
lines changed

5 files changed

+106
-39
lines changed

README.md

Lines changed: 79 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
# Strands CLI
1+
# Strands Agent Builder
22

3-
> When terminal meets intelligence: AI at your fingertips.
4-
5-
A minimalist Strands Agents-powered CLI assistant for your terminal. Strands brings the power of Claude 3.7 Sonnet to your command line with advanced tool integration and knowledge base capabilities.
3+
An interactive Strands agent toolkit designed to help you build, test, and extend your own custom AI agents and tools. With the Strands Agent Builder, you can create specialized agents, develop custom tools, and compose complex AI workflows—all from your terminal.
64

75
## Quick Start
86

97
```bash
108
# Install
119
pipx install strands-agents-builder
1210

13-
# Run interactive mode
11+
# Run interactive mode for agent development
1412
strands
1513

16-
# One-off query
17-
strands "What's the capital of France?"
14+
# Build a custom tool and use it immediately
15+
strands "Create a tool named sentiment_analyzer that analyzes text sentiment and test it with some examples"
1816

19-
# Pipe content
20-
cat document.txt | strands "Summarize this"
17+
# Pipe content to build an agent based on specifications
18+
cat agent-spec.txt | strands "Build a specialized agent based on these specifications"
2119

22-
# Use with knowledge base
23-
strands --kb YOUR_KB_ID "Tell me about our project"
20+
# Use with knowledge base to extend existing tools
21+
strands --kb YOUR_KB_ID "Load my previous calculator tool and enhance it with scientific functions"
2422
```
2523

2624
## Features
2725

26+
- 🏗️ Create and test custom tools with instant hot-reloading
27+
- 🤖 Build specialized agents with focused capabilities
28+
- 🔄 Extend existing tools and enhance their functionality
2829
- 💬 Interactive command-line interface with rich output
29-
- 🔍 One-off queries via arguments or pipes
3030
- 🛠️ Powerful integrated tools (12+ tools including shell, editor, HTTP, Python)
31-
- 🧠 Knowledge base integration for memory and context
32-
- 🎮 Customizable system prompt
31+
- 🧠 Knowledge base integration for persisting and loading tools
32+
- 🎮 Customizable system prompt for specialized agents
3333
- 🪄 Nested agent capabilities with tool delegation
3434
- 🔧 Dynamic tool loading for extending functionality
3535
- 🖥️ Environment variable management and customization
@@ -53,39 +53,87 @@ Strands comes with a comprehensive set of built-in tools:
5353

5454
## Knowledge Base Integration
5555

56-
Strands can leverage Amazon Bedrock Knowledge Bases to retrieve information and remember conversations.
56+
Strands Agent Builder leverages Amazon Bedrock Knowledge Bases to store and retrieve custom tools, agent configurations, and development history.
5757

5858
```bash
59-
# Specify knowledge base via command line
60-
strands --kb YOUR_KB_ID "What does our API do?"
59+
# Load and extend tools from your knowledge base
60+
strands --kb YOUR_KB_ID "Load my data_visualizer tool and add 3D plotting capabilities"
6161

6262
# Or set a default knowledge base via environment variable
6363
export STRANDS_KNOWLEDGE_BASE_ID="YOUR_KB_ID"
64-
strands "What were our key decisions last week?"
64+
strands "Find my most recent agent configuration and make it more efficient"
6565
```
6666

6767
Features:
68-
- 🔄 Automatic retrieval of relevant information before answering queries
69-
- 💾 Conversation storage for building persistent memory
70-
- 📝 Every exchange is stored with proper formatting for future reference
71-
- 🔍 Contextual awareness across multiple conversations
68+
- 🔄 Retrieve previously created tools and agent configurations
69+
- 💾 Persistent storage for your custom tools and agents
70+
- 🛠️ Ability to iteratively improve tools across sessions
71+
- 🔍 Find and extend tools built in previous sessions
7272

7373
## Nested Agent Capabilities
7474

75-
Use the `strands` tool to create specialized sub-agents with their own tools and system prompts:
75+
Use the `strands` tool to prototype and test specialized sub-agents with their own tools and system prompts:
7676

7777
```python
78-
# Basic usage
79-
agent.tool.strand(query="List files in the current directory")
78+
# Create a specialized data analysis agent
79+
agent.tool.strand(
80+
query="Build and test a data analysis agent",
81+
tool_names=["python_repl", "editor", "http_request"],
82+
system_prompt="You're an AI specialized in data analysis. Your task is to build tools for data processing and visualization."
83+
)
8084

81-
# With specific tools
85+
# Create a tool-building agent focused on web automation
8286
agent.tool.strand(
83-
query="Analyze this Python code",
84-
tool_names=["python_repl", "editor"],
85-
system_prompt="You are an expert Python developer specializing in code optimization."
87+
query="Create a set of web automation tools for browser testing",
88+
tool_names=["editor", "python_repl", "shell"],
89+
system_prompt="You're an expert in creating web automation tools. Your specialty is developing reliable browser testing utilities."
8690
)
8791
```
8892

93+
## Model Configuration
94+
95+
### Optimized Defaults
96+
97+
Strands comes with optimized, maxed-out configuration settings for the Bedrock model provider:
98+
99+
```json
100+
{
101+
"model_id": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
102+
"max_tokens": 64000,
103+
"boto_client_config": {
104+
"read_timeout": 900,
105+
"connect_timeout": 900,
106+
"retries": {
107+
"max_attempts": 3,
108+
"mode": "adaptive"
109+
}
110+
},
111+
"additional_request_fields": {
112+
"thinking": {
113+
"type": "enabled",
114+
"budget_tokens": 2048
115+
}
116+
}
117+
}
118+
```
119+
120+
These settings provide:
121+
- Claude 3.7 Sonnet (latest high-performance model)
122+
- Maximum token output (64,000 tokens)
123+
- Extended timeouts (15 minutes) for complex operations
124+
- Automatic retries with adaptive backoff
125+
- Enabled thinking capability with 2,048 token budget for recursive reasoning
126+
127+
You can customize these values using environment variables:
128+
129+
```bash
130+
# Maximum tokens for responses
131+
export STRANDS_MAX_TOKENS=32000
132+
133+
# Budget for agent thinking/reasoning
134+
export STRANDS_BUDGET_TOKENS=1024
135+
```
136+
89137
## Custom Model Provider
90138

91139
You can configure strands to use a different model provider with specific settings by passing in the following arguments:
@@ -100,11 +148,7 @@ As an example, if you wanted to use the packaged Ollama provider with a specific
100148
strands --model-provider ollama --model-config '{"model_id": <ID>}'
101149
```
102150

103-
Strands is packaged with the following providers:
104-
| Name | Config |
105-
| ---- | ------ |
106-
| `bedrock` | [reference](<LINK>) |
107-
| `ollama` | [reference](<LINK>) |
151+
Strands Agent Builder is packaged with `bedrock` and `ollama`.
108152

109153
If you have implemented a custom model provider ([instructions](<LINK>)) and would like to use it with strands, create a python module under the directory "$CWD/.models" and expose an `instance` function that returns an instance of your provider. As an example, assume you have:
110154

@@ -122,7 +166,7 @@ You can then use it with strands by running:
122166
$ strands --model-provider custom_model --model-config <JSON|FILE>
123167
```
124168

125-
## Custom Systm Prompts
169+
## Custom System Prompts
126170

127171
```bash
128172
# Via environment variable

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "strands-agents-builder"
7-
version = "0.1.0"
8-
description = "A minimal Strands Agents CLI"
7+
version = "0.1.1"
8+
description = "An example Strands agent demonstrating streaming, tool use, and interactivity from your terminal. This agent builder can help you to build your own agents and tools."
99
readme = "README.md"
1010
requires-python = ">=3.10"
1111
license = {text = "Apache-2.0"}

src/strands_agents_builder/strands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939

4040
# Custom tools, handlers, utils
4141
from tools import (
42-
strand,
4342
store_in_kb,
43+
strand,
4444
welcome,
4545
)
4646

src/strands_agents_builder/utils/model_utils.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@
22

33
import importlib
44
import json
5+
import os
56
import pathlib
67
from typing import Any
78

9+
from botocore.config import Config
810
from strands.types.models import Model
911

12+
# Default model configuration
13+
DEFAULT_MODEL_CONFIG = {
14+
"model_id": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
15+
"max_tokens": int(os.getenv("STRANDS_MAX_TOKENS", "64000")),
16+
"boto_client_config": Config(
17+
read_timeout=900,
18+
connect_timeout=900,
19+
retries=dict(max_attempts=3, mode="adaptive"),
20+
),
21+
"additional_request_fields": {
22+
"thinking": {
23+
"type": "enabled",
24+
"budget_tokens": int(os.getenv("STRANDS_BUDGET_TOKENS", "2048")),
25+
}
26+
},
27+
}
28+
1029

1130
def load_path(name: str) -> pathlib.Path:
1231
"""Locate the model provider module file path.
@@ -37,10 +56,14 @@ def load_config(config: str) -> dict[str, Any]:
3756
3857
Args:
3958
config: A JSON string or path to a JSON file containing model configuration.
59+
If empty string or '{}', the default config is used.
4060
4161
Returns:
4262
The parsed configuration.
4363
"""
64+
if not config or config == "{}":
65+
return DEFAULT_MODEL_CONFIG
66+
4467
if config.endswith(".json"):
4568
with open(config) as fp:
4669
return json.load(fp)

tools/rich_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import textwrap
22
from typing import Any
33

4-
from strands.types.tools import ToolResult, ToolUse
54
from rich.console import Console
65
from rich.markdown import Markdown
76
from rich.panel import Panel
@@ -10,6 +9,7 @@
109
from rich.table import Table
1110
from rich.text import Text
1211
from rich.tree import Tree
12+
from strands.types.tools import ToolResult, ToolUse
1313

1414
TOOL_SPEC = {
1515
"name": "rich_interface",

0 commit comments

Comments
 (0)