MCPcopy Create free account
hub / github.com/BAI-LAB/MemoryOS / save

Method save

memoryos-pypi/long_term.py:140–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

138 return results
139
140 def save(self):
141 data = {
142 "user_profiles": self.user_profiles,
143 "knowledge_base": list(self.knowledge_base), # Convert deques to lists for JSON serialization
144 "assistant_knowledge": list(self.assistant_knowledge)
145 }
146 try:
147 with open(self.file_path, "w", encoding="utf-8") as f:
148 json.dump(data, f, ensure_ascii=False, indent=2)
149 except IOError as e:
150 print(f"Error saving LongTermMemory to {self.file_path}: {e}")
151
152 def load(self):
153 try:

Callers 2

update_user_profileMethod · 0.95
add_knowledge_entryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected