Inferensys

Prompt

Event Structure Extraction Prompt Template

A practical prompt playbook for extracting typed event structures with participants, locations, timestamps, and modalities from unstructured text in production AI workflows.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Determine if the Event Structure Extraction Prompt is the right tool for converting narrative reports into typed, validated event frames.

This prompt is designed for intelligence analysts, knowledge graph engineers, and data pipeline builders who need to convert narrative reports into structured event frames. It extracts typed events with required arguments such as participants, locations, timestamps, and modalities. Use this prompt when you need machine-readable event records that can be ingested into a graph database, event store, or analytical pipeline. The prompt enforces strict argument validation, flags missing required fields, and detects temporal ordering conflicts. It is not a general summarization tool or a simple entity extractor. It assumes the input text contains at least one describable event and that the target schema is defined before extraction begins.

This prompt is the right choice when your primary goal is to populate a structured event schema—such as CAMEO, ACE, or a custom ontology—from free-text reports. It is ideal for workflows where downstream systems require a predictable JSON contract with typed fields for event_type, participants, location, timestamp, and modality. The prompt is designed to fail loudly when critical information is missing, rather than hallucinating plausible values. This makes it suitable for high-stakes intelligence pipelines where a missing field is preferable to a fabricated one. However, it is not a replacement for a full natural language understanding pipeline; it works best on text that has already been pre-segmented into event-containing passages.

Do not use this prompt for general document summarization, simple named entity recognition, or sentiment analysis. It is also a poor fit for highly abstract or speculative text where concrete events are not described. If your input contains hypotheticals, plans, or negated events, pair this prompt with the Event Factuality Assessment Prompt Template to avoid extracting non-events as facts. For cross-document event linking, combine this prompt with the Multi-Document Event Coreference Prompt Template. Before integrating this prompt into a production pipeline, define your target event schema, prepare a golden evaluation set with known event arguments, and establish a human review queue for records that fall below your confidence threshold.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and the operational conditions required before putting it into production.

01

Structured Narrative Reports

Use when: Source text contains clear event descriptions with explicit participants, locations, and temporal markers. Avoid when: Input is a stream-of-consciousness chat log, a highly abstract policy document, or a list of bullet points without connecting narrative.

02

High-Stakes Intelligence Analysis

Risk: Extracting events with missing or hallucinated participants can lead to incorrect analytical conclusions. Guardrail: Require human review for any event where a required argument (e.g., actor, target) is missing or has a confidence score below 0.85. Never auto-ingest unverified events into a production graph.

03

Temporal Ordering Conflicts

Risk: The model may extract events in the order they appear in the text, not the order they occurred, leading to a jumbled timeline. Guardrail: Implement a post-extraction validation step that sorts events by a normalized timestamp and flags any sequence where the narrative order contradicts the chronological order for human review.

04

Required Input Completeness

Required inputs: A source document with narrative text, a defined target event schema (including required vs. optional arguments), and a list of valid event types. Avoid when: The source is a scanned image without OCR, a heavily redacted document, or a table of figures with no descriptive text.

05

Operational Latency and Cost

Risk: Processing long intelligence reports through a large model for exhaustive event extraction can be slow and expensive, creating a bottleneck. Guardrail: Use a smaller, faster model for a pre-filtering step to identify text segments likely to contain events before sending only those chunks to the primary extraction prompt.

06

Schema Drift in Production

Risk: The model may start inventing new event types or argument roles that don't exist in your target ontology, breaking downstream ingestion. Guardrail: Implement a strict output validator that rejects any JSON object with keys not defined in the provided schema. Log these rejections to monitor for prompt drift and update the prompt's few-shot examples accordingly.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt for extracting typed event structures from unstructured text with built-in validation warnings and missing argument detection.

This prompt template is designed for intelligence analysts and data engineers who need to convert narrative reports into structured event records suitable for graph databases, timeline tools, or downstream ingestion pipelines. The template enforces strict JSON output, requires explicit handling of missing information, and includes a validation_warnings field to surface temporal conflicts or incomplete arguments. Copy the template below, replace the square-bracket placeholders with your specific input and constraints, and integrate it into your extraction harness.

text
You are an event extraction system. Your task is to read the provided text and extract all described events into a structured JSON format. Follow these rules exactly:

