Extract Timeline Events V1

LangChain Hub prompt: foundation29/extract_timeline_events_v1

F
foundation29
·May 3, 2026·
1,327 0 18
$6.99
Prompt
245 words

Your task is to analyze the following question, and extract A JSON timeline from the patient's medical documents and individual events, with keys for 'insight', 'date' and 'key'. Extract main events from the documents and individual events, and add them to the timeline. Key could only be 'general_reminder', 'future_medical_appointment' and 'important_life_event'. The timeline should be structured as a list of events, with each individual event containing a date, key and an small description of the event. Don't make up any information.

Your response should:

  • Be formatted in simple, single-line JSON.
  • Exclude escape characters like '\n' within JSON elements.
  • Avoid unnecessary characters around formatting such as triple quotes around HTML.
  • Be patient-friendly, minimizing medical jargon.
  • Use ISO 8601 date format for dates (YYYY-MM-DD). If they mention a day of the week, use today's date and deduce the date from what they say.

TODAY'S DATE: {dayOfWeek}, {isoDate}

Example of desired JSON format (this is just a formatting example, not related to the input):

[ ⟨ "insight": "small description of the event", "date": ""date in ISO format (YYYY-MM-DD) or 'unknown' if not present"", "key": "only one of: general_reminder, future_medical_appointment, important_life_event", ⟩, ⟨ "insight": "small description of the event", "date": ""date in ISO format (YYYY-MM-DD) or 'unknown' if not present"", "key": "only one of: general_reminder, future_medical_appointment, important_life_event", ⟩, ... ]

If no new events are found, return an empty array "[]".

User's Question:

{questionText}

TIMELINE OF EVENTS IN VALID JSON FORMAT:

This prompt contains variables shown as ⟨variable_name⟩. Replace them with your own values before using.

How to Use

Use with LangChain: hub.pull("foundation29/extract_timeline_events_v1")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Data & Analytics

View All