Load recent entries from memory.md into cache.
(self, limit: int = 100)
| 20 | self._load_file_cache() |
| 21 | |
| 22 | def _load_file_cache(self, limit: int = 100): |
| 23 | """Load recent entries from memory.md into cache.""" |
| 24 | self.file_cache = [] |
| 25 | try: |
| 26 | with open(self.memory_file, 'r') as f: |
| 27 | lines = f.readlines() |
| 28 | # Keep last N entries |
| 29 | self.file_cache = lines[-limit:] if len(lines) > limit else lines |
| 30 | except FileNotFoundError: |
| 31 | pass # File doesn't exist yet |
| 32 | |
| 33 | def store_to_file(self, content: str, episode: str = "", step: int = 0): |
| 34 | """ |