You can kludge it together by having the agent keep a log of what it does with any notes and lessons about friction / efficiency, and then on some interval review that + session history for items worth promoting into a topic-based memory, or for things that are needed constantly into the main AGENTS.md or a separate MEMORY.md that's loaded into every session. Reviewing the notes at the same time as session history helps provide enough context to make directionally correct decisions about what is worth keeping in context for future sessions.