Save notes to file. Creates parent directory and file if they don't exist (lazy initialization).
(self, notes: list)
| 80 | return [] |
| 81 | |
| 82 | def _save_to_file(self, notes: list): |
| 83 | """Save notes to file. |
| 84 | |
| 85 | Creates parent directory and file if they don't exist (lazy initialization). |
| 86 | """ |
| 87 | # Ensure parent directory exists when actually saving |
| 88 | self.memory_file.parent.mkdir(parents=True, exist_ok=True) |
| 89 | self.memory_file.write_text(json.dumps(notes, indent=2, ensure_ascii=False)) |
| 90 | |
| 91 | async def execute(self, content: str, category: str = "general") -> ToolResult: |
| 92 | """Record a session note. |