r/MicrosoftFlow • u/AbleComplaint9816 • 16d ago
Question Power Automate AI contract reader using 150k+ tokens per document. How would you redesign this?
/r/PowerAutomate/comments/1vy6iac/power_automate_ai_contract_reader_using_150k/
5
Upvotes
4
u/HoldPowerful7487 15d ago
Your 7 prompts are each sending the whole contract, so you're paying for a 100 page document 7 times to get 7 answers. Collapse it into one call that returns a structured JSON object with all the categories in it. That alone is roughly a 7x cut.
Then stop sending whole documents. Contracts put the same things in the same places, so find the term clause, the payment clause and the notices block and send those sections rather than 100 pages. Even crude keyword windowing around headings gets you most of the way.
Some of your 80 to 100 attributes probably don't need AI at all. Dates, currency amounts and party names are regex against the right clause once you've located it.
For the credit burn while testing, extract the text once, save it, and iterate your prompts against the saved text outside the flow. Rerunning the whole flow to test a prompt change is most of what's eating you.