One thing that seems important is to have the agent write down their plan and any useful memory in markdown files, so that further invocations can just read from it