๐Ÿค– Automation ยท Claude API ยท Python ยท SQL

AI Reporting Agent

End-to-end automation for recurring financial reports โ€” SQL extracts and validates the data, Claude API drafts the narrative, reusable Python modules handle scheduling and run logging. Runs unattended every cycle.

Fully
Unattended runs
3
Reusable modules
Full
Run logging
API
Integrations
The Problem

Recurring financial reports require the same steps every cycle โ€” pull the data, validate it, format it, write a narrative summary, distribute it. Each step takes a person hours, and it has to happen on a fixed schedule whether or not anyone has time for it.

The manual version also creates a dependency: if the person who runs the report is out, the report is late. And if something went wrong during the run, there's often no record of what happened or at what step it failed.

The Goal

Build a reporting agent that runs the full cycle unattended โ€” SQL extraction, data validation, narrative generation via Claude API, and a complete run log โ€” with modular code so any step can be swapped out or reused in a different report.

My Role

Designed and built the full pipeline. Wrote the SQL extraction and validation logic, structured the prompt and API integration for the Claude-generated narrative, built the scheduling and logging layer, and modularized the code so each piece could be reused across different report types without rewriting.

Tools & What I Used Them For
SQL Extraction & Validation
Pulls the report data from the source database and runs validation checks โ€” row counts, null checks, range checks โ€” before anything moves downstream. If validation fails, the run stops and logs the issue instead of generating a report on bad data.
Claude API Narrative Generation
Takes the validated data and generates the written narrative section of the report โ€” the kind of summary that used to require a person to read the numbers and write up what they meant. Prompt-engineered to match the report's tone and structure.
Python Orchestration
Ties all the pieces together โ€” calls the SQL extraction, passes the data to validation, feeds the results to the Claude API, formats the final output, and logs the full run. Each module is importable independently for reuse in other report types.
Run Logging Observability
Every run writes a structured log โ€” what ran, what it returned, what it flagged, whether it succeeded or failed and at which step. Makes debugging straightforward and gives a full audit trail for each report cycle.
Outcomes
โšก
Reports run fully unattended. The agent handles extraction, validation, narrative generation, and logging on its own โ€” no manual steps required between scheduling and final output.
๐Ÿ”„
Modular code, reusable across reports. Each module โ€” SQL extractor, validator, narrative generator, logger โ€” is independently importable. Adding a new report type means swapping the SQL query and prompt, not rebuilding the pipeline.
๐Ÿ“‹
Full audit trail per run. Every execution is logged with timestamps, step outcomes, and any flags raised โ€” so when something looks off in a report, the log tells you exactly where it happened.
โ† Previous Project Next Project โ†’