AWS Logo
Menu

Analyze Excel Files in Bedrock

using DocumentBlock to automatically handle documents as part of your prompt

gengis
Amazon Employee
Published Mar 17, 2025
Bedrock Converse API handles parsing/ingesting excel documents by specifying a DocumentBlock: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_DocumentBlock.html
This greatly facilitate experimenting with files and conversing with an LLM to extract insights from structured information. Here is a sample code where we load a local excel file as bytes and call the Converse API adding this array to a document object:
Adding an excel file using DocumentBlock will load the full document within the prompt. This is an easy way to quickly experiment and see if your file can be analyzed successfully by Bedrock. Most of the time you will move away from sending full files and try to break down files either for cost optimization (maybe you just need to send the header and a few rows), performance or more complex file formats (like multi tabs, merged cells,..) where you want a more custom processing.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

3 Comments