.ics
files from your personal calendar into structured memory traces (.json
) for processing, summarization, and re-ranking in grounding language model outputs and behavior. This feature allows events from external calendar systems to be made available for planning and coordination.
The primary script for this transformation is modules/import_calendar.py
which reads .ics
files, parses VEVENT
blocks, and outputs .json
memory traces.
From the root directory of the repository:
.ics
Input Example.ics
file with VEVENT
blocks:
.ics
FileVEVENT
blocks using regex aqnd extracts:
content
(from DESCRIPTION)
timestamp
(from DTSTART)
end
(from DTEND)
duration_minutes
(inferred from timestamps)
location
, uid
, type
validate_memory_trace()
.
.json
parse_ics_datetime(dt_str)
Converts YYYYMMDDTHHMMSSZ
to ISO 8601 (YYYY-MM-DDTHH:MM:SSZ
).
Used for both DTSTART
and DTEND
.
parse_ics_event(ics_text)
Parses a single VEVENT
block and returns a Dict
matching memory trace schema.
Infers duration if DTSTART
and DTEND
are present.
Adds “type”: “calendar_event” to each parsed trace.
import_ics(filepath)
Reads .ics
content, parses all VEVENT
blocks, validates, and returns a list of event dictionaries.
save_events_to_json(events, output_path)
Dumps parsed event traces to a single .json
file with the key “memory”.
import_ics_from_directory(input_dir, output_dir)
Batch conversion: processes all .ics files in input_dir and saves .json
files to output_dir
.
Ensure the input/output paths are correctly set in the main section. By default:
validate_memory_trace
to enforce domain-specific fields (e.g., tags, user ID).
meeting
, deadline
, or user-defined tags from other fields (e.g., CATEGORIES).