
Weekend Agent Challenge: Fantasy Cricket AI Advisor
As a fantasy cricket enthusiast, I used to spend 30-60 minutes every match day analyzing players, studying pitch conditions, and building my Dream11 team.
Weekend Agent Challenge: Fantasy Cricket AI Advisor ππ€
Tags: #agents
ο»Ώ
Vision & What the Agent Does
As a fantasy cricket enthusiast, I used to spend 30-60 minutes every match day analyzing players, studying pitch conditions, and building my Dream11 team. I wanted an AI agent that does all this research while I sleep and delivers the perfect fantasy team to my inbox every morning.
That's exactly what I built β the Fantasy Cricket AI Advisor Agent.
The Problem
- Analyzing player form, pitch conditions, and matchups is time-consuming (30-60 min per match)
- Good fantasy picks require studying venue history, weather, and team composition
- By the time I finalize my team, contest deadlines are close and I make rushed decisions
- No single source gives me everything β I need to check multiple sites and stats
What My Agent Does
Every morning at 8:00 AM IST, my agent automatically:
- Fetches live and upcoming cricket match data from Cricbuzz API
- Analyzes pitch conditions, venue history, and weather impact using Amazon Bedrock AI (Nova Lite)
- Generates an optimal Fantasy XI with Captain, Vice-Captain, and Differential picks
- Sends a detailed email with AI pitch report + complete team recommendation via Amazon SNS
I wake up, check my email, and my Dream11 team is ready. Zero manual effort. Zero research time.
The "Always-On" Factor
This agent runs 365 days a year. Whether it's IPL, World Cup, Asia Cup, or bilateral series β every match day, I get AI-powered fantasy advice delivered to my inbox before the match starts. It works while I sleep, and I never miss a deadline again.
ο»Ώ
How I Built It
Development Process
- Day 1 (Evening): Set up AWS account, configured Amazon Bedrock access (auto-enabled), created SNS topic and email subscription
- Day 1 (Night): Built Lambda function, integrated Cricbuzz API with fallback mechanism, tested Bedrock Nova AI generation
- Day 2 (Morning): Fixed SNS integration, end-to-end testing β first email received successfully!
- Day 2 (Afternoon): Added EventBridge schedule for daily automation, created GitHub repo, wrote this article
Key Design Decisions
Decision | Reasoning |
|---|---|
Amazon Bedrock (Nova Lite) for AI | Native AWS integration, no external API key needed, low latency, auto-enabled |
SNS over SES for email | Much simpler setup β no domain verification, no sandbox restrictions, perfect for notifications |
Cricbuzz API + Fallback data | Ensures agent NEVER fails β even if external API is down, hardcoded fallback data keeps it running |
Daily 8 AM IST schedule | Most fantasy contests lock by afternoon β morning advice gives plenty of time to set the team |
Plain text email over HTML | SNS delivers plain text reliably β content matters more than formatting |
Challenges & Solutions
Challenge | Solution |
|---|---|
Cricbuzz API sometimes returns 402 (rate limited) | Built robust fallback with realistic sample match data β agent never fails |
SES email verification was complex | Switched to SNS β just subscribe and confirm, no verification headaches |
Bedrock model access page retired | Discovered models are now auto-enabled β no manual activation needed (2026 update) |
SNS "Invalid Topic Name" error | Was using topic name instead of full ARN β fixed by using complete ARN string |
Lambda timeout with AI generation | Increased timeout to 60 seconds, optimized prompt length for faster responses |
ο»Ώ
AWS Services Used / Architecture Overview
AWS Services
Service | Purpose | Free Tier Coverage |
|---|---|---|
Amazon Bedrock (Nova Lite) | AI model for fantasy team generation + pitch analysis | Pay per token (very affordable) |
AWS Lambda | Serverless compute β runs the agent logic | 1M free requests/month |
Amazon EventBridge Scheduler | Daily 8:00 AM IST automatic trigger | Free |
Amazon SNS | Email notification delivery | 1000 free emails/month |
AWS IAM | Least-privilege security & access control | Free |
Amazon CloudWatch | Logging, monitoring, and debugging | Free tier available |
External Services
Service | Purpose | Cost |
|---|---|---|
Cricbuzz Live API | Cricket match data (live + upcoming) | Free, no API key |
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Amazon EventBridge Scheduler β
β Cron: Daily 8:00 AM IST (30 2 * * ? *) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β Triggers daily
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AWS Lambda Function β
β "Fantasy Cricket AI Advisor" β
β β
β 1. Fetch match data (Cricbuzz API / Fallback) β
β 2. Build match context (teams, venue, format) β
β 3. Generate AI Pitch Report (Bedrock Nova) β
β 4. Generate AI Fantasy XI (Bedrock Nova) β
β 5. Send email notification (SNS Publish) β
βββββ¬βββββββββββ¬βββββββββββββββ¬ββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββ
βCricbuzzββ Amazon ββ Amazon β
β API ββ Bedrock ββ SNS β
β(Free) ββ(Nova AI) ββ (Email) β
βββββββββββββββββββββββββββββββββββββWhat Makes It "Always-On"
- EventBridge Scheduler fires every single day at 8:00 AM IST β no manual intervention
- Fully serverless β no servers to manage, patch, or monitor
- Self-healing β if Cricbuzz API fails, fallback data ensures the agent still delivers value
- Zero maintenance β once deployed, it runs indefinitely without any human intervention
- Cost-effective β runs within free tier limits for personal use
ο»Ώ
What I Learned
- Amazon Bedrock is incredibly easy to use: Models are auto-enabled in 2026 β just invoke and it works. No manual activation, no waiting. The Nova Lite model generates high-quality cricket analysis with well-structured prompts.
- Prompt engineering makes or breaks AI output: Specific prompts with clear structure (numbered sections, word limits, emoji requirements) produce dramatically better results than vague instructions. My fantasy team prompt specifies exact player count, roles, and reasoning format.
- Always build fallbacks for external dependencies: The Cricbuzz API occasionally returns 402 errors. My fallback data pattern ensures the agent never fails β it always delivers something useful, even if the live data is unavailable.
- SNS is underrated for simple notifications: I initially tried SES and hit verification walls. SNS is perfect for this use case β subscribe, confirm, done. No domain setup, no sandbox restrictions.
- Serverless = true "always-on" at near-zero cost: Lambda + EventBridge means my agent costs almost nothing when idle but is always ready. This is the perfect architecture for personal AI agents.
- The "agent mindset" is different from app development: Building something that works autonomously requires thinking about failure modes, graceful degradation, and reliability in ways that interactive applications don't demand.
ο»Ώ
Future Enhancements
- Add DynamoDB to track prediction accuracy over time and improve recommendations
- Support multiple fantasy platforms (Dream11, My11Circle, MPL)
- Integrate real-time player form data and recent match statistics
- Add WhatsApp notifications via AWS Pinpoint for instant alerts
- Implement user preference settings (favorite teams, risk tolerance, budget constraints)
- Add head-to-head player comparison analysis
ο»Ώ
Link to Repo
Repository includes:
- Complete Lambda function code (Β
lambda_function.pyΒ)
- IAM policy configuration (Β
iam_policy.jsonΒ)
- EventBridge schedule configuration (Β
eventbridge_config.jsonΒ)
- Sample email output (Β
sample_output.mdΒ)
- Screenshots of agent in action
- Detailed README with setup instructions
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article