
Weekend Agent Challenge: Autonomous-personal-finance-agent
An autonomous serverless AI-powered Personal Finance Agent that runs automatically every night to analyze financial transactions, categorize expenses using Amazon Bedrock, predict monthly spending patterns, detect unusual transactions, and generate personalized savings recommendations, all orchestrated through AWS Step Functions
Building an Autonomous Serverless Personal Finance Agent with Amazon Bedrock and AWS Step Functions
Vision & What the Agent Does
Managing personal finances is something many of us intend to do regularly, yet it often becomes a reactive task. By the time we review our monthly statements, we may have already overspent, missed unusual transactions, or overlooked opportunities to save. I wanted to explore how Generative AI could shift this from a reactive activity to a proactive one.
The idea behind this project was to build an autonomous Personal Finance Agent that works in the background without requiring any user intervention. Instead of waiting for someone to log in and analyze their spending, the agent automatically wakes up every night, reviews the latest transaction data, performs AI-powered financial analysis, and prepares actionable insights for the user.
The workflow begins with Amazon EventBridge, which triggers the agent on a nightly schedule. AWS Step Functions orchestrates the entire workflow, coordinating multiple AWS Lambda functions that retrieve transaction data, process it, and invoke Amazon Bedrock for intelligent financial analysis.
During each execution, the agent categorizes expenses into meaningful spending categories, predicts monthly spending trends based on historical behavior, identifies unusual transactions that may require attention, and generates personalized savings recommendations. The generated insights are stored for future analysis and important alerts can be delivered through Amazon SNS, while Amazon SQS provides asynchronous messaging for downstream processing.
The objective was not simply to automate a financial report, but to demonstrate how an autonomous AI agent can continuously monitor data, reason over it using a foundation model, and proactively deliver valuable insights without waiting for user input.
How I Built It
I designed the solution using a fully serverless architecture, allowing the entire application to scale automatically while eliminating infrastructure management. Since the agent performs a sequence of dependent tasks, I selected AWS Step Functions as the orchestration engine rather than embedding the workflow inside a single Lambda function. This approach provided better visibility into execution, simplified error handling, and made the workflow easier to maintain and extend.
The solution consists of multiple AWS Lambda functions, each with a well-defined responsibility. One function retrieves transaction data from Amazon DynamoDB, another prepares and validates the data, while a dedicated AI analysis function interacts with Amazon Bedrock to generate financial insights. The analysis results are stored in a separate DynamoDB table, allowing transaction data and AI-generated insights to remain logically separated.
To improve extensibility, I integrated Amazon SQS for asynchronous processing and Amazon SNS for notifications. This event-driven design makes it easy to introduce additional consumers, such as dashboards, mobile applications, or analytics pipelines, without modifying the core workflow.
Another challenge was designing a workflow that remained modular while coordinating several AWS services. By separating orchestration, business logic, and AI processing into independent components, the overall architecture became cleaner, easier to debug, and more maintainable. AWS Step Functions execution history and Amazon CloudWatch logs were invaluable during testing, helping me quickly identify and resolve workflow issues.
AWS Services Used & Architecture Overview
This project combines several AWS serverless and AI services to build an autonomous, event-driven workflow.
AWS Services
- Amazon EventBridge – Triggers the Personal Finance Agent automatically every night.
- AWS Step Functions – Orchestrates the end-to-end workflow and coordinates each stage of execution.
- AWS Lambda – Executes transaction processing, data preparation, and AI analysis logic.
- Amazon Bedrock – Performs expense categorization, spending analysis, monthly forecasting, anomaly detection, and personalized savings recommendations.
- Amazon DynamoDB – Stores transaction records and AI-generated financial insights.
- Amazon SQS – Queues analysis results for asynchronous processing.
- Amazon SNS – Sends financial alerts and notifications.
- Amazon CloudWatch – Provides logging and monitoring for the workflow.
- AWS IAM – Secures communication between AWS services using least-privilege access.
High-Level Architecture
- Amazon EventBridge triggers the workflow on a nightly schedule.
- AWS Step Functions orchestrates the Personal Finance Agent.
- Lambda retrieves transaction data from Amazon DynamoDB.
- Transaction data is processed and validated.
- Amazon Bedrock analyzes spending patterns, categorizes expenses, predicts monthly spending, detects anomalies, and generates savings recommendations.
- AI-generated insights are stored in Amazon DynamoDB.
- Results are published to Amazon SQS for asynchronous processing.
- Important notifications are sent through Amazon SNS.
- Amazon CloudWatch monitors workflow execution and logs.

What I Learned
This project provided an excellent opportunity to combine serverless computing, workflow orchestration, and Generative AI into a single solution.
One of my biggest takeaways was that building an AI agent involves much more than invoking a foundation model. The real value comes from designing an end-to-end workflow that enables the agent to operate autonomously, coordinate multiple services, and perform meaningful actions without human intervention.
Working with AWS Step Functions reinforced the importance of separating orchestration from business logic. Instead of building a monolithic Lambda function, I was able to create a modular workflow that is easier to visualize, troubleshoot, and extend. I also gained a deeper appreciation for event-driven architectures and how services such as Amazon EventBridge, Amazon SQS, and Amazon SNS work together to build scalable, loosely coupled applications.
Another valuable learning experience was prompt engineering with Amazon Bedrock. Small refinements to prompts had a significant impact on the quality, consistency, and usefulness of the AI-generated financial insights. This reinforced that prompt design is a critical part of building reliable AI-powered applications.
Overall, this project demonstrated how AWS serverless services and Generative AI can be combined to build autonomous agents that proactively analyze information, generate intelligent recommendations, and help users make better decisions. It also highlighted the importance of designing solutions that are modular, observable, and easy to evolve as new AI capabilities become available.
Challenges encountered
Mostly I faced permission issues while integrating services, which I fixed by attaching right policy to IAM role .
Also Lambda function execution time error. which I fixed by changing the configuration of function & increased the execution time to 5mins.
screenshots:















GitHub repo :
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article