Inspiration

Cloud resources are often left idle, oversized, or underutilized, leading to unnecessary spending. While AWS provides tools like Cost Explorer and Trusted Advisor, manually reviewing and acting on this data is time-consuming. We wanted to build an autonomous AI agent that doesn’t just analyze usage but also reasons, recommends, and acts — making cloud optimization smart, simple, and continuous.

What we learned

  • How to leverage Amazon Bedrock for reasoning LLMs and integrate them into autonomous workflows.
  • Using AgentCore primitives to give the agent decision-making ability, enabling “plan → act → observe” cycles.
  • Pulling and analyzing billing/usage data from the AWS Cost Explorer API and CloudWatch.
  • Designing for credit efficiency by using lightweight services (Lambda, S3, API Gateway).
  • Balancing autonomy and safety: allowing the agent to recommend changes while giving humans approval before execution.

How we built it

  1. Data Fetching: AWS Cost Explorer API + CloudWatch metrics provided real-time cost and utilization data.
  2. Reasoning: An LLM hosted on Bedrock (Claude Haiku / Llama 3 8B) processed the usage data, identified inefficiencies, and generated recommendations.
  3. AgentCore Integration: We used Bedrock AgentCore primitives to orchestrate tool usage — invoking APIs, analyzing results, and planning the next steps.
  4. Autonomy Layer: The agent decided whether to stop idle EC2s, resize databases, or move S3 objects to Glacier.
  5. Execution: AWS Lambda functions automated infrastructure actions, with all outputs stored in S3 and shared via API Gateway.

Challenges we ran into

  • Balancing cost vs performance: Choosing the right Bedrock model (Claude Haiku for cost efficiency vs Sonnet for richer reasoning).
  • Autonomy vs control: Ensuring the agent doesn’t accidentally shut down critical resources — we added a “recommendation only” mode.
  • Learning curve: Understanding how AgentCore primitives work with Bedrock to orchestrate multi-step reasoning.
  • Hackathon time pressure: Designing a system that’s unique, impactful, and feasible within limited credits and deadlines.

Built With

  • Amazon Bedrock (Claude / Llama 3)
  • Amazon Bedrock AgentCore
  • AWS Lambda
  • Amazon S3
  • Amazon API Gateway
  • AWS Cost Explorer API
  • Amazon CloudWatch
  • Python (boto3 SDK)

AutoInfra shows how AI can make cloud infrastructure not just smart — but self-optimizing.

Built With

Share this project:

Updates