https://www.boundaryml.com logo
Help in this usecase
# help
j
I’m working on a use case involving structured extraction from Excel files that contain 200 to 300 rows across multiple sheets. Currently, I’m chunking the data and sending it piece-by-piece to OpenAI to get structured output, then combining the results. However, I want to explore whether BAML can handle this extraction in one go, since sending the entire file at once to OpenAI isn’t feasible. Additionally, the next step in the process involves a mapping agent that takes the extracted content from the Excel file, maps it to specific database attributes, and then generates SQL queries to load the data essentially an ETL workflow. I’m interested in hearing if anyone is working on a similar use case or has experience using BAML for this kind of structured data extraction and mapping from Excel. I’d appreciate any insights, ideas, or advice on how to approach this efficiently, especially regarding the capabilities and limitations of BAML in this context. If you’re open to discussing or collaborating, I’m eager to connect and learn more.
v
oh you can def send an array of the data and get an array of structured data back!
it actually works quite reliably!
Copy code
function ExtractSlice(elements: string[]) -> MyData[]
then you build some checks to ensure
elements.length == result.length
j
When converting an Excel file to JSON, the output can grow to 5,000–6,000 lines structured as nested sheet objects, each containing rows of key-value pairs. If an AI needs to answer a question about this data, it has no efficient way to locate the relevant row — it would have to read the entire JSON from top to bottom, burning tokens on irrelevant data, risking hitting context limits, and slowing down response time. The question is: how does an AI pinpoint the exact row it needs in a large JSON without scanning the whole file?
v
it really cant! fundamentally this is an O(n) problem. You can then make algorithms to reduce the serach space via vector search / exact match / hueristics, but at some point if you want the model to have the information, then you need to give it context. the job of the engineering teams to build systems that find the right context!
j
can you point me to a framework or a solution similar to this, that i can refer to implement
2 Views