Pull up a terminal window and type in "man -k AMPLibraryAgent". Man is the built-in manual or help pages and -k means do a keyword search. So you are asking your Mac if it knows of any help pages that refer to or are called AMPLibraryAgent and you will see this:
AMPLIBRARYAGENT(8) BSD System Manager's Manual AMPLIBRARYAGENT(8)
NAME
AMPLibraryAgent -- The media library agent for Music.app and TV.app.
SYNOPSIS
AMPLibraryAgent
DESCRIPTION
AMPLibraryAgent is a per-user daemon which manages the user's media.
There are no configuration options to AMPLibraryAgent. Users should not
run AMPLibraryAgent it manually.
Mac OS X Dec 6, 2018 Mac OS X
(END)
While not super-detailed in its description it does verify that this is OK to run on your system as it is a built-in part of macOS. This is not some virus stealing all of your CPU...it is one of Apple's processes stealing all of your CPU. So feel better about it.