AWS Builder Center

# Weekend Productivity Challenge: Transactions AI

A single AWS Lambda that turns forwarded bank emails into structured, AI-categorized transactions deployable end-to-end on your own account with Amazon SES, S3, Bedrock (Nova), and DynamoDB.

Vision & What the App Does

Every budgeting habit I'd ever tried died at the same step: manual data entry. Your bank already emails you a purchase notification every time you spend money — mine look like "DAVIVIENDA: Compra por $33,470 en FALABELLA..." — and I kept telling myself I'd log those into a spreadsheet later. I never did.
So this weekend I built (and I'm sharing as a blueprint anyone can deploy on their own AWS account) a Lambda that turns that habit you already have — forwarding or receiving a bank email — into an automatically logged, categorized transaction. You forward the notification to a dedicated inbox address, and within seconds a structured record (merchant, amount, date, category, type) is sitting in your own DynamoDB table, ready to be read by a dashboard, a spreadsheet sync, a Slack bot, or whatever front end you want to bolt on.
The point of this article isn't "look at my app" — it's "here's a self-contained, single Lambda you can point at your own inbox, your own bucket, and your own Bedrock model access, and have working by Sunday night." No shared backend, no account of mine involved: every piece of state (which bucket, which model, which table) is a config value, not a hardcoded assumption.

How You Built It (and How You Can Build Yours)

The design constraint I set for myself: no bank-specific parsing code. There are dozens of banks in Latin America alone, each with a different email format, and hand-writing a regex per bank doesn't survive contact with reality. Instead, the Lambda hands the raw email text to an AI agent constrained by a strict output schema (merchant, amount, date, category, type, notes) built with Pydantic — the field descriptions are the extraction instructions, so there's no separate prompt to maintain per bank or language. Whatever bank's email format lands in the inbox, the schema is the only contract that matters.
Here's the actual build sequence, reproducible in any AWS account:
  1. Verify a domain in SES and add a receipt rule that saves incoming mail to an S3 bucket (any bucket name — it's read from the event, never hardcoded).
  1. Request model access to Amazon Nova in the Bedrock console for your region — this is the one manual, click-through step that can't be scripted.
  1. Create a DynamoDB table for transactions; point the Lambda at it with one environment variable ( DYNAMO_TABLE_NAME ).
  1. Deploy the Lambda from the provided Dockerfile — it reads  BEDROCK_MODEL_ID ,  AWS_REGION ,  DYNAMO_TABLE_NAME , and  USER_POOL_ID  from the environment, so cloning the repo and setting four values is the entire "porting" step.
  1. Wire the S3  ObjectCreated  event to trigger the Lambda, and you're receiving structured transactions from your own inbox.
Cognito only enters the picture if you want it to: the UUID in the recipient address is the account identifier by default, so a single-user setup needs zero auth configuration. Set a  USER_POOL_ID  environment variable and the Lambda starts validating that UUID against a real Cognito user before saving anything — useful if you're building this for more than just yourself, without touching a line of code either way.
The one AI-specific decision worth calling out: the extraction step runs on Amazon Bedrock (Nova Lite) rather than an external LLM API, specifically so the entire pipeline — receiving, storage, and inference — stays inside AWS and inside the Free Tier, with nothing to sign up for outside the console.

AWS Services Used / Architecture Overview

  • Amazon SES — receives the forwarded email at a domain/address you control
  • Amazon S3 — stores the raw email and fires the Lambda trigger
  • AWS Lambda (Python, container image) — parses the email and runs the extraction agent
  • Amazon Bedrock (Nova Lite via Pydantic AI) — turns unstructured email text into a validated transaction record
  • Amazon DynamoDB — stores the transaction, in a table you create and name yourself
  • Amazon Cognito (optional, for multi-user) — maps an inbox address to a user identity
your email → SES → S3 → Lambda → Bedrock (Nova) → your DynamoDB table
Every arrow in that diagram lives entirely inside your own AWS account — nothing calls out to infrastructure I control.

What I Learned

Letting a schema — not a hand-written parser or a bank-specific prompt — define "structured" generalized far better than I expected: new, previously-unseen email formats mostly "just work" without touching code, because the contract is the data shape, not the input format.
The other lesson was about scope: the version worth sharing wasn't the one with the most features, it was the one where every dependency on "my specific setup" had already been swapped for an environment variable. That's a small amount of extra discipline while building, and it's the difference between a demo and something someone else can actually stand up.

Link to Repo

 https://github.com/alejofig/transactions-ai  — clone it, set four environment variables, point it at your own AWS account.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article