> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runtimelabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Calendar

Chronologue's event generation pipeline converts structured memory traces (`.json`) into calendar events (`.ics`) following the iCalendar standard. This allows natural language input to produce concrete, time-aligned actions in external scheduling systems.

The core script powering this transformation is `modules/export_ics.py`.

***

### Calendar Event Format

Chronologue conforms to a minimal but valid iCalendar `VEVENT` structure:

```ics theme={null}
BEGIN:VEVENT
UID:lab_ops-20240407@memorysystem.ai
DTSTAMP:20250401T080000Z
DTSTART:20240407T090000Z
DTEND:20240407T091500Z
SUMMARY:Temperature in incubator #3 drifted 1.5°C above target during morning run.
DESCRIPTION:Temperature in incubator #3 drifted 1.5°C above target during morning run.
LOCATION:wetlab_sync
STATUS:CONFIRMED
END:VEVENT
```

All fields are derived from the memory trace or inferred via defaults. A working .ics is generated using:

```
ics_string = generate_ics_string(memory_trace)
```

**Steps**

1. Load JSON memory trace files

2. Validate trace entries

3. Generate VEVENTs

4. Write a consolidated `.ics` calendar event

### Key Functions and Parameters for Customization

`resolve_duration_minutes(trace)`

* Parses flexible user duration formats: 2h, 30m, 1:00-2:30, or "one hour"

* Customize: Default duration (currently 30), upper bound, parsing logic

`generate_uid(title, date)`

* Constructs a globally unique UID from task ID and date

* Customize: Change UID domain, format, or link to external systems

`generate_summary_title(content)`

* Uses OpenAI to create a concise SUMMARY field

* Fallbacks to truncating raw content if LLM fails

Customize: Model, max length, prompt template

`generate_ics_string(trace)`

* Assembles a VEVENT from a single memory trace

* Includes SUMMARY, DESCRIPTION, LOCATION, DTSTART, DTEND, UID, STATUS

`write_consolidated_ics(events, output_path)`

* Writes header, VEVENT blocks, and footer into a single .ics file
* Customize: PRODID, versioning metadata, newline style (Windows/iCal)

### Opportunities for Personalization

* Chronologue encourages local customization for different user or organization memory systems:

* Duration interpretation for different workflows (e.g. lab vs. meetings)

* LLM-based title summarization vs. rules-based

* Structured description fields for reflection, chat links, metadata

* Custom UID namespaces for cross-platform syncing

* Flexible timestamp parsing and formatting

**Testing Output Format**

Use test\_ics\_format() to generate a sample .ics file and validate against the expected template:

```
python modules/export_ics.py
```

This writes a file test\_output.ics to inspect the generated format against the gold standard.

**Related Concepts**

* [Event Retrieval](concepts/event-retrieval.mdx)

* [iCalendar Integration](concepts/icalendar.mdx)

* [Prompt Design Patterns](foundations/prompt-examples.mdx)
