The Accordion Pattern: Why I stopped writing one fat LLM prompt
Dev.to AI
•
Generative AI
Most structured-extraction tutorials look the same. Take a document, write one big prompt that says "extract A, B, C, D, E, F", get JSON back. Done. This works on short inputs. It quietly breaks on long ones. After running this in production for a while, I stopped doing it. Here's what I switched to and why. The fat prompt problem Say you have a 50-page report and you want a structured summary out of it. The natural first move is something like: Extract: - title - sections (with headings) - purpose - mentioned services - acceptance criteria -. Return JSON in this shape.