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

Method get_cube

src/memos/mem_user/user_manager.py:290–303  ·  view source on GitHub ↗

Get cube by ID. Args: cube_id (str): The cube ID. Returns: Cube: The cube object or None if not found.

(self, cube_id: str)

Source from the content-addressed store, hash-verified

288 session.close()
289
290 def get_cube(self, cube_id: str) -> Cube | None:
291 """Get cube by ID.
292
293 Args:
294 cube_id (str): The cube ID.
295
296 Returns:
297 Cube: The cube object or None if not found.
298 """
299 session = self._get_session()
300 try:
301 return session.query(Cube).filter(Cube.cube_id == cube_id).first()
302 finally:
303 session.close()
304
305 def validate_user_cube_access(self, user_id: str, cube_id: str) -> bool:
306 """Validate if a user has access to a cube.

Callers 7

register_mem_cubeMethod · 0.45
test_create_cubeMethod · 0.45
test_delete_cubeMethod · 0.45
test_timestampsMethod · 0.45

Calls 3

_get_sessionMethod · 0.95
filterMethod · 0.80
closeMethod · 0.65

Tested by 6

test_create_cubeMethod · 0.36
test_delete_cubeMethod · 0.36
test_timestampsMethod · 0.36