1. Extract only events explicitly described in the source text. Do not invent, infer, or assume events not directly stated.
2. For each event, populate the following fields:
   - event_type: A short label describing the event category (e.g., "meeting", "attack", "transaction", "arrest").
   - participants: An array of entities involved, each with a "name" and "role" (e.g., "agent", "patient", "witness").
   - location: The place where the event occurred, or null if not specified.
   - timestamp: An ISO 8601 datetime string if a specific time is given, or a relative description if only relative timing is available. Use null if no temporal information exists.
   - modality: One of "factual", "planned", "hypothetical", "negated", or "unknown" based on the language used.
   - description: A one-sentence summary of the event using only information from the source.
   - confidence: A float between 0.0 and 1.0 indicating how clearly the event is stated.
3. If any required argument for an event is missing (e.g., no location mentioned), set the field to null and add a flag to the validation_warnings array.
4. If temporal ordering between events is ambiguous or contradictory, note the conflict in validation_warnings with specific event indices.
5. Return ONLY valid JSON. Do not include any text outside the JSON object.

[INPUT]
[CONSTRAINTS]

Return JSON matching this schema:
{
  "events": [
    {
      "event_type": "string",
      "participants": [{"name": "string", "role": "string"}],
      "location": "string | null",
      "timestamp": "string | null",
      "modality": "factual | planned | hypothetical | negated | unknown",
      "description": "string",
      "confidence": "float"
    }
  ],
  "validation_warnings": ["string"]
}

To adapt this template for your own use, replace [INPUT] with the raw text you need to process. Use [CONSTRAINTS] to inject domain-specific rules, such as a controlled vocabulary for event_type values, required participant roles, or timezone normalization instructions. For high-stakes intelligence workflows, always pair this prompt with a validation step that checks for missing required arguments and flags low-confidence events for human review before ingestion into operational systems.

When deploying this prompt in production, wrap it in an application harness that validates the JSON structure, retries on parse failures, and logs every extraction with its source document identifier and model version. For regulated or investigative use cases, ensure a human analyst reviews events where confidence falls below a defined threshold or where validation_warnings indicate temporal conflicts. Never treat the model's output as ground truth without verification against the original source text.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated before the prompt is sent to the model. Validation notes describe what happens when the variable is missing or malformed.

PlaceholderPurposeExampleValidation Notes

[SOURCE_TEXT]

The raw narrative report or document from which events will be extracted

On 14 March 2025, Alpha Corp acquired Beta Ltd for $340M in a stock transaction signed at their London headquarters.

Reject if empty or under 50 characters. Warn if over 8000 tokens. Must be plain text; strip markup before insertion.

[EVENT_TYPES]

A controlled list of event type labels the model is allowed to output

["acquisition", "merger", "divestiture", "executive_change", "regulatory_filing"]

Must be a valid JSON array of strings. Reject if empty. Each type must match the downstream ontology exactly; no synonyms allowed.

[REQUIRED_ARGUMENTS]

The mandatory fields that must be populated for each extracted event

["event_type", "participants", "date", "location"]

Must be a valid JSON array of field names. If a required argument cannot be extracted, the model must return null for that field, not omit it.

[OUTPUT_SCHEMA]

The exact JSON schema the model must conform to in its response

{"type": "object", "properties": {"events": {"type": "array", "items": {"$ref": "#/definitions/event"}}}, "required": ["events"]}

Validate against JSON Schema draft-07 before sending. Reject if schema is not parseable. Model output must pass this schema or trigger a repair retry.

[TEMPORAL_NORMALIZATION]

Instructions for converting relative dates and times into ISO 8601 format

Convert all date expressions to ISO 8601 (YYYY-MM-DD). If only a year is known, use YYYY-01-01 and set date_confidence to 'partial'.

Must include a fallback rule for ambiguous expressions like 'next quarter' or 'recently'. Missing normalization rules cause inconsistent date formats in production.

[CONFIDENCE_THRESHOLD]

The minimum confidence score an event must meet to be included in automated output

0.75

Must be a float between 0.0 and 1.0. Events below this threshold must be routed to a human review queue, not dropped silently. Null allowed if no threshold filtering is desired.

[MAX_EVENTS]

The maximum number of events the model should extract from a single document

20

Must be a positive integer. If the document contains more candidate events, the model should prioritize by salience and note truncation. Prevents runaway extraction on long documents.

[SOURCE_IDENTIFIER]

A unique document ID attached to every extracted event for provenance tracking

doc-2025-03-14-001

Must be a non-empty string. Every event in the output array must include this identifier in its source_document field. Missing identifiers break cross-document coreference downstream.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Event Structure Extraction prompt into a production application with validation, retries, and human review gates.

The Event Structure Extraction prompt is designed to be called from an application layer, not used as a one-off chat interaction. In production, you will send raw narrative text as [INPUT], optionally provide a target [OUTPUT_SCHEMA] (such as a JSON Schema for typed events), and receive structured event objects. The application is responsible for pre-processing the input (e.g., stripping markup, chunking long documents), calling the model, validating the output, and deciding whether to retry, repair, or escalate to a human reviewer. This harness is critical because raw model output will occasionally contain missing required fields, temporal contradictions, or hallucinated participants that downstream systems cannot tolerate.

A typical implementation wraps the prompt in a service with the following stages: (1) Input preparation — split documents longer than the model's context window into overlapping chunks, preserving sentence boundaries to avoid cutting events in half. (2) Model invocation — send the prompt with the chunked text, the desired output schema, and any domain-specific constraints. Use a low temperature (0.0–0.2) for deterministic extraction. (3) Output validation — parse the JSON response and validate it against your event schema. Check that every event has a non-null type, at least one participant, and a timestamp or temporal_expression. Reject events where the location contradicts the document's stated geography. (4) Repair loop — if validation fails, construct a repair prompt that includes the original input, the invalid output, and the specific validation errors. Retry up to two times before escalating. (5) Deduplication and merge — when processing multiple chunks, merge events that refer to the same real-world occurrence using coreference heuristics (e.g., matching on normalized time, location, and key participants). (6) Human review gate — route events with confidence scores below a configurable threshold, or events flagged with factuality: "uncertain", to a review queue. Log every extraction with the model version, prompt hash, input hash, and validation result for auditability.

When wiring this into a data pipeline, treat the prompt as a versioned artifact stored alongside your application code. Use a prompt registry or configuration store so you can update the prompt without redeploying the entire service. Instrument the pipeline with metrics: extraction latency, validation pass rate, repair loop frequency, and human escalation rate. Set alerts if the validation failure rate spikes after a prompt or model change. For high-stakes intelligence workflows, consider running the same input through two different models (or two prompt variants) and flagging outputs where the extracted event structures diverge significantly. This cross-validation pattern catches subtle hallucinations that schema validation alone would miss. Finally, ensure your logging preserves the full chain of evidence — from source document to extracted event to any human corrections — so that downstream analysts can trace every structured record back to its origin.

IMPLEMENTATION TABLE

Expected Output Contract

The fields, types, and validation rules every extracted event must satisfy before ingestion. Use this contract to validate model output before it reaches a database or downstream system.

Field or ElementType or FormatRequiredValidation Rule

event_id

string (UUID v4)

Must be a valid UUID v4 generated by the extraction run. Reject if missing or malformed.

event_type

string from [EVENT_TAXONOMY]

Must exactly match an allowed value in the provided taxonomy enum. Reject unknown types.

participants

array of [PARTICIPANT_SCHEMA] objects

Array must contain at least one participant. Each object must pass [PARTICIPANT_SCHEMA] validation. Reject empty array.

location

string or null

If present, must be a non-empty string. Null is allowed when location is not mentioned in source text. Reject empty string.

timestamp

ISO 8601 string or null

If present, must parse as a valid ISO 8601 datetime. Null allowed when no temporal information exists. Reject unparseable date strings.

modality

string from [MODALITY_ENUM]

Must be one of: 'factual', 'hypothetical', 'planned', 'negated', 'conditional'. Reject any other value.

confidence

number (0.0 to 1.0)

Must be a float between 0.0 and 1.0 inclusive. Values below [CONFIDENCE_THRESHOLD] should trigger human review before ingestion.

source_spans

array of [SOURCE_SPAN_SCHEMA] objects

Array must contain at least one source span. Each span must include 'document_id', 'start_offset', 'end_offset', and 'quote' fields. Reject if any span has offsets that do not match the quoted text length.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when extracting event structures from narrative text and how to guard against it.

01

Hallucinated Participants

Risk: The model invents people, organizations, or locations not present in the source text, especially when required event slots are empty. Guardrail: Require explicit source spans for every participant. Add a validation step that checks each extracted entity against the original document before ingestion.

02

Temporal Ordering Conflicts

Risk: Extracted events are assigned timestamps that contradict each other or the narrative sequence, breaking downstream timeline reconstruction. Guardrail: Post-process extracted events through a temporal consistency check. Flag events where the extracted order conflicts with explicit before/after language in the source.

