Skip to content

Commit e719888

Browse files
author
Elizabeth
committed
docs: actualizar estructura del proyecto y corregir error de seguridad
- Actualizar README principal con rutas correctas a notebooks/ - Crear README en carpeta notebooks con formato consistente - Actualizar .gitignore para cubrir todas las carpetas del proyecto - Corregir error medium de seguridad en notebook 03 (eliminar if/else redundante)
1 parent 782416b commit e719888

32 files changed

Lines changed: 8007 additions & 5 deletions

.gitignore

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
pip-wheel-metadata/
20+
share/python-wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
MANIFEST
25+
26+
# Virtual Environment
27+
.venv/
28+
venv/
29+
ENV/
30+
env/
31+
.virtualenv/
32+
deploy-to-production/.venv/
33+
deploy-to-production/deployment/.venv/
34+
notebooks/.venv/
35+
36+
# Jupyter Notebook
37+
.ipynb_checkpoints
38+
*/.ipynb_checkpoints/*
39+
*.ipynb_checkpoints
40+
41+
# Environment variables
42+
.env
43+
.env.local
44+
.env.*.local
45+
46+
# IDE
47+
.vscode/
48+
.idea/
49+
*.swp
50+
*.swo
51+
*~
52+
.project
53+
.pydevproject
54+
.settings/
55+
*.code-workspace
56+
.devcontainer/
57+
*.dev
58+
59+
# macOS
60+
.DS_Store
61+
.AppleDouble
62+
.LSOverride
63+
._*
64+
65+
# Windows
66+
Thumbs.db
67+
ehthumbs.db
68+
Desktop.ini
69+
70+
# Session data
71+
sessions/
72+
*.session
73+
notebooks/sessions/
74+
75+
# Logs
76+
*.log
77+
logs/
78+
79+
# Testing
80+
.pytest_cache/
81+
.coverage
82+
htmlcov/
83+
.tox/
84+
.nox/
85+
86+
# Generated output (ignore all generated content)
87+
output/
88+
*.output
89+
generated_images/
90+
generated_videos/
91+
generated_content/
92+
93+
# MCP Server generated files
94+
mcp_custom_tools_server.py
95+
96+
# Bedrock AgentCore files
97+
.bedrock_agentcore.yaml
98+
.bedrock_agentcore/
99+
deploy-to-production/deployment/.bedrock_agentcore/
100+
*.hash
101+
dependencies.zip
102+
103+
# AWS credentials (extra safety)
104+
*.pem
105+
*.key
106+
credentials
107+
config
108+
109+
# Temporary files
110+
*.tmp
111+
*.temp
112+
*.bak
113+
*.swp
114+
*~.nib
115+
116+
# Package files
117+
*.dmg
118+
*.gz
119+
*.iso
120+
*.jar
121+
*.rar
122+
*.tar
123+
*.zip
124+
125+
# Sample test outputs
126+
deploy-to-production/sample-test/test_results/
127+
deploy-to-production/sample-test/*.png
128+
deploy-to-production/sample-test/*.jpg
129+
deploy-to-production/sample-test/*.mp4
130+
131+
# Data files (keep sample data but ignore generated)
132+
notebooks/data-sample/generated/
133+
notebooks/data-sample/output/

README.md

Lines changed: 198 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,204 @@
1-
## My Project
1+
# Strands Agents Tutorial - Build Multi-Modal AI
22

3-
TODO: Fill this README out!
3+
## Overview
44

5-
Be sure to:
5+
Build production-ready AI agents with the [Strands Agents SDK](https://github.com/strands-agents/sdk-python) and AWS services. This repository demonstrates how you can create multi-modal systems with persistent memory in minimal code. Progress from your first agent to production-ready systems through hands-on chapters.
66

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
7+
Strands Agents create AI agents with minimal code using built-in tools from the community package. No need to write custom tool implementations—focus on your use case while the framework handles the complexity.
8+
9+
## Tutorial Contents - 7 Hands-On Notebooks + Production Deploy
10+
11+
| # | Notebook | Description |
12+
|---|----------|-------------|
13+
| **01** | [Hello World - First AI Agent](notebooks/01-hello-world-strands-agents.ipynb) | Create your first AI agent with [Amazon Bedrock](https://aws.amazon.com/bedrock/) in under 10 lines of code. Learn agent basics, system prompts, and execution loops. |
14+
| **02** | [Custom Tools for Multi-Modal Processing](notebooks/02-custom-tools.ipynb) | Extend agents with custom tools using the `@tool` decorator. Process multi-modal content including images, videos, and documents. |
15+
| **03** | [MCP Integration for Tool Sharing](notebooks/03-mcp-integration.ipynb) | Share tools across applications with [Model Context Protocol (MCP)](https://modelcontextprotocol.io/). Convert tools to MCP servers and deploy for production. |
16+
| **04** | [State Management and Sessions](notebooks/04-state-and-sessions.ipynb) | Implement session management with `FileSessionManager`. Maintain conversation context and handle multiple concurrent sessions. |
17+
| **05**| [S3 Vector Memory for Persistent Context](notebooks/05-s3-vector-memory.ipynb) | Build semantic memory with [Amazon S3 Vectors](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors.html). Create agents that remember across all sessions with production-ready infrastructure. |
18+
| **06** 🌍 | [Travel Assistant with Cross-Session Memory](notebooks/06-travel-assistant-demo.ipynb) | Real-world demonstration of cross-session memory with a personalized AI travel assistant. Features multimodal analysis (text, images, PDFs) and progressive personalization. |
19+
| **07** 🎨 | [Travel Content Generator with Built-in Tools](notebooks/07-travel-content-generator.ipynb) | Generate complete travel content packages (images, videos, itineraries) for any destination using built-in tools from [`strands-agents-tools`](https://pypi.org/project/strands-agents-tools/). Fully automated with no manual confirmations. |
20+
| **Bonus** 🚀 | [Deploy to Production with AgentCore](deploy-to-production/) | Deploy your multimodal travel agent to production using [Amazon Bedrock AgentCore Runtime](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agents-tools-runtime.html). Includes persistent memory, serverless deployment, and comprehensive testing. |
21+
22+
### Recommended Learning Path
23+
24+
- **Notebooks 01-02**: Basic agents with custom capabilities
25+
- **Notebook 03**: Production-ready tools with MCP standardization
26+
- **Notebooks 04-05**: Stateful agents with persistent memory
27+
- **Notebooks 06-07**: Real-world applications demonstrating rapid development with built-in tools
28+
29+
## Quick Start
30+
31+
### Prerequisites
32+
- AWS Account with [Amazon Bedrock](https://aws.amazon.com/bedrock/) model access enabled
33+
- Python 3.9+ and Jupyter Notebook
34+
- AWS CLI configured (`aws configure`)
35+
36+
### Installation
37+
38+
```bash
39+
# Setup environment
40+
python -m venv .venv
41+
source .venv/bin/activate # Windows: .venv\Scripts\activate
42+
cd notebooks
43+
pip install -r requirements.txt
44+
45+
```
46+
47+
Open `notebooks/01-hello-world-strands-agents.ipynb` to begin.
48+
49+
## Why Strands Agents - Key Advantages
50+
51+
### Build Faster with 40+ Pre-Built Tools
52+
53+
Building AI agents traditionally requires extensive boilerplate code for tool integration, error handling, and state management. Strands Agents provides:
54+
55+
**Built-in Tools**: The [`strands-agents-tools`](https://pypi.org/project/strands-agents-tools/) package includes 40+ pre-built tools:
56+
- **Multi-modal**: `generate_image`, `image_reader`, `nova_reels`, `diagram`
57+
- **File Operations**: `file_read`, `file_write`, `editor`
58+
- **Memory**: `memory`, `agent_core_memory`, `mem0_memory`
59+
- **Web & Network**: `http_request`, `browser`, `slack`
60+
- **AWS Services**: `use_aws`, `retrieve` (Bedrock Knowledge Bases)
61+
- **Code Execution**: `python_repl`, `code_interpreter`
62+
- **And many more**: See [full list](https://github.com/strands-agents/tools)
63+
64+
**Example**: Create an agent with image generation in 5 lines:
65+
66+
```python
67+
from strands import Agent
68+
from strands.models import BedrockModel
69+
from strands_tools import generate_image
70+
71+
agent = Agent(model=BedrockModel(model_id="..."), tools=[generate_image])
72+
agent("Generate an image of the Eiffel Tower at sunset")
73+
```
74+
75+
No need to write image generation logic, handle API calls, or manage file storage—the tool handles everything.
76+
77+
### 4-Step Rapid Prototyping Process
78+
79+
Test new ideas quickly:
80+
81+
1. **Import pre-built tools** from strands-agents-tools
82+
2. **Create an agent** with your chosen model
83+
3. **Add tools** to the agent's capabilities
84+
4. **Run and iterate** immediately
85+
86+
This repository demonstrates this approach throughout—especially in the Travel Content Generator (Notebook 08) where you can generate complete content packages with minimal custom code.
87+
88+
## Real-World Demo - AI Travel Assistant with Memory
89+
90+
Experience persistent vector memory with a real-world use case: an AI travel assistant that remembers your preferences across multiple sessions.
91+
92+
### Key Features
93+
94+
- **True Cross-Session Memory**: Agent remembers everything even with fresh instances
95+
- **Multimodal Analysis**: Processes text preferences, destination photos, and travel itineraries
96+
- **Semantic Search**: Finds relevant memories intelligently
97+
- **Progressive Personalization**: Gets smarter with each interaction
98+
- **Production-Ready**: Built on AWS services for scale
99+
100+
### Try the Demo
101+
102+
```bash
103+
# 1. Open the demo notebook
104+
notebook notebooks/06-travel-assistant-demo.ipynb
105+
106+
# 2. Update configuration with your S3 Vector bucket
107+
# 3. Run all cells to see cross-session memory in action
108+
```
109+
110+
**Note**: To generate custom travel content for the demo, open and run [notebooks/07-travel-content-generator.ipynb](notebooks/07-travel-content-generator.ipynb) first.
111+
112+
## Production Deployment - AgentCore Runtime Guide
113+
114+
Take your multimodal travel agent from notebook to production with [Amazon Bedrock AgentCore Runtime](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agents-tools-runtime.html).
115+
116+
### What's Included
117+
118+
The [`deploy-to-production/`](deploy-to-production/) directory contains everything you need to deploy a production-ready multimodal travel agent:
119+
120+
- **Persistent Memory**: Cross-session memory using Bedrock AgentCore Memory
121+
- **Multimodal Support**: Process images, videos, and documents
122+
- **Serverless Deployment**: Auto-scaling with AWS CodeBuild (no Docker required)
123+
- **Test Scripts**: Comprehensive testing for memory and multimodal capabilities
124+
125+
### Features
126+
127+
-**Image Analysis**: Analyze destination photos, food labels, travel documents
128+
-**Video Processing**: Process travel videos with Amazon Nova (visual only)
129+
-**Document Reading**: Read PDFs, itineraries, and text files
130+
-**Memory Persistence**: Remember user preferences across all sessions
131+
-**Production Monitoring**: CloudWatch logs and metrics
132+
133+
### Quick Deploy
134+
135+
```bash
136+
# 1. Navigate to deployment directory
137+
cd deploy-to-production/deployment
138+
139+
# 2. Install dependencies
140+
pip install -r requirements.txt
141+
142+
# 3. Configure agent with memory
143+
agentcore configure -e multimodal_agent.py
144+
# Select 'yes' for memory and long-term memory extraction
145+
146+
# 4. Deploy to production
147+
agentcore launch
148+
149+
```
150+
151+
### Testing - Memory & Multimodal Capabilities
152+
153+
```bash
154+
# Test short-term and long-term memory
155+
cd ../sample-test
156+
export AGENT_ARN="your-agent-arn"
157+
python test_short_memory.py
158+
python test_long_memory.py
159+
160+
# Test image and video analysis
161+
python test_multimodal.py path/to/image.jpg
162+
python test_video.py path/to/video.mp4
163+
```
164+
165+
**Learn More**: See the complete [deployment guide](deploy-to-production/README.md) for detailed instructions, architecture diagrams, and troubleshooting.
166+
167+
168+
## Best Practices & Tips
169+
170+
- Complete notebooks in order—each builds on previous concepts
171+
- Run cells sequentially to maintain state
172+
- Experiment with examples to deepen understanding
173+
- Explore the [strands-agents-tools package](https://github.com/strands-agents/tools) for more pre-built capabilities
174+
- Monitor costs with [AWS Cost Explorer](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/)
175+
176+
## Common Issues & Solutions
177+
178+
**Import Errors**: Run `pip install --upgrade strands-agents strands-agents-tools boto3`
179+
180+
**AWS Credentials**: Verify with `aws sts get-caller-identity` or reconfigure with `aws configure`
181+
182+
**S3 Vectors** (Notebook 05): Follow the [Getting Started Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors-getting-started.html) and verify bucket and index regions match
183+
184+
**MCP Server** (Notebook 03): Ensure server runs on `http://localhost:8000/sse` with no port conflicts
185+
186+
**Tool Consent Prompts**: Set `BYPASS_TOOL_CONSENT=true` environment variable for automated workflows
187+
188+
## Additional Resources
189+
190+
**Documentation**
191+
[Strands Agents SDK](https://github.com/strands-agents/sdk-python)
192+
[Strands Community Tools](https://github.com/strands-agents/tools)
193+
[Amazon Bedrock](https://docs.aws.amazon.com/bedrock/)
194+
[Amazon Bedrock AgentCore](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html)
195+
[S3 Vectors](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors.html)
196+
[MCP Specification](https://modelcontextprotocol.io/)
197+
[Amazon Nova](https://aws.amazon.com/bedrock/nova/)
198+
199+
---
200+
201+
**Ready to start?** Open [Notebook 01: Hello World](notebooks/01-hello-world-strands-agents.ipynb) and build your first AI agent.
9202

10203
## Security
11204

0 commit comments

Comments
 (0)