Commit 6e69446
authored
feat: add research agent with advanced Strands patterns (#170)
* feat: add autonomous research agent with advanced Strands patterns
- Add comprehensive research agent sample (02-samples/14-research-agent)
- Demonstrates hot-reloading tool development with instant availability
- Implements multi-agent orchestration (tasks, use_agent, swarm, think)
- Features persistent learning via SQLite memory and Bedrock Knowledge Base
- Includes self-modifying system prompts for dynamic behavior adaptation
- Showcases cascading intelligence patterns and relay chain coordination
- Complete PyPI package with CLI entry points (strands-research-agent)
- Production-ready with MCP integration and distributed event coordination
- Comprehensive documentation with mermaid diagrams and usage examples
- Specialized tools: event_bridge, graphql, scraper, s3_memory, sqlite_memory
- Interactive callback handler with rich console output and notifications
- Background task management with filesystem persistence
- Meta-cognitive architecture demonstrating research-time scaling
This sample represents advanced Strands Agents patterns for autonomous
research systems that create tools, coordinate specialists, and learn
across sessions - pushing the boundaries of what's possible with AI agents.
* security: implement secure temporary directories and enhanced input validation
- Replace insecure /tmp/.research/ usage with secure tempfile patterns
- Add comprehensive input sanitization and validation across all tools
- Implement SQL injection prevention with parameterized queries
- Add secure file creation with proper permissions (0o600/0o700)
- Enhance notification system with input validation and secure subprocess calls
- Improve event_bridge with auto-infrastructure creation and better error handling
- Add security patterns detection and validation in sqlite_memory tool
BREAKING CHANGE: Temporary files now use secure temp directories instead of /tmp/.research/
* feat(security): eliminate SQL injection vulnerabilities and upgrade persistence architecture
BREAKING CHANGE: Removed 7 vulnerable tools containing SQL injection vectors and hardcoded credentials
- Remove sqlite_memory.py (6 SQL injection vulnerabilities on lines 777, 807, 885, 890, 1080, 1173)
- Remove event_bridge.py (hardcoded AWS account ID)
- Remove dialog.py, graphql.py, listen.py, s3_memory.py, tcp.py, fetch_github_tool.py
- Replace custom SQLite persistence with FileSessionManager from strands-agents
- Simplify system_prompt.py to use current directory only (.prompt file)
- Refactor agent.py with construct_system_prompt() function (DRY principle)
- Update .prompt with comprehensive capability documentation
- Bump version to 0.1.2 in pyproject.toml
Security improvements:
- Attack surface reduced by ~5000 lines of vulnerable code
- SQL injection risk completely eliminated
- Infrastructure security improved (no hardcoded credentials)
- Persistence security upgraded (battle-tested FileSessionManager)
Maintained capabilities:
- Core research intelligence preserved
- Hot-reload tool system intact
- Multi-agent coordination active
- Knowledge base integration functional
- Tool expansion capabilities retained
* feat: enhance multi-input support and simplify documentation
- Add piped input, command line, and environment variable support
- Simplify README from 37KB to 6.9KB (81% reduction)
- Change session storage to hourly caching (vs daily)
- Add sessions/ directory for organized storage
- Remove strands[a2a] dependency, bump to v0.1.3
- Fix linting issues and improve code quality
- Reorganize imports and clean up unused code
BREAKING CHANGE: Simplified README removes enterprise diagrams and complex setup instructions
* docs: clean up README configuration examples
- Remove redundant OpenAI configuration section
- Streamline model provider examples for clarity
- Keep essential Ollama configuration example
* fix(agent): remove --interactive flag and /dev/tty recovery code
- Remove --interactive command line flag (default behavior is always interactive)
- Eliminate problematic /dev/tty stdin restoration that caused [Errno 22] Invalid argument
- Preserve interactive loop as default behavior after processing tasks
- Simplify multi-input support without stdin recovery complications
- Fix error handling to continue instead of exit on task errors
BREAKING CHANGE: --interactive flag no longer available, interactive mode is now default1 parent 16784e3 commit 6e69446
File tree
16 files changed
+5131
-1
lines changed- 02-samples
- 14-research-agent
- src/strands_research_agent
- handlers
- tools
16 files changed
+5131
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments