Allow agents to determine how long to keep events for

add keep_events_for as an optional field for agents to decide how long to store events for