Speed up/slow down AI using a float curve?

First of all, you need to have a look at any tutorial on get curve value

You don’t need a timeline, simple gate will be enough for this

When AI gets a signal that player was detected, open one gate where you gradually each frame increases its speed until maximum and then close this gate
If the AI gets lost the target opens the second node where you do the same but with speed decrement
Also, you need to close the gates in the process, if the target was lost before the maximal speed was achieved or for the opposite case

And to make gradual changes on speed value you need to use