Prompt Engineering Information Extraction Structured Output

Information Extraction Prompt — the Anatomy

The six sections a reliable extraction prompt needs: source guidance, field definitions, extraction rules, missing-data behavior, ambiguity policy, example.

Overview

Most extraction prompts are one sentence and a hope. The ones that survive production have an anatomy: a SOURCE section that tells the model how to read this kind of text, FIELDS that define each piece of information, per-field EXTRACTION RULES (emails validated, dates ISO-formatted, identifiers untouched), a MISSING DATA contract, an AMBIGUITY POLICY, and an example of a valid extraction. This resource loads a job-posting extraction that exercises every section — including a salary_range field whose rule explicitly stops the model from collapsing a range into one number.

How to use this resource

  1. Check each section's job

    SOURCE teaches reading, FIELDS define meaning, RULES handle the traps, MISSING DATA and AMBIGUITY remove improvisation, the EXAMPLE shows the shape.

  2. Watch the salary_range rule

    "Extract the range as written — do not collapse it to one number." Per-field rules exist for exactly these traps.

  3. Swap in your own fields

    Replace the job-posting fields with yours; the engine derives new rules from the names you choose.

Why This Works

  • Each section closes a specific failure mode instead of adding generic words
  • Per-field rules catch the traps generic instructions miss — ranges, formats, identifiers
  • A strict ambiguity policy makes "I'm not sure" produce a blank, not a guess

Best for

  • Anyone whose extraction prompt is currently one sentence long
  • Prompts that work in testing and drift in production
  • Fields with traps — ranges, relative dates, lists inside prose

Not for

  • Quick one-off questions about a text — anatomy is overhead there
  • Output-format depth (types, strictness) — pair with the JSON Output Prompt Builder

Use cases

  • Learning the structure before writing your own extraction prompts
  • Auditing an existing extraction prompt against the six sections
  • Tracking job postings, listings, or announcements into a sheet

FAQ

How does the extraction prompt keep a salary range from being collapsed into one number?

A per-field EXTRACTION RULE handles that trap directly: salary_range must be extracted as written (e.g. "60,000–75,000 EUR") and explicitly not collapsed to a single number. Other fields get their own rules too; application_deadline uses ISO YYYY-MM-DD when the date can be determined. The extraction-prompt-generator derives these from your field names; you run the prompt in your assistant and check the JSON before trusting it.

How does the prompt return a field that isn't in the source text?

It includes the field with an empty string "" and never invents or guesses a value, per the MISSING DATA contract, backed by an AMBIGUITY POLICY that extracts only what's explicitly stated and treats implied-but-unstated values as missing. Output is a single JSON object using the exact field names, no markdown fences. The generator writes this; you still verify blanks are genuinely absent, not just missed.

More resources from Extraction Prompt Generator

Resources that pair well

Related tools

Workflows that use this resource

Guides for this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.