MCPcopy Create free account
hub / github.com/MemTensor/MemOS / add

Method add

evaluation/scripts/PrefEval/pref_supermemory.py:227–238  ·  view source on GitHub ↗
(self, messages, user_id)

Source from the content-addressed store, hash-verified

225 self.client = Supermemory(api_key=os.getenv("SUPERMEMORY_API_KEY"))
226
227 def add(self, messages, user_id):
228 content = "\n".join([f"{msg['role']}: {msg['content']}" for msg in messages])
229 max_retries = 5
230 for attempt in range(max_retries):
231 try:
232 self.client.memories.add(content=content, container_tag=user_id)
233 break
234 except Exception as e:
235 if attempt < max_retries - 1:
236 time.sleep(2**attempt)
237 else:
238 raise e
239
240 def search(self, query, user_id, top_k):
241 max_retries = 10

Callers 12

add_memory_for_lineFunction · 0.45
mainFunction · 0.45
add_memory_for_lineFunction · 0.45
mainFunction · 0.45
add_memory_for_lineFunction · 0.45
mainFunction · 0.45
add_memory_for_lineFunction · 0.45
mainFunction · 0.45
add_memory_for_lineFunction · 0.45
mainFunction · 0.45
add_memory_for_lineFunction · 0.45
mainFunction · 0.45

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected