Extract Data From Text with AI
Free text in, named fields out. The extraction prompt pattern that turns any unstructured text into consistent, parseable records.
Parties, effective date, term, payment, termination notice, governing law — key terms into a contract register, with "unknown" marking every gap loudly.
Contract review at register scale is an extraction problem: every agreement needs the same key terms on file. This setup pulls parties (every name in the preamble, exactly as written), effective_date in ISO format, term_length and termination_notice as durations with their units, payment_amount as a bare number, and governing_law — under the strictest settings on the tool: no inference at all, and missing values returned as the literal "unknown" so a human reviewer sees every gap instead of skimming past a null. Legal text punishes guessing; this prompt forbids it.
Generate and run per agreement
One contract per call; the preamble guidance tells the model where parties and defined terms live.
Read the "unknown"s first
Return Unknown turns every gap into a visible flag — the missing termination clause is the finding, not a blank.
Keep durations as written
term_length and termination_notice keep their units ("24 months", "30 days") — no unit math, no conversion errors.
Missing fields come back as the literal string 'unknown', never null or an empty value, so a reviewer scanning the register sees an explicit flag rather than skimming past a gap. The generated prompt also restricts 'unknown' to genuinely absent terms, so a contract with no termination_notice clause reads as a finding, not an oversight.
payment_amount comes out as a bare numeric value only, so 1840.5 rather than '$1,840.50' or 'EUR 1.840,50' — the rules strip currency symbols and thousands separators. If you need the currency preserved, edit the generated prompt to add a separate currency field, since this one deliberately isolates the number for register math.
It keeps durations exactly as written with their original units — '24 months' stays '24 months', '30 days' stays '30 days' — because the rules forbid unit math or conversion. That avoids conversion errors, but means any sort or comparison across the register has to normalize those units yourself before the values line up.
It won't — the ambiguity policy treats any value that's implied but not explicitly stated as missing, and the effective_date rule only uses ISO format (YYYY-MM-DD) when the date is actually determinable, otherwise extracting it as written. Because the tool builds a no-inference prompt, accuracy still depends on the source text; verify borderline fields yourself in whichever assistant you run it in.
Free text in, named fields out. The extraction prompt pattern that turns any unstructured text into consistent, parseable records.
Invoice number, vendor, dates, total, currency — extracted into clean fields with strict no-inference rules, ready for accounts payable.
The most consequential setting in any extraction prompt: what the model does when the field isn't in the text. Four behaviors, and when each is right.
Stop getting 'Sure, here is the JSON…' — the output-contract pattern that forces models to return only parseable JSON: schema, example, and a strict rule block.
Billing, Technical, Account, How-To, Feature Request — ticket triage with definitions that decide the borderline cases for the model.
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Build prompts that extract defined fields from unstructured text — emails, invoices, tickets, résumés.
AI pulls the fields you asked for, but hands back a flat list with no way to tell which values it read from the document and which it guessed. Here's how to make each extracted value carry its source quote, location, and a review flag — so you can check the result instead of trusting it.