03

Missing Required Arguments

Risk: The model returns an event object but omits the agent, patient, or location because the slot was implicit or ambiguous in the text. Guardrail: Define a strict output schema with required fields. Use a validator that rejects incomplete event objects and triggers a targeted re-extraction prompt asking specifically for the missing argument.

04

Modality Misclassification

Risk: Planned, hypothetical, or negated events are extracted as factual occurrences, polluting the event graph with things that did not happen. Guardrail: Add a dedicated factuality field to the output schema. Use a separate classification prompt or few-shot examples that explicitly distinguish 'reported as fact' from 'stated as possibility' before event extraction.

05

Coreference Resolution Failure

Risk: Pronouns and anaphoric references are resolved incorrectly, linking an event participant to the wrong entity or leaving them as an unresolved placeholder. Guardrail: Pre-process the source text with a coreference resolution step before extraction, or include the preceding sentences as context. Validate that extracted participant names appear in the source span for that event.

06

Schema Drift Under Long Context

Risk: When processing long documents, the model forgets the output schema and reverts to prose summaries or drops fields from later events. Guardrail: Chunk the document by section or paragraph. Extract events per chunk with the full schema instruction repeated. Merge and deduplicate events in a post-processing step with cross-chunk coreference checks.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each criterion on a pass/fail basis against a golden dataset of 50 annotated documents. Use this rubric to gate the prompt before production deployment.

CriterionPass StandardFailure SignalTest Method

Event Type Accuracy

Extracted event type matches the annotated type for >= 95% of events in the golden dataset.

Event type mismatch rate exceeds 5%, or model invents event types not present in the allowed taxonomy.

Exact string match against golden labels. Flag any type not in [ALLOWED_EVENT_TYPES].

Participant Completeness

All required participant roles (agent, patient) are populated for >= 90% of events where the golden data includes them.

Missing required participant role in > 10% of events. Null participant where golden data has a valid entity.

Compare extracted participant arrays to golden participant arrays. Check for non-null values where golden data is non-null.

Location Extraction Precision

Extracted location matches the golden location span for >= 85% of events with a location.

Extracted location string does not match the golden location span, or location is hallucinated when golden data has no location.

String similarity check (exact or fuzzy match with threshold > 0.9) against golden location field.

Timestamp Normalization

Extracted timestamp is normalized to ISO 8601 and matches the golden timestamp for >= 90% of events with a temporal expression.

Timestamp format is not ISO 8601, or the normalized value differs from the golden timestamp by more than the allowed tolerance.

Parse extracted timestamp and compare to golden timestamp. Validate format with regex. Allow small tolerance for relative-to-absolute conversion.

Modality and Factuality Flag

Modality flag matches golden factuality label for >= 92% of events.

Factual event labeled as hypothetical, planned, or negated. Or vice versa.

Compare extracted [MODALITY] field to golden factuality label. Check for confusion between 'hypothetical' and 'negated'.

Temporal Ordering Consistency

No temporal contradictions detected in the extracted event sequence for >= 95% of documents.

Event A is ordered before Event B, but Event A's timestamp is after Event B's timestamp.

Sort extracted events by timestamp. Check for monotonic ordering. Flag any inversion.

Null Handling for Optional Fields

Optional fields (e.g., instrument, beneficiary) are null when no evidence exists in the source text for >= 95% of cases.

Optional field contains a hallucinated value when the golden data has null. Or field is null when golden data has a valid value.

Compare extracted optional fields to golden optional fields. Count false positives (hallucination) and false negatives (missed extraction).

Source Span Grounding

Every extracted event has at least one valid source span that matches a sentence in the source document for 100% of events.

Source span string not found verbatim in the source document, or source span is missing.

Substring search for each extracted source span in the original document text. Flag any span not found.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model and minimal post-processing. Focus on getting the event structure shape right before adding validation layers. Start with a small set of event types (3-5) and expand after reviewing output quality.

  • Remove strict schema enforcement; accept JSON that is structurally close
  • Use [EVENT_TYPES] as a short list: ['meeting', 'transaction', 'incident']
  • Skip confidence scoring and source span requirements initially
  • Run 10-20 examples and manually spot-check argument completeness

Watch for

  • Missing required arguments (events without participants or timestamps)
  • Temporal ordering that contradicts the source text
  • Model inventing events not present in the narrative
  • Inconsistent event type labels across similar situations
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.