class MemoryService():
    def __init__(self, experiment_filename):
        self.experiment_filename = experiment_filename
        self.filepath = f"./experiments/{self.experiment_filename}_memory.txt"
        self.t = 0

        with open(self.filepath, "a") as f:
            f.write("Creating a new voyager agent from scratch\n")

    def save_action_message(self, message: str):
        with open(self.filepath, "a") as f:
            f.write(f"Time step {self.t}\n")
            f.write(message + "\n")

        self.t += 1
        
    def update_exploration_progress(self):
        with open(self.filepath, "a") as f:
            f.write("-----TASK ATTEMPT DONE-----" + "\n")