Self learning memory v2: hooks

This is the second post in a two-part series. The first post describes the memory bank approach I built on top of Cline's original concept, including the short-term/long-term split and