Smarter Reporting

Applying AI to turn dense reports into clear, useful insights.

AWS BedrockPythonReactAmazon S3

Cappadocia, TürkiyePhoto: Jeremy Swagger

Agvance

Analyzing data across multiple reports used to require users to manually compare findings and identify connections. I developed an AI-powered reporting feature that consolidates these insights into a single, accessible summary. By integrating AWS Bedrock with intelligent document preprocessing and systematic testing, I created a reliable solution that simplifies complex analysis and reduces AI token consumption by about 75%.

Workflow diagram: in the React UI, the user selects up to 20 reports of any mix of types. The Python backend fetches each PDF from S3 and detects its type from the filename. Text-only types send extracted text with no PDF, avoiding image tokens, while PDF types send the raw PDF plus table JSON and a color legend when found. Reports are batched at up to 5 reports and 100 images per batch. Up to 5 reports go in one call, streamed straight back; 6 to 20 reports use map-reduce, summarizing batches in parallel and then combining. The summary is rendered as markdown in a modal in the React UI.

There was no easy way to see across multiple reports.

Accessing insights across multiple reports was a cumbersome task for users. They had to manually compare different documents to spot trends and connections, which was time-consuming and inefficient.

Building a test pool to make AI results dependable.

To tackle the variability in report formats, I implemented a thorough testing process to assess the performance of different report combinations. Utilizing Claude Code, I created Python scripts that processed these reports via AWS Bedrock. This enabled us to compare AI-generated summaries with direct analyses, helping to refine inputs and enhance consistency.

Diagram titled Building a test pool: a grid of 24 report tiles of varying layouts, with three highlighted in orange as problem cases to isolate, feeds a repeating loop. Run: send a specific report through Bedrock. Compare: check it against a direct analysis. Isolate: pull out the problem cases. Add context: guardrails per report type, color legends. The loop then repeats.

Cutting token use by 75% while keeping the insight.

I designed a streamlined React interface, allowing users to easily select multiple reports and view AI-generated summaries in a user-friendly format. On the backend, I crafted a Python class that pulls selected reports from Amazon S3, optimizing content for AI processing. A key achievement was reducing token consumption by about 75% through a dynamic preprocessing system that combined text extraction and image optimization, ensuring efficient and effective summaries.

Clear summaries in a single click.

Users can now generate consolidated summaries with just one click, significantly simplifying the process of identifying trends and key findings across reports. This approach not only enhances cross-report analysis but also maintains high token efficiency, ensuring more reliable AI-generated insights.

The Summary modal for three selected reports, with an overview of corn yields across 12 fields, key highlights comparing North 80 and Creek Bottom, and a Worth a closer look note on Creek Bottom's later planting and lower yield.
Illustrative summary with sample data.
The Reports view: a list of six reports with Spring Planting Summary, Fertilizer Applications, and Yield by Field checked and a Summarize button below. A Yield by field map of 12 fields shows North 80 mostly green for higher yield and Creek Bottom mostly orange and red for lower yield. A Summary panel for the 3 selected reports gives an overview, key highlights, and a Worth a closer look note.
Illustrative reports view with sample data.