This prompt is designed for incident commanders and SRE teams who need to convert messy, multi-source incident data into a structured, causally-linked timeline. It teaches the model to extract events, normalize timestamps, infer causal relationships, and annotate impact through few-shot demonstrations rather than verbose procedural instructions. Use this when you have chat logs, monitoring alerts, and deployment records that must be assembled into a single chronological narrative for a postmortem or incident review.
Prompt
Incident Timeline Structuring Demonstration Prompt

When to Use This Prompt
Defines the ideal scenario, user, and prerequisites for deploying the Incident Timeline Structuring Demonstration Prompt.
This prompt assumes you have already collected and deduplicated the raw source material. It does not replace your incident management tooling; it structures the narrative evidence that feeds into it. The ideal input is a pre-assembled text blob containing all relevant logs, messages, and alerts. The output is a strictly ordered JSON timeline. Do not use this prompt for real-time alerting, as it is designed for post-hoc analysis. It is also unsuitable for generating action items or remediation steps; its sole job is evidence structuring.
Before using this prompt, ensure your raw data is complete. The model will not detect missing sources. If a critical Slack channel or monitoring stream is absent from the input, the resulting timeline will contain a narrative gap. Always pair this prompt with an evaluation step that checks for temporal ordering and missing event detection. If the timeline will be used in a customer-facing incident report, a human reviewer must verify the causal links the model infers.
Use Case Fit
Where the Incident Timeline Structuring prompt works, where it fails, and the operational prerequisites for production use.
Good Fit: Post-Mortem Chat Logs
Use when: You have multi-participant chat logs (Slack, Teams) from an incident and need a chronological, fact-based timeline. The prompt excels at extracting timestamps, identifying the first reporter, and linking diagnostic actions to their results. Guardrail: Always provide the raw, unedited chat export. Summarization before extraction introduces temporal ambiguity.
Bad Fit: Real-Time Streaming Data
Avoid when: You need a live timeline updated from a continuous event stream. This prompt is designed for a static, bounded context window of a completed incident. Guardrail: For real-time use, decompose the problem into a stateful application that appends to a structured timeline object, using this prompt only for initial batch backfill.
Required Input: Normalized Timestamps
Risk: The model will hallucinate event ordering if chat logs contain only relative times ('3 minutes ago') or user-local time zones without a UTC reference. Guardrail: Pre-process all inputs to include an ISO 8601 UTC timestamp for every message before passing them to the prompt. The prompt's examples assume this normalization.
Operational Risk: Causal Over-Linking
Risk: The model may infer a causal relationship ('X caused Y') between temporally adjacent but independent events, creating a false narrative of the incident. Guardrail: The output schema must separate a chronology array (strict temporal order) from an optional causal_links array. Require explicit evidence from the chat log for any causal link, and default to 'correlated' if evidence is missing.
Operational Risk: Silent Omission of Events
Risk: For long incidents, the model may skip minor events to save output tokens, creating an incomplete timeline that omits a crucial misdiagnosis. Guardrail: Implement an eval that counts the number of distinct action events in the input against the number of entries in the output timeline array. A significant discrepancy should trigger a human review or a secondary extraction pass with a stricter prompt.
Bad Fit: Blast Radius & Impact Analysis
Avoid when: Your primary goal is to calculate the financial impact, number of affected users, or SLO breach duration. This prompt structures events, not business metrics. Guardrail: Use the structured timeline output as an input to a separate, deterministic analysis function or a different prompt designed for quantitative impact assessment. Do not ask this prompt to perform arithmetic on customer counts.
Copy-Ready Prompt Template
A reusable prompt that teaches the model to extract, normalize, link, and annotate incident events from unstructured chat logs and monitoring data using few-shot demonstrations.
This prompt template structures raw incident chatter and monitoring snippets into a rigorous timeline. It relies on few-shot examples to teach the model three specific skills: event extraction with timestamp normalization, causal linking between events, and impact annotation using a controlled vocabulary. The examples are the primary teaching mechanism—they show the exact output schema, the delimiter conventions, and the annotation rules before the model processes the target input. Adapt the placeholder values to match your incident taxonomy, timezone conventions, and severity definitions.
textYou are an incident timeline structuring assistant. Your task is to convert raw incident chat logs and monitoring data into a structured timeline. Follow these rules: - Extract discrete events. Each event must have a normalized timestamp in ISO 8601 UTC. - Link causally related events using the `caused_by` field, referencing the `event_id` of the preceding event. - Annotate each event with an `impact` field from this controlled vocabulary: [SEVERITY_LEVELS]. - If a timestamp is ambiguous or missing, mark it as `null` and set `confidence` to `low`. - Output ONLY a valid JSON object matching the [OUTPUT_SCHEMA]. Do not include any text outside the JSON. [EXAMPLES] Now, process the following input and produce the structured timeline: [INPUT]
Adaptation guidance: Replace [SEVERITY_LEVELS] with your incident severity taxonomy as a JSON array of strings (e.g., ["critical", "major", "minor", "observational"]). Replace [OUTPUT_SCHEMA] with a concise JSON Schema definition of the expected output object, including required fields (event_id, timestamp, description, caused_by, impact, confidence). The [EXAMPLES] placeholder should contain 2–3 fully worked input-output pairs that demonstrate correct timestamp normalization, causal chain construction, and impact annotation. Each example must include the raw input block and the corresponding structured JSON output. The [INPUT] placeholder receives the target chat log or monitoring snippet at runtime. Before deploying, validate that the model reliably produces parseable JSON matching the schema across at least 20 varied inputs, and add a post-processing step that checks temporal ordering (each event's timestamp must be >= the timestamp of any event it references via caused_by).
Prompt Variables
Inputs the Incident Timeline Structuring Demonstration Prompt needs to work reliably. Replace each placeholder with concrete values before sending the prompt.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[RAW_CHAT_LOG] | Unstructured chat transcript or log dump containing incident-related messages | 2024-11-15 14:03:22 <alice> seeing 500s on checkout 14:03:45 <bob> checking now | Must contain at least 3 timestamped messages. Null not allowed. Validate with regex for timestamp presence before prompt assembly. |
[MONITORING_DATA] | Structured or semi-structured monitoring alerts, metrics, or dashboards relevant to the incident window | {"alert": "checkout-latency-p99 > 2s", "fired_at": "2024-11-15T14:02:00Z", "service": "payment-gateway"} | Must be valid JSON or key-value pairs. Null allowed if no monitoring data available. Schema check: confirm service name and timestamp fields exist. |
[INCIDENT_BOUNDARY_START] | ISO-8601 timestamp marking the earliest point to include in the timeline | 2024-11-15T13:45:00Z | Must parse as valid ISO-8601 datetime. Must be before [INCIDENT_BOUNDARY_END]. Validate with datetime parser before prompt assembly. |
[INCIDENT_BOUNDARY_END] | ISO-8601 timestamp marking the latest point to include in the timeline | 2024-11-15T15:30:00Z | Must parse as valid ISO-8601 datetime. Must be after [INCIDENT_BOUNDARY_START]. Validate with datetime parser before prompt assembly. |
[KNOWN_EVENT_TYPES] | List of event categories the model should classify timeline entries into | ["deployment", "alert_fire", "alert_resolve", "human_action", "customer_impact", "mitigation"] | Must be a JSON array of strings with at least 3 entries. Validate array structure and non-empty strings. Null allowed if classification is not required. |
[OUTPUT_SCHEMA] | JSON schema or format description the timeline output must conform to | {"type": "array", "items": {"required": ["timestamp", "event_type", "description", "source"]}} | Must be valid JSON Schema or a plain-text format specification. Validate parseability. Null not allowed; schema is required for structured extraction. |
[CAUSAL_LINKING_RULES] | Instructions for how the model should infer and annotate causal relationships between events | "Link events when a human action directly follows an alert within 5 minutes and references the same service" | Must be a non-empty string. Validate minimum length of 20 characters. If causal linking is not desired, set to "No causal linking required." |
[IMPACT_ANNOTATION_REQUIREMENTS] | Specification for how customer or system impact should be annotated on timeline entries | "Annotate each event with impact_level: none, degraded, or outage based on monitoring data and chat context" | Must be a non-empty string. Validate minimum length of 10 characters. If impact annotation is not required, set to "No impact annotation required." |
Implementation Harness Notes
How to wire the incident timeline structuring prompt into a production incident management workflow.
The Incident Timeline Structuring prompt is designed to be called as a single step within a larger post-incident review pipeline. It expects a pre-assembled [INPUT] block containing raw chat logs, monitoring alerts, and deployment events. Do not stream raw, unbounded chat history directly into this prompt. Instead, pre-process the input to extract a relevant time window (typically from first alert to resolution) and deduplicate repeated messages. The prompt's few-shot examples teach the model to normalize timestamps to UTC ISO 8601, infer causal links between events, and annotate impact, so the application layer should not attempt this normalization beforehand—doing so would prevent the model from learning the pattern from the provided demonstrations.
Wire this prompt into your incident management system as a post-resolution processing step. After an incident is declared resolved, trigger a pipeline that: (1) queries your chat platform (Slack, Teams) and monitoring tools (PagerDuty, Datadog) for events in the incident window, (2) assembles the raw text into the [INPUT] placeholder, (3) calls the model with the prompt template, and (4) validates the returned JSON against the expected schema. The output schema should enforce an array of event objects with required fields: timestamp (ISO 8601 string), event_type (enum: alert, action, communication, resolution, impact), source (string), description (string), and causal_links (array of indices referencing prior events). Reject any response where events are not in ascending temporal order or where causal_links reference indices that don't exist. For high-severity incidents (SEV1/SEV2), route the structured timeline to a human incident commander for review before publishing to the postmortem document. Log the raw model response, validation errors, and any human corrections for future example drift detection.
Model choice matters for this workflow. Use a model with strong JSON mode and long-context handling, such as Claude 3.5 Sonnet or GPT-4o, because incident timelines often span thousands of tokens of raw chat and alert data. Enable structured output mode if available to reduce schema violations. Set temperature to 0 or near-zero to minimize timestamp hallucination. Implement a retry strategy: if validation fails due to schema non-conformance, retry once with the validation error message appended to the prompt as a correction hint. If the retry also fails, escalate to a human operator with the raw input and partial output. Do not silently accept timelines with missing events—compare the count of extracted events against a heuristic floor (e.g., at least one event per 30 minutes of incident duration) and flag anomalies. Finally, store the validated timeline in your incident database with a reference to the prompt version used, enabling regression testing when the prompt template is updated.
Expected Output Contract
Defines the exact fields, types, and validation rules for the structured timeline object the model must return. Use this contract to build a post-processing validator before the output reaches any downstream system or human reviewer.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
timeline_id | string (UUID v4) | Must match regex for UUID v4. Reject if missing or malformed. | |
incident_summary | string (1-280 chars) | Length check: 1-280 characters. Must not be identical to [INCIDENT_TITLE]. Reject if empty or over limit. | |
events | array of event objects | Must be a non-empty array. Reject if null, empty, or not an array. Each element must conform to the event object schema. | |
events[].event_id | string (integer index) | Must be a zero-padded string matching the 1-based index in the array (e.g., '001'). Reject if not sequential or missing. | |
events[].timestamp_utc | string (ISO 8601) | Must parse to a valid UTC datetime. Reject if timezone is missing or not UTC. Apply a sanity check: no future dates allowed. | |
events[].source_evidence | string | Must be a non-empty excerpt from [INPUT_LOG]. Perform a substring check against the original log. Reject if no match is found. | |
events[].event_description | string (10-500 chars) | Length check: 10-500 characters. Reject if empty or over limit. Must not be a verbatim copy of source_evidence. | |
events[].impact_annotation | string or null | If provided, must be one of the predefined enums: 'user_impacting', 'system_internal', 'investigative', 'resolution'. Reject if not in enum list. Null allowed. | |
events[].causal_relationship | string or null | If provided, must reference a valid events[].event_id from a preceding event. Reject if self-referencing or referencing a future event_id. Null allowed. |
Common Failure Modes
What breaks first when structuring incident timelines from chat logs and monitoring data, and how to guard against it.
Temporal Ordering Violations
What to watch: The model reorders events incorrectly, placing effects before causes or misinterpreting relative timestamps (e.g., '5 minutes after the alert' placed before the alert itself). This is common when chat logs and monitoring data use different time formats or timezones. Guardrail: Require the model to output a sequence_index for each event and run a post-processing check that timestamps are monotonically increasing. Include a worked example where a misordered draft is corrected.
Missing Event Detection
What to watch: The model skips critical low-signal events like 'first user report,' 'silent metric drop,' or 'automated rollback started' because they lack explicit alert language. This creates a gap in the causal chain. Guardrail: Provide few-shot examples that explicitly extract passive observations (e.g., a Slack message saying 'is it slow for everyone?') as formal events. Add an eval check that counts expected event types against extracted events.
Causal Link Hallucination
What to watch: The model invents a causal relationship between two temporally adjacent but unrelated events (e.g., claiming a config push caused a latency spike when the spike started 10 minutes earlier). Guardrail: Require explicit evidence for each causal link in the output. Use a negative example showing a timeline where the model incorrectly links events and is corrected to mark the relationship as 'temporal coincidence, causal link unconfirmed.'
Timestamp Normalization Drift
What to watch: The model fails to normalize disparate timestamp formats (epoch ms, ISO 8601 with varying offsets, human-readable like '2m ago') into a single standard, leading to duplicate or misaligned entries. Guardrail: Dedicate a demonstration block to timestamp normalization, showing input strings and the expected normalized output. Implement a pre-processing step that converts all timestamps to UTC ISO 8601 before the prompt if possible.
Impact Annotation Inflation
What to watch: The model overstates the impact of minor events (e.g., labeling a 2% error rate blip as a 'major outage') or understates critical failures due to hedging language in the source logs. Guardrail: Provide a severity rubric in the demonstration (e.g., SEV1 = full outage, SEV3 = minor degradation) and show examples of correctly classified impacts. Include an eval check for severity distribution consistency.
Source Attribution Collapse
What to watch: The model merges information from multiple sources (Slack, PagerDuty, Datadog) without tracking provenance, making it impossible to verify claims or resolve contradictions between sources. Guardrail: Require a source field on every extracted event in the output schema. Use a demonstration example where conflicting sources are preserved as separate events with a 'conflict' flag rather than silently merged.
Evaluation Rubric
Use this rubric to test the Incident Timeline Structuring Demonstration Prompt before shipping. Each criterion targets a known failure mode in event extraction, timestamp normalization, causal linking, or impact annotation. Run these checks against a golden set of chat logs and monitoring data.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Event Extraction Completeness | All events explicitly mentioned in [CHAT_LOG] and [MONITORING_DATA] appear in the output timeline | Output omits a documented event (e.g., a deployment, alert, or user report present in the source) | Diff the set of extracted event descriptions against a human-annotated ground-truth event list; flag any source event with zero corresponding output entries |
Timestamp Normalization Accuracy | All output timestamps are in [OUTPUT_TIMEZONE] and correctly converted from source timestamps in [CHAT_LOG] and [MONITORING_DATA] | Output contains a timestamp in the wrong timezone, an unparseable format, or a time that does not match the source event order | Parse every output timestamp; assert it matches the source timestamp after conversion to [OUTPUT_TIMEZONE]; fail if any delta exceeds 60 seconds |
Temporal Ordering Consistency | Events in the output timeline are sorted in ascending chronological order with no reversals | A later event appears before an earlier event in the timeline sequence | Extract the timestamp array from the output; assert it is strictly non-decreasing; flag any inversion |
Causal Link Validity | Every causal link in the output references two events that both exist in the timeline and has a direction supported by the source material | A causal link points to a nonexistent event ID, reverses cause and effect, or asserts a relationship not evidenced in [CHAT_LOG] or [MONITORING_DATA] | For each causal link, verify both referenced event IDs exist; then check the source material for explicit or strongly implied causation; flag unsupported links |
Impact Annotation Grounding | Every impact annotation includes a severity level from [SEVERITY_LEVELS] and a scope description traceable to source statements | An impact annotation uses a severity level outside the allowed enum, omits scope, or describes impact not mentioned in the source | Validate severity against the allowed enum; check that the scope description contains a phrase or metric present in the source material; flag hallucinations |
Output Schema Compliance | The output is valid JSON matching [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys | Output is not valid JSON, is missing a required field, or contains an undefined field | Run the output through a JSON schema validator configured with [OUTPUT_SCHEMA]; fail on any validation error |
Missing Information Handling | When source data is insufficient to determine a timestamp, causal link, or impact, the output uses the [UNCERTAINTY_MARKER] rather than fabricating a value | Output contains a specific timestamp, causal link, or impact claim for an event where the source provides no supporting evidence | Identify output fields that are populated with concrete values; for each, confirm the source contains corresponding evidence; flag any populated field with no source grounding |
Duplicate Event Consolidation | The same real-world event reported in both [CHAT_LOG] and [MONITORING_DATA] appears as a single timeline entry with merged evidence | The same incident (e.g., a CPU spike) appears as two separate timeline entries with slightly different timestamps and no cross-reference | Cluster output events by description similarity and time proximity; flag clusters that should be a single entry based on source context |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base demonstration prompt and 2-3 worked timeline examples. Use simple delimiter patterns like ### INPUT and ### OUTPUT without strict schema validation. Focus on teaching the extraction pattern rather than enforcing output contracts.
Prompt modification
code### INPUT [CHAT_LOG_SNIPPET] ### OUTPUT { "events": [ {"timestamp": "...", "event": "...", "source": "..."}] }
Watch for
- Timestamp format inconsistency across examples
- Missing causal linking between events
- Model inventing events not present in source logs
- Example count exceeding context window for long incidents

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us