Tag: ai

  • Cloudwatch Alarm AI Agent

    I think one of the biggest time sucks is getting a vague alert or issue and not having a clue on where to start with troubleshooting.

    I covered this in the past when I built an agent that can review your AWS bill and find practical ways to save money within your account. This application wasn’t event driven but rather a container that you could spin up when you needed a review or something you could leave running in your environment. If we take a same read-only approach to building an AWS Agent we can have have a new event driven teammate that helps us with our initial troubleshooting.

    The process flow is straight forward:

    1. Given a Cloudwatch Alarm
    2. Send a notification to SNS
    3. Subscribe a Lambda function to the topic (this is our teammate)
    4. The function utilizes the AWS Nova Lite model to investigate the contents of the alarm and utilizes its read only capabilities to find potential solutions
    5. The agent sends its findings to you on your preferred platform

    For my environment I primarily utilize Slack for alerting and messaging so I built that integration. Here is an architecture diagram:

    When the alarm triggers we should see a message in Slack like:

    The AI is capable of providing you actionable steps to either find the root cause of the problem or in some cases, present you with steps to solve the problem.

    This workflow significantly reduces your troubleshooting time and by reducing the troubleshooting time it reduces your downtime.

    So, if this is something you are interested in deploying I have created a Terraform module so you can quickly deploy it into your own environment to reduce your troubleshooting steps!

    Check it out here: https://aiopscrew.com

    If you have questions feel free to reach out to me at anytime!

  • Fantasy Football and AI – Playoffs Round 2

    Well. It had to end at some point.

    I think the AI mostly selected correctly this week. Unfortunately it wasn’t enough. We fell short by about 5 points. Going into Monday night we needed a massive game from George Kittle as the rest of the team performed very poorly. He delivered all the way until the 4th quarter where he likely twisted his ankle and was done for the game as the 49ers were up 2 scores.

    Here are the results:

    Josh Allen might have had a foot injury early in the game but stayed in for the entire game. The Bills simply didn’t throw the football. TreVeyon Henderson got absolutely demolished and left the game with a probable concussion. Josh Jacobs was questionable going into the game and cleared to play. The Packers simply didn’t play him.

    With that loss we are eliminated from the playoffs and will be playing next week for 3rd place. Still a decent finish for our first year utilizing AI.

    Looking Ahead

    Through the off season I want to continue to work on the overall architecture of this agent and system. Ideally, I want to have the custom model built for next season and build an API around that to help us make better predictions.

    Other action items:

    1. Find a way to load news stories and story lines for determinations
    2. Manage injuries/waivers better
    3. Handle live NFL standings (teams eliminated from playoffs might play differently than teams fighting for a spot)

    I also would love to be able to expose all of this publicly so that anyone reading can build their own applications around my predictions.

    Stay tuned next week for our final placement!

  • Fantasy Football and AI – Playoffs Round 1

    So I was wrong in last weeks post! Our playoffs started this week. In my league all the teams go to the playoffs and if you lose then there is a loser’s bracket.

    Our AI run team was seeded at number 3. We were in a three way tie for first place and we ended the “regular season” with 2054.76 points. The leader had 2114.12. So, we weren’t far off the front!

    Anyway, enough of that. You all just want to know the outcome. Here is our point totals from our first round in the playoffs:

    I ran the AI on Saturday and it suggested pulling out Josh Jacobs in favor of TreVeyon Henderson. This ended up getting us an extra 10 points. Josh Jacobs still put up 24.2 points this week. Everyone played really well this week except Sam Darnold. I’m not sure if his hot streak is over or what is going on with him but its been rough. Christian Watson took a nasty hit in his game and left early but he is expected to be just fine.

    So, did we win? We sure did! We’re on to the next round of the playoffs and we’re going to be up against Jahmyr Gibbs so we have to hope for our best performance of the season next week. Here is the currently proposed roster:

    We have a lot of injuries and questionable players so I expect this to change. We picked up the Bills defense as they play Cleveland and they should have a good time against that struggling offense.

    As we look to the off season I hope to build up my API website https://gridirondata.com and start training the model that we will use for next year. I have been working on the overall workflow and looking into how I can have both the scrapers running in the cloud and in my homelab so that I can easily work with the data locally and not incur a lot of cloud cost.

    Stay tuned for more Fantasy Football news next week!

  • Fantasy Football and AI – Week 14

    Happy Wednesday. Victory Wednesday that is! Our AI selected correctly this week and we snuck in a tough win that was finalized on Sunday night.

    Unfortunately, we lost Zach Ertz on the way. A really nasty low hit took him out for the year. Here is the final scores for our lineup:

    Josh Allen came up huge for us. Breece Hall was useless and the Commanders defense might as well have never stepped out on the field. But, a win is a win! We are now in a 3 way tie for first place but will likely take the third seed into the playoffs given our total fantasy points.

    Here is the lineup for week 15: We’ve had to make some changes from waivers and I’m hoping the AI selected correctly. We are heading into the part of the season where teams are going to be fighting for playoff spots. I hope that it is taking that into account as it made the waiver picks.

    We have some highly projected players this week. What do you think? Will we be able to pull off another win this week?

  • Fantasy Football and AI – Week 12

    Well, unfortunately we took a big loss and are now in a three way tie for first place. Here are the actual results:

    I think the biggest hit was how poorly Josh Allen played. What is interesting is that I was reviewing his passed performance against Houston and he has had his worst outings of his career there. This week was no different… The other interesting thing is that Saquon Barkley just isn’t the same back as he was last year. He is trending down.

    In response to Josh Allen’s poor outing I added a deviation and historical performance analysis against and opponent to the data set so now we have a value like:

    "HOU": {
       "avg_actual": 11.6,
       "avg_deviation": -2.67,
       "avg_deviation_percentage": -18.69,
       "avg_projected": 14.27,
       "by_season": {
        "2024": {
         "avg_actual": 14.6,
         "avg_deviation": 0,
         "avg_deviation_percentage": 0,
         "avg_projected": 0,
         "games_played": 1,
         "games_with_projections": 0
        },
        "2025": {
         "avg_actual": 5.05,
         "avg_deviation": -5.65,
         "avg_deviation_percentage": -52.8,
         "avg_projected": 10.7,
         "games_played": 2,
         "total_actual": 10.1,
         "total_projected": 21.4
        }
       },

    I then coded a new tool inside of the AI to reference this data set to assist with its final calculations.

    So, when we ask the tool about Josh Allen’s performance against a team we get something like:

    Found exactly what you're looking for in Josh Allen's performance data.
    
    Josh Allen vs Kansas City (Week 9, 2025):
    - 28.8 fantasy points - That's a STRONG performance!
    - He was projected for 22.0 points but exceeded by 6.8 points (+30.9%)
    - This was one of his better games this season
    
    Historical Context (2024 vs KC):
    - Week 11, 2024: 24.0 fantasy points vs Kansas City
    
    Bottom Line: Josh Allen has performed WELL against Kansas City in recent matchups. In their two most recent meetings:
    - 2025 (Week 9): 28.8 points
    - 2024 (Week 11): 24.0 points
    
    That's an average of 26.4 fantasy points against KC - well above his season average. Allen seems to rise to the occasion against elite competition like Kansas City. The Chiefs' defense can be vulnerable to mobile QBs who can extend plays, and Allen's dual-threat ability has historically given them problems.
    
    The takeaway: When Allen faces KC, he typically delivers QB1 numbers. That 28.8-point performance this season shows he can still light up even the defending champs!

    I need to backload some more historical data yet but that is a problem for a different day. Looking forward, I hope to build my own model based on this data and setup an automated workflow that will include data ingestion and automated model building so that I can consistently build predictions.

    So, on to week 13. We have a bunch of injuries this week to contend with so this lineup will likely be changing once people are reporting. Here is the current lineup:

    In other news I built and launched https://gridirondata.com which is an API to reference all of the data I have collected so far.

    Unfortunately, its not free. But if you message me about it I’ll probably hook you up!

  • Fantasy Football and AI – Week 10

    Well, week 10 has completed. And, WE WON AGAIN! It was a close one that came down to Monday Night Football. I had to buy a day pass to SlingTV so that I could watch the game due to the Youtube TV and Disney dispute. But, Josh Jacobs squared off against Saquon Barkley in the most BORING of football games. At any point in time, if AJ Brown had scored a touchdown I think we would have lost the matchup. Here are the final results.

    For week 11 we dropped the Panther’s defense. Honestly, im not sure why the AI recommend them. I know the Saint’s are bad, but I think the Panther’s defense is worse. Anyway, we picked up the Bear’s for week 11. Badgley and the Colts have a bye this week so anyone playing against Jonathan Taylor can breathe a sigh of relief. The AI also suggested grabbing Riley Patterson and Zach Ertz. Here is our current lineup for week 11:

    Marvin Harrison Jr. Is out with appendicitis which is a big bummer for his divisional matchup.

    From a technical standpoint, I added in a data source and tool for the AI to check depth charts in order to assist in picking up players. This way it won’t suggest lower players. We can also research picks based on injury. In Marvin Harrison Jr.’s case we can see this:

    Cardinals WR Depth Chart:
    1. Marvin Harrison Jr. - OUT (your guy who's hurting)
    2. Zay Jones - This cat becomes the clear WR1 with Harrison out. He's got experience and should see a big target bump
    3. Simi Fehoko - Depth piece, might see some snaps but not a fantasy factor
    4. Michael Wilson - Could be interesting as a deeper option, might get more looks
    5. Greg Dortch - Slot guy who could see increased usage in 3-WR sets
    6. Xavier Weaver - Rookie, probably not fantasy relevant yet

    One thing to note is that it doesn’t know about other injury statuses yet. So I will be looking to add that in shortly.

    Tied for 1st. Playoffs start soon. Here comes the big push to finish out this season!

  • Fantasy Football and AI – Week 9

    A BIG win in week 9! Our team is now tied for 1st place with 6 wins and 3 losses. We currently have 1318.66 total fantasy points on the season. It was looking pretty grim going into the afternoon games on Sunday. The receivers AI selected were not preforming and other players were barely hitting their projects. Josh Allen sparked some life into the team with his 30 points and then Sam Darnold showed everyone how to play quarter back with a 37.2 point performance! Check out the full results below.

    So, now we’re off to week 10. Currently, as I write this, Saquon Barkley is questionable to play. I would expect that he does play but the AI will not put him in the starting lineup. We picked up the Panther’s defense upon request from the AI. I would expect this is because they are playing the Saints who just traded away Rasheed Shaheed. The addition of DJ Moore into the OP slot is going to be a rough choice over playing a quarterback in that position. I’ll be monitoring the roster throughout the week to see if there are any other suggestions we can make. Here is what we are currently fielding into week 10:

    Tune in next week for the results! Hopefully AI can get to 7-3!

  • Fantasy Football and AI – Week 7

    Well, our win streak was too good to be true. Unfortunately we lost a close one in week 6. It came down to the Monday night games and Sam Darnold just wasn’t able to get it going over the Texans even though the Seahawks still pulled out the win.

    Our running back group also did not preform well outside of Josh Jacobs. The loss was by a difference of about 7 points so if anyone had put up another touchdown we could have won.

    Anyway, on to week week 8. A few byes to contend with but otherwise most of are starts will be playing. The AI suggested grabbing the Colts defense and kicker as they are playing Tennessee. Breece Hall is currently questionable to play so we will have to keep an eye on that but he has a favorable matchup against the Bengals. The current roster is below.

    I promised to work on MCP this week but have only made a little bit of progress. I’ve been doing a lot of research on doing it in a cost effective manner as this project makes ZERO dollars and so I can’t afford to setup a bunch of expensive infrastructure. SO – this week I worked on combining the waiver table and the stats table into one table so that we can minimize DynamoDB calls throughout the application. The other thing I did was setup DynamoDB streams which are then converted into text files for each player and placed into an S3 bucket. This is what I think will be the first step in setting up a RAG pipeline so that a model can begin to be more “aware” of current NFL and Fantasy Football landscape.

    Here is an updated architecture diagram. You’ll notice the S3 bucket on the right side. This is the eventual start of our knowledgebase.

    You’ll also notice the waiver table removed. The new player structure looks like this:

    {
     "player_id": "George Kittle#TE",
     "espn_player_id": 3040151,
     "player_name": "George Kittle",
     "position": "TE",
     "seasons": {
      "2024": {
       "season_totals": {
        "MISC_FL": 0,
        "MISC_FPTS": 158.6,
        "MISC_FPTS/G": 10.6,
        "MISC_G": 15,
        "MISC_ROST": "99.4%",
        "Player": "George Kittle",
        "Rank": 1,
        "RECEIVING_20+": 21,
        "RECEIVING_LG": 43,
        "RECEIVING_REC": 78,
        "RECEIVING_TD": 8,
        "RECEIVING_TGT": 94,
        "RECEIVING_Y/R": 14.2,
        "RECEIVING_YDS": 1106,
        "RUSHING_ATT": 0,
        "RUSHING_TD": 0,
        "RUSHING_YDS": 0
       },
       "weekly_stats": {
        "1": {
         "fantasy_points": 4,
         "opponent": "NYJ"
        },
        "2": {
         "fantasy_points": 13.6,
         "opponent": "MIN"
        },
        "4": {
         "fantasy_points": 10.5,
         "opponent": "NE"
        },
        "5": {
         "fantasy_points": 12.4,
         "opponent": "ARI"
        },
        "6": {
         "fantasy_points": 17.8,
         "opponent": "SEA"
        },
        "7": {
         "fantasy_points": 9.2,
         "opponent": "KC"
        },
        "8": {
         "fantasy_points": 18.8,
         "opponent": "DAL"
        },
        "10": {
         "fantasy_points": 11.7,
         "opponent": "TB"
        },
        "12": {
         "fantasy_points": 14.2,
         "opponent": "GB"
        },
        "13": {
         "fantasy_points": 0.7,
         "opponent": "BUF"
        },
        "14": {
         "fantasy_points": 15.1,
         "opponent": "CHI"
        },
        "15": {
         "fantasy_points": 6.1,
         "opponent": "LA"
        },
        "16": {
         "fantasy_points": 10.6,
         "opponent": "MIA"
        },
        "17": {
         "fantasy_points": 11.2,
         "opponent": "DET"
        },
        "18": {
         "fantasy_points": 2.7,
         "opponent": "ARI"
        }
       }
      },
      "2025": {
       "injury_status": "ACTIVE",
       "jersey_number": "85",
       "percent_owned": 98.97,
       "pro_team_id": 25,
       "season_projections": {
        "MISC_FL": 0.5,
        "MISC_FPTS": 147.6,
        "RECEIVING_REC": 76,
        "RECEIVING_TD": 7.5,
        "RECEIVING_YDS": 1036.9
       },
       "team": "SF",
       "weekly_outlooks": {
        "1": "George Kittle is healthy and wealthy for the 49ers' Week 1 matchup against Seattle after signing a big four-year contract extension in the offseason. Kittle's role as a pass catcher should be intensified early on with WR Brandon Aiyuk (ACL) on the PUP list to begin the campaign and Jauan Jennings (calf, contract) uncertain to suit up against the Seahawks. Kittle is coming off a 78-catch, 1,106-yard, eight-TD 2024 campaign, further cementing his place as one of the NFL's elite producers at tight end. The Seahawks were middle-of-the-pack against the position last year, giving up an average of 51.5 receiving yards per game.",
        "2": "George Kittle won't play in San Francisco's Week 2 matchup against New Orleans due to a hamstring injury that landed him on IR. Luke Farrell and Jake Tonges, who caught a TD in Kittle's absence last week against the Seahawks, will be asked to step in at tight end for the 49ers.",
        "3": "George Kittle will miss his second straight game for the 49ers in Week 3 against the Cardinals while he remains on IR due to a hamstring injury. Jake Tonges and Luke Farrell should continue to hold down the fort at TE for Kittle until the latter is able to return. Kittle won't be eligible to suit up again until Week 6."
       },
       "weekly_projections": {
        "5": 12.7,
        "6": 13.1,
        "7": 13.4,
        "8": 11.7,
        "10": 14.6,
        "12": 11.6,
        "13": 13.2,
        "14": 13.4,
        "15": 14.1,
        "16": 14.1,
        "17": 14.5
       },
       "weekly_stats": {
        "1": {
         "fantasy_points": 12.5,
         "opponent": "SEA",
         "team": "SF",
         "updated_at": "2025-10-15T17:40:58.625370"
        },
        "2": {
         "fantasy_points": 12.5,
         "opponent": "NO",
         "team": "SF",
         "updated_at": "2025-09-16T17:08:05.179797"
        },
        "3": {
         "fantasy_points": 12.5,
         "opponent": "ARI",
         "team": "SF",
         "updated_at": "2025-09-23T15:00:13.907272"
        },
        "4": {
         "fantasy_points": 12.5,
         "opponent": "JAX",
         "team": "SF",
         "updated_at": "2025-09-30T15:00:14.035733"
        },
        "5": {
         "fantasy_points": 12.5,
         "opponent": "LAR",
         "team": "SF",
         "updated_at": "2025-10-07T15:00:13.665217"
        },
        "6": {
         "fantasy_points": 12.5,
         "opponent": "TB",
         "team": "SF",
         "updated_at": "2025-10-14T15:00:14.748804"
        }
       }
      }
     },
     "updated_at": "2025-10-22T18:11:05.039158"
    }

    I hope to continue to refine this so that it can be used for future seasons. Then we can continue to use the bot into 2026’s season.

    Anyway, hopefully I can figure out MCP and the knowledgebase this week. Winter is coming so its time to hunker down and build AWS Architectures!

  • Fantasy Football and AI – Week 6

    We’re back with the week 6 AI managed fantasy football team and we got another win! The team’s record is now 4-2-0 and sits 3rd in the league.

    Here is the final lineup that was fielded for week 6 and the points

    There were a couple players on the bench that did better. Keenan Allen and Breece Hall could have been swapped for pretty much anyone on the bench and we would have had a few more points. A win is a win. One thing to note is that we had a game time injury of Dalton Kincaid and I had to pull Zach Ertz in at the last minute to avoid getting a zero.

    For week 7 we are starting to see both injury and bye weeks happening. The AI will have to make some pretty deep roster moves in order to fill the gaps. Here is the initial starting lineup:

    Because of the BYE weeks we are picking up Aaron Rodgers who put up a good game against Cincinnati last night. DK did not have a great night last night. We picked up the Patriots defense as well as Eddy Pineiro to fill in some slots. I think the Patriots against Tennessee will be an interesting matchup given that the Titans fired their head coach. Mike Vrabel has the Patriots firing again and hopefully he can shut them out and we can put up some big points!

    From a tech perspective, I’m slowly putting together an MCP server to help create some efficiencies when working with the DynamoDB tables. Hopefully, if we can handle that, the overall application response time will be faster. If I wasn’t traveling AGAIN this weekend I would have made it a hackathon. Hopefully for week 8!

    Subscribe for updates.

  • Using Strands to build an AWS Cost Analysis Agent

    Taking a break from Fantasy Football today to talk about a quick weekend project I put together.

    A friend of mine was chatting about how their AWS costs are getting out of control and they aren’t sure where to start when it comes to cleaning up the account. This prompted me with an idea to utilize AI to build an Agent that can interact with your AWS account to review resources, provide cost analysis and give you clear CLI commands or console instructions to help clean up the account.

    In order to do this, I wanted to incur as little cost as possible. So, I built a Docker image in order to run it locally. First, there is a shell script that will build an IAM User in your account that provides read-only access to the account, Cost Explorer access and access to Bedrock (to communicate with an AI model).

    The Docker image runs and builds an Agent that interacts with whichever model you want to utilize. I picked Amazon’s Nova model just to keep the costs down. The container then presents a web interface where the account’s bill break down will be displayed:

    It will also display some common costly resources and their counts:

    The next block is where things get very helpful. The AI will present to you suggestions as to how to save some money as well as some risk calculations. Because I ran this against my real account I had to blur out some information but you get the idea:

    So, now you have some actionable activities to work through to help you save money on your AWS bill. But what if you have more questions? I also included a simple chat box to help you work with the bot to come up with other explanations or find other ways to save cost.

    So I asked the AI to find the largest instance in my account and then determine the right size for it. Here is the response:

    Why would this be important? Well, if you had the AI review all of the instances in your account you could identify EC2 instances that are oversized and have them be changed accordingly. After I implemented a few of the changes that the AI recommended (and verified they didn’t break anything), my account billing decreased by about $100.

    If this is something you are interested in running on your own account feel free to reach out! I’d be happy to help you setup up the container on your machine and make suggestions as to how to save some money!