MCPcopy Create free account
hub / github.com/OpenManus/OpenManus-RL / _load_file_cache

Method _load_file_cache

openmanus_rl/memory/file_memory.py:22–31  ·  view source on GitHub ↗

Load recent entries from memory.md into cache.

(self, limit: int = 100)

Source from the content-addressed store, hash-verified

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 """

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected