The authors used logistic regression to try to determine whether a subject will remember a word or not, which the classifier did better than chance, but still did pretty badly, with an AUC of 0.61. Then, when the classifier said the probability of remembering the stimulus is less than 0.5, they sent some current through some electrodes. The set of electrodes to stimulate and the current were selected in consultation with a neurologist and fixed at the start of the session. They found that stimulation in the lateral temporal cortex was associated with a significant (but just barely) increase in recall compared to no stimulation or stimulation outside of lateral temporal cortex. (But it's unclear whether this decision to look at effects in LTC vs. outside of LTC was made a priori. If it was not, and many comparisons conducted before arriving on this story, then the effect may not be statistically significant after adjusting for the comparisons.)
Beyond the question of whether the outcome was selected post hoc, the main problem with the study is that, unless I have missed it, there is no control to demonstrate that selecting the trials on which to stimulate using the classifier is better than stimulating on every trial. This control seems necessary to demonstrate that the linear classifier (which is apparently now "artificial intelligence") is in any way useful. Otherwise, this paper has little scientific value, short of possibly providing another data point regarding the effect of stimulation upon memory.
Link to paper: https://www.nature.com/articles/s41467-017-02753-0#Sec19