Problem Statement
Checking the stock market manually every morning takes time.
I wanted to build an AI agent that:
- Runs automatically every morning
- Generates a market summary using Generative AI
- Sends the report directly to my email
- Requires no manual intervention
AWS Services Used
AWS Service | Purpose |
|---|
Amazon Bedrock | Generates the AI stock market report |
AWS Lambda | Executes the Python code |
Amazon EventBridge Scheduler | Runs the Lambda function automatically every day at 6:00 AM |
Amazon SES | Sends the report to my email |
AWS IAM | Manages permissions |
Amazon CloudWatch | Stores execution logs |
Solution Architecture
Amazon EventBridge Scheduler
│
▼
AWS Lambda
│
▼
Amazon Bedrock (Nova Lite)
│
▼
Generate Daily Market Report
│
▼
Amazon SES
│
▼
Email Delivered Automatically
Implementation Steps
Step 1: Create the Lambda Function
I created a Python 3.12 Lambda function.
The Lambda function:
- Creates a Bedrock Runtime client
- Sends a prompt to Amazon Nova Lite
- Receives the generated report
- Sends the report using Amazon SES
Step 2: Configure Amazon Bedrock
I selected the Amazon Nova Lite model.
Prompt used:
Generate a short Indian stock market morning report containing:* Market Overview
- General Trading TipsKeep it under 200 words.
Step 3: Configure IAM Permissions
The Lambda execution role was granted permissions for:
This allowed Lambda to communicate securely with Bedrock and SES.
Step 4: Verify Email Using Amazon SES
I verified my email address in Amazon SES.
After verification, Lambda was able to send emails automatically.
Step 5: Schedule Automatic Execution
Using Amazon EventBridge Scheduler, I created a recurring schedule.
Cron Expression:
This runs every day at 6:00 AM (Asia/Kolkata).
Lambda Workflow
The Lambda function performs the following steps:
- Triggered by EventBridge.
- Sends a prompt to Amazon Bedrock Nova Lite.
- Receives the AI-generated market report.
- Sends the report to my email using Amazon SES.
- CloudWatch records execution logs.
Example Email
Subject
📈 Daily Share Market Report
Example contents:
- AI-generated market summary
The report arrives automatically every morning.
Challenges Faced
During development I encountered several issues:
Bedrock Permission Error
Initially Lambda returned:
This was solved by adding the required IAM permission:
SES Email Verification
Amazon SES requires the sender email address to be verified before emails can be sent.
After verifying the email identity, email delivery worked successfully.
Event Scheduling
I configured EventBridge Scheduler using a cron expression to automate execution every morning.
Results
The final solution successfully:
- Automatically runs every day
- Generates AI-powered market insights
- Sends reports directly to email
- Executes without any manual interaction
This demonstrates how AWS serverless services and Generative AI can be combined to build autonomous assistants.
Future Improvements
Possible enhancements include:
- Fetch live market prices from financial APIs
- Save reports in Amazon S3
- Send notifications through Telegram or Slack
- Create a dashboard for historical reports
- Add personalized investment preferences
Conclusion
This project helped me understand how to integrate Amazon Bedrock with AWS Lambda, EventBridge Scheduler, and Amazon SES to build a fully automated AI agent.
The solution is lightweight, serverless, scalable, and runs entirely on AWS managed services.
Tags
Use these five tags:
Loading article