Una suite di agenti AI intelligenti per l'organizzazione personale, costruita con AWS Bedrock AgentCore Runtime e Strands Agents. Sistema multi-agente con pay-per-use pricing model.
-
Orchestrator Agent 🎭
- Coordina tutti gli altri agenti
- Analizza intent e delega richieste
- Interfaccia principale con l'utente
-
Task Manager Agent 📝
- Riceve obiettivi in linguaggio naturale
- Decompone in task SMART actionable
- Persiste su DynamoDB
-
Daily Briefing Agent 📊
- Riassunto giornaliero automatico
- Legge task dal database
- Integra email da Outlook (via MCP)
- Chat interattiva
- Comandi:
/briefing,/tasks,/add <obiettivo> - Notifiche push
- Supporto Markdown
- Dashboard completa con chat, obiettivi e progetti
- CRUD completo: Crea, modifica ed elimina obiettivi e progetti
- Editing modale: Popup per modifica rapida con validazione
- Formattazione avanzata:
- Supporto grassetto (
**testo**) nelle descrizioni - A capo automatici per testo formattato
- Supporto grassetto (
- Sottotask espandibili: Freccina toggle per mostrare/nascondere i sottotask
- Filtri intelligenti: Per ambito, status, priorità e tag
- Architettura sicura: Backend Flask proxy, nessun endpoint pubblico REST
- AgentCore Gateway: Secure Lambda access with OAuth2 + MCP protocol
- DynamoDB: Persistence layer con 3 tabelle (Goals, Projects, Tasks)
- Lambda Functions: 10 funzioni per CRUD completo (POST/GET/UPDATE/DELETE)
- MCP Server: Model Context Protocol per Outlook
- Microsoft Graph: Email e calendar access
- EventBridge: Scheduled daily briefings (8:00 AM)
- Flask Backend: Proxy locale per invocazione Lambda con IAM auth
- No API Gateway pubblico: Rimosso per eliminare superfici d'attacco
- IAM-only Lambda access: Invocazione diretta tramite boto3 con credenziali AWS
- Backend Flask proxy: Porta 5000 locale, non esposta a internet
- Telegram webhook: Unico endpoint pubblico (necessario per il bot)
- Bedrock AgentCore Runtime: $0.00003/sec di esecuzione
- DynamoDB On-Demand: $1.25/milione write
- Lambda: Primo milione free
- Stima mensile: ~$7-12 per uso moderato
┌─────────────┐
│ Telegram │
│ Bot │
└──────┬──────┘
│
v
┌──────────────────┐ ┌───────────────┐ ┌──────────────────┐
│ API Gateway │─────>│ Orchestrator │ │ Flask Frontend │
│ (Webhook) │ │ Agent │ │ (localhost) │
└──────────────────┘ └───────┬───────┘ └────────┬─────────┘
│ │
┌─────────────┴─────────────┐ │
│ │ │
v v v
┌──────────────────┐ ┌──────────────────┐ │
│ Task Manager │ │ Daily Briefing │ │
│ Agent │ │ Agent │ │
└────────┬─────────┘ └────────┬─────────┘ │
│ │ │
│ ┌──────────────────┐ │ │
└─>│ AgentCore │<──┘ │
│ Gateway │ │
│ (OAuth2 + MCP) │ │
└────────┬─────────┘ │
│ │
┌──────────────┴──────────────┐ │
│ │ │
v v v
┌────────────────────┐ ┌────────────────┐ ┌──────────────────┐
│ Lambda CRUD APIs │ │ MCP Server │ │ Lambda CRUD │
│ - Goals (4) │ │ (Outlook) │ │ - Projects (4) │
│ - Tasks (2) │ │ │ │ - IAM Auth Only │
│ (DynamoDB) │ └────────────────┘ └──────────────────┘
└────────────────────┘
Framework Stack:
- BedrockAgentCore: Runtime container-based su AWS
- AgentCore Gateway: Secure MCP endpoint with OAuth2
- Strands Agents: Python agent framework con tool orchestration
- AWS CDK: Infrastructure as Code (TypeScript)
- Docker: Containerizzazione agenti (ARM64)
asws-agentcore/
├── agents/ # AI Agents (Bedrock AgentCore)
│ ├── gateway_client.py # Shared Gateway client with OAuth2
│ ├── orchestrator/
│ │ ├── agent.py # Main orchestrator logic
│ │ ├── requirements.txt # Dependencies
│ │ └── Dockerfile # ARM64 container
│ ├── task-manager/
│ │ ├── agent.py # Task decomposition logic
│ │ ├── requirements.txt
│ │ └── Dockerfile
│ └── daily-briefing/
│ ├── agent.py # Briefing generation logic
│ ├── requirements.txt
│ └── Dockerfile
│
├── lambdas/ # Support Lambda Functions
│ ├── goal-api/
│ │ ├── post_goal.py # POST - Create goals
│ │ ├── get_goal.py # GET - Query goals
│ │ ├── update_goal.py # UPDATE - Modify goals
│ │ ├── delete_goal.py # DELETE - Remove goals
│ │ └── requirements.txt
│ ├── project-api/
│ │ ├── post_project.py # POST - Create projects
│ │ ├── get_project.py # GET - Query projects
│ │ ├── update_project.py # UPDATE - Modify projects
│ │ ├── delete_project.py # DELETE - Remove projects
│ │ └── requirements.txt
│ ├── task-api/
│ │ ├── post_task.py # POST /tasks - Create tasks
│ │ ├── get_task.py # GET /tasks - Query tasks
│ │ └── requirements.txt
│ └── telegram-webhook/
│ ├── bot.py # Telegram bot handler
│ └── requirements.txt
│
├── chat-frontend/ # Web Frontend
│ ├── backend.py # Flask proxy server
│ ├── index.html # Main UI with modals
│ ├── app.js # Frontend logic (CRUD, formatting)
│ ├── style.css # Main styles
│ ├── modal-styles.css # Modal & animation styles
│ └── requirements.txt
│
├── mcp-server/ # Model Context Protocol Server
│ ├── server.py # FastAPI MCP server
│ ├── requirements.txt
│ └── Dockerfile
│
├── infrastructure/ # AWS Infrastructure
│ └── cdk-app/
│ ├── lib/
│ │ └── personal-assistant-stack.ts
│ ├── bin/
│ │ └── cdk-app.ts
│ ├── package.json
│ └── tsconfig.json
│
├── shared/ # Shared utilities
│ ├── models/
│ │ └── data_models.py # Task, Email, Briefing models
│ └── utils/
│ └── helpers.py # Common utilities
│
├── docs/ # Documentation
│ ├── DEPLOYMENT.md # Step-by-step deploy guide
│ ├── SETUP.md # Initial setup
│ └── troubleshooting.md # Common issues
│
├── scripts/ # Automation scripts
│ ├── deploy.ps1 # Automated deployment (PowerShell)
│ └── test.ps1 # End-to-end testing
│
├── README.md # This file
├── requirements.txt # Global Python dependencies
└── .env.example # Environment variables template
- Python 3.11+
- Node.js 18+
- AWS CLI v2 configured with appropriate permissions
- AWS CDK (
npm install -g aws-cdk) - Bedrock AgentCore Toolkit (
pip install bedrock-agentcore-starter-toolkit) - Telegram Bot Token (da @BotFather)
- Azure App Registration (per Outlook MCP) (opzionale)
# Clone repository
git clone <repo-url>
cd asws-agentcore
# Installa dipendenze Python globali
pip install -r requirements.txt
pip install bedrock-agentcore-starter-toolkit strands-agents
# Copia e configura .env
copy .env.example .env
# Compila .env seguendo la sezione "Configurazione .env" più sottocd infrastructure/cdk-app
# Installa dipendenze CDK
npm install
# Bootstrap CDK (solo prima volta)
cdk bootstrap
# Deploy stack
cdk deploy --require-approval never
# Salva gli output (ARN Lambda, API Gateway URL, etc)
cdk outputs --json > outputs.jsonGli output includeranno:
TaskPostLambdaArn- Lambda per creare taskTaskGetLambdaArn- Lambda per query taskTelegramWebhookUrl- URL webhook per Telegram
Orchestrator Agent:
cd agents/orchestrator
# Configura agent
agentcore configure -e agent.py --non-interactive
# Deploy
agentcore launch
# Salva ARN (mostrato nell'output)
# Esempio: arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/orchestrator-xyzTask Manager Agent:
cd ../task-manager
agentcore configure -e agent.py --non-interactive
agentcore launch
# Salva ARNDaily Briefing Agent:
cd ../daily-briefing
agentcore configure -e agent.py --non-interactive
agentcore launch
# Salva ARN📘 Guida Completa: Vedi docs/GATEWAY_SETUP.md per dettagli completi.
Il Gateway fornisce accesso sicuro e autenticato alle Lambda Task API tramite OAuth2.
# Crea Gateway MCP
agentcore gateway create-mcp-gateway `
--name TaskAPIGateway `
--region us-east-1
# Output: gateway-id, gateway-url, cognito credentials
# Salva questi valori per lo step 5Aggiungi Lambda targets per POST e GET:
# Target per save-task (POST)
agentcore gateway create-mcp-gateway-target `
--gateway-arn <gateway-arn> `
--gateway-url <gateway-url> `
--role-arn <iam-role-arn> `
--name save-task `
--target-type lambda `
--region us-east-1 `
--target-payload '{
"lambdaArn": "<TaskPostLambdaArn>",
"toolSchema": {
"inlinePayload": [{
"name": "save-task",
"description": "Save tasks to database",
"inputSchema": {
"type": "object",
"properties": {
"tasks": {"type": "array"}
}
}
}]
}
}'
# Target per get-tasks (GET)
agentcore gateway create-mcp-gateway-target `
--gateway-arn <gateway-arn> `
--gateway-url <gateway-url> `
--role-arn <iam-role-arn> `
--name get-tasks `
--target-type lambda `
--region us-east-1 `
--target-payload '{
"lambdaArn": "<TaskGetLambdaArn>",
"toolSchema": {
"inlinePayload": [{
"name": "get-tasks",
"description": "Retrieve tasks from database",
"inputSchema": {
"type": "object",
"properties": {
"due_date": {"type": "string"},
"status": {"type": "string"}
}
}
}]
}
}'Aggiorna .env con gli ARN degli agenti deployati e le credenziali Gateway.
📋 Guida completa compilazione .env:
# ============================================
# 1. AWS Base (compila subito)
# ============================================
AWS_REGION=us-east-1
AWS_ACCOUNT_ID=<il_tuo_account_id> # es: 879338784410
# ============================================
# 2. Telegram (compila subito)
# ============================================
TELEGRAM_BOT_TOKEN=<token_da_botfather> # Ottieni da @BotFather su Telegram
TELEGRAM_WEBHOOK_URL=<compila_dopo_cdk> # Output CDK: TelegramWebhookUrl
TELEGRAM_CHAT_ID=<tuo_chat_id> # Ottieni mandando /start al bot
# ============================================
# 3. Lambda ARNs (compila dopo CDK deploy)
# ============================================
LAMBDA_TASK_POST_ARN=<compila_dopo_cdk> # Output CDK: TaskPostLambdaArn
LAMBDA_TASK_GET_ARN=<compila_dopo_cdk> # Output CDK: TaskGetLambdaArn
LAMBDA_ORCHESTRATOR_ARN=<compila_dopo_cdk> # Output CDK: OrchestratorLambdaArn
# ============================================
# 4. MCP Server Esterno (opzionale - per Outlook)
# ============================================
MCP_SERVER_URL=https://your-mcp-server.com
MCP_API_KEY=your-api-key
MCP_SECRET_NAME=personal-assistant/mcp-api-key
# ============================================
# 5. Bedrock AgentCore ARNs (compila dopo deploy agenti)
# ============================================
# Ottieni con: agentcore list-agents-runtimes --region us-east-1
ORCHESTRATOR_AGENT_ARN=<output_agentcore_launch> # es: arn:aws:bedrock-agentcore:...:runtime/orchestrator_agent-xxx
TASK_MANAGER_AGENT_ARN=<output_agentcore_launch> # es: arn:aws:bedrock-agentcore:...:runtime/taskmanager_agent-xxx
DAILY_BRIEFING_AGENT_ARN=<output_agentcore_launch> # es: arn:aws:bedrock-agentcore:...:runtime/dailybriefing_agent-xxx
# ============================================
# 6. AgentCore Gateway (compila dopo step 4)
# ============================================
# Ottieni con: agentcore gateway get-mcp-gateway --name TaskAPIGateway --region us-east-1
GATEWAY_MCP_URL=<gateway_url> # es: https://taskapigateway-xxx.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp
GATEWAY_CLIENT_ID=<client_id_da_gateway> # es: 40ipvfb7kr5hnjqm06555e5hlp
GATEWAY_CLIENT_SECRET=<client_secret_da_gateway> # es: 6rtmm58udin800qd6eiufv8top19q615m57...
GATEWAY_TOKEN_ENDPOINT=https://<gateway-id>.auth.us-east-1.amazoncognito.com/oauth2/token
GATEWAY_SCOPE=invoke🔍 Come ottenere ogni valore:
- AWS_ACCOUNT_ID:
aws sts get-caller-identity --query Account --output text - TELEGRAM_BOT_TOKEN: Crea bot con @BotFather, copia token
- TELEGRAM_CHAT_ID: Manda
/startal bot, poicurl https://api.telegram.org/bot<TOKEN>/getUpdates - Lambda ARNs:
cdk outputs --jsondopo deploy stack - Agent ARNs: Mostrati dopo
agentcore launchoagentcore list-agents-runtimes - Gateway config:
agentcore gateway get-mcp-gateway --name TaskAPIGateway --region us-east-1GATEWAY_TOKEN_ENDPOINTsi ricava da gateway-id:https://<gateway-id>.auth.<region>.amazoncognito.com/oauth2/token
L'orchestrator ha bisogno degli ARN degli altri agenti:
cd agents/orchestrator
# Modifica .bedrock_agentcore.yaml e aggiungi:
# environmentVariables:
# TASK_MANAGER_AGENT_ARN: "arn:..."
# DAILY_BRIEFING_AGENT_ARN: "arn:..."
# MCP_SECRET_NAME: "personal-assistant/mcp-api-key" # opzionale, per MCP esterno
# Re-deploy con nuove variabili
agentcore launch --auto-update-on-conflictTask Manager e Daily Briefing necessitano delle credenziali Gateway:
cd ../task-manager
# Modifica .bedrock_agentcore.yaml e aggiungi:
# environmentVariables:
# GATEWAY_MCP_URL: "https://taskapigateway-xxx.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"
# GATEWAY_CLIENT_ID: "40ipvfb7kr5hnjqm06555e5hlp"
# GATEWAY_CLIENT_SECRET: "6rtmm58udin800qd6eiufv8top19q615m57..."
# GATEWAY_TOKEN_ENDPOINT: "https://taskapigateway-xxx.auth.us-east-1.amazoncognito.com/oauth2/token"
# GATEWAY_SCOPE: "invoke"
agentcore launch --auto-update-on-conflict
cd ../daily-briefing
# Ripeti lo stesso per daily-briefing con le stesse credenziali Gateway
agentcore launch --auto-update-on-conflict# Imposta webhook
$botToken = "<TUO_TELEGRAM_BOT_TOKEN>"
$webhookUrl = "<TELEGRAM_WEBHOOK_URL_DA_CDK_OUTPUT>"
curl -X POST "https://api.telegram.org/bot$botToken/setWebhook" `
-d "url=$webhookUrl"
# Verifica
curl "https://api.telegram.org/bot$botToken/getWebhookInfo"# Test orchestrator
agentcore invoke '{"prompt": "Ciao, cosa puoi fare?"}' -a orchestrator
# Test task manager
agentcore invoke '{"prompt": "Voglio imparare Python"}' -a task-manager
# Test daily briefing
agentcore invoke '{"prompt": "Dammi il briefing"}' -a daily-briefing
# Test su Telegram
# Invia un messaggio al tuo botIl frontend web fornisce un'interfaccia completa per gestire obiettivi e progetti.
cd chat-frontend
# Crea virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# Installa dipendenze
pip install -r requirements.txt
# Configura Lambda ARNs in backend.py
# Aggiorna le costanti con gli ARN ottenuti da CDK deploy:
# - GOAL_POST_LAMBDA_ARN
# - GOAL_GET_LAMBDA_ARN
# - GOAL_UPDATE_LAMBDA_ARN
# - GOAL_DELETE_LAMBDA_ARN
# - PROJECT_POST_LAMBDA_ARN
# - PROJECT_GET_LAMBDA_ARN
# - PROJECT_UPDATE_LAMBDA_ARN
# - PROJECT_DELETE_LAMBDA_ARN
# - ORCHESTRATOR_LAMBDA_ARN
# Avvia il backend Flask
python backend.pyApri il browser su http://localhost:5000 e utilizza l'interfaccia web per:
- Chat: Interagisci con l'orchestrator
- Obiettivi: CRUD completo con filtri per ambito, status, priorità
- Progetti: CRUD completo con GitHub URL e tech stack
Features del Frontend:
- ✏️ Editing modale: Click su "Modifica" per aprire popup di editing
- Formattazione: Usa
**testo**per grassetto nelle descrizioni ▶️ Sottotask espandibili: Click sulla freccina per mostrare/nascondere- 🔄 Refresh automatico: Dopo ogni operazione CRUD
- 🎨 UI moderna: Design gradient con animazioni fluide
/start - Messaggio di benvenuto
/briefing - Riassunto giornaliero
/tasks - Lista tutti i task
/add - Aggiungi nuovo obiettivo
<testo> - Messaggio libero (analizzato dall'orchestrator)
Creare task da obiettivo:
Utente: "Voglio imparare AWS entro 3 mesi"
Agente:
✅ Ho creato 5 task per il tuo obiettivo!
1. 📚 Completare AWS Cloud Practitioner (entro 2 settimane)
2. 🔧 Hands-on con EC2 e S3 (entro 1 mese)
3. 🏗️ Progetto pratico: Deploy app su AWS (entro 2 mesi)
4. 📖 Studiare architetture serverless (entro 2.5 mesi)
5. 🎓 Prepararsi per certificazione (entro 3 mesi)
Buon lavoro! 💪
Briefing giornaliero:
Utente: /briefing
Agente:
🌅 **Briefing - Lunedì 20 Gennaio 2025**
📋 **Task in Programma:** (4 task)
🔴 **Urgente/Alta Priorità:**
• Completare AWS Cloud Practitioner - ⏰ Scadenza: 2025-02-03
📝 Studiare moduli 4-6 e fare quiz pratica
🟢 **Normale:**
• Setup ambiente AWS con EC2
• Review progetto Python
• Pianificare sprint settimanale
📧 **Email Importanti:** (3 non lette)
• Meeting update - 👤 Marco Rossi
• Q4 Report - 👤 HR Team
💡 **Suggerimenti:**
• ⚠️ Scadenza importante tra 14 giorni: certificazione AWS
• 💪 Ottimo lavoro! Hai completato 7 task questa settimana
---
_Comandi utili:_
• /tasks - Vedi tutti i task
• /add <obiettivo> - Aggiungi nuovi task
Ogni agente può essere testato localmente:
cd agents/orchestrator
python agent.py
# In altro terminale
curl -X POST http://localhost:8080/invoke \
-H "Content-Type: application/json" \
-d '{"prompt": "Ciao, cosa puoi fare?", "user_id": "test"}'cd agents/task-manager
# Configure
agentcore configure -e agent.py --runtime-arch ARM64
# Deploy/Update
agentcore launch --update
# Test
agentcore invoke --agent-runtime-arn <arn> --prompt "Test message"# CloudWatch Logs
aws logs tail /aws/bedrock-agentcore/orchestrator --follow
aws logs tail /aws/lambda/TaskPost --follow
# Agent Runtime Status
aws bedrock-agentcore describe-agent-runtime --agent-runtime-arn <arn>
# DynamoDB Table Scan
aws dynamodb scan --table-name PersonalTasks --limit 10- GATEWAY_SETUP.md: Configurazione AgentCore Gateway (OAuth2 + MCP)
- DEPLOYMENT.md: Guida completa al deployment
- SETUP.md: Setup iniziale e configurazione
- troubleshooting.md: Risoluzione problemi comuni
| Componente | Tecnologia | Scopo |
|---|---|---|
| Agent Framework | Strands Agents | Orchestrazione tool e LLM |
| Agent Runtime | AWS Bedrock AgentCore | Container runtime pay-per-use |
| LLM Model | Claude Sonnet 4 | Reasoning e natural language |
| Database | DynamoDB | Task persistence |
| API | AWS Lambda + API Gateway | Task CRUD operations |
| Bot Interface | Telegram Bot API | User interaction |
| External Tools | MCP (Model Context Protocol) | Outlook integration |
| IaC | AWS CDK (TypeScript) | Infrastructure deployment |
| Containerization | Docker (ARM64) | Agent packaging |
| Scheduling | EventBridge | Daily briefing trigger |
Ogni agente può essere testato localmente prima del deploy:
cd agents/orchestrator
python agent.py
# In altro terminale
curl -X POST http://localhost:8080/invocations \
-H "Content-Type: application/json" \
-d '{"prompt": "Ciao, cosa puoi fare?", "user_id": "test"}'# Test orchestrator deployato
agentcore invoke '{"prompt": "Ciao"}' -a orchestrator
# Test con session ID per memory
agentcore invoke '{"prompt": "Ricordi cosa ho detto prima?"}' -a orchestrator -s session-123# Test POST task
aws lambda invoke --function-name <TaskPostLambdaArn> \
--payload '{"body": "{\"tasks\": [{\"title\": \"Test task\"}]}"}' \
response.json
# Test GET task
aws lambda invoke --function-name <TaskGetLambdaArn> \
--payload '{"queryStringParameters": {"limit": "10"}}' \
response.json- IAM Roles: Least privilege per ogni Lambda/Agent
- VPC: Opzionale per MCP server
- Secrets Manager: Credenziali Telegram e Azure
- API Keys: MCP server authenticato
- Encryption: DynamoDB encryption at rest
- CRUD completo per Goals e Projects con frontend web
- Formattazione avanzata con grassetto e a capo
- Sottotask espandibili con UI toggle
- Architettura sicura senza API Gateway pubblico
- Multi-utente con autenticazione
- Dashboard analytics con grafici
- Integrazione Google Calendar via MCP
- Agente per meeting notes
- Voice interface con Whisper
- Mobile app (React Native)
Pull requests benvenute! Per modifiche importanti, apri prima una issue.
MIT License - Vedi LICENSE per dettagli
Riccardo Laface - AWS Bedrock AgentCore Specialist
🎉 Buon organizing con i tuoi AI agents! 🚀