What figure of speech is this?

Solution 1:

I think is an anaphora:

  • In writing or speech, the deliberate repetition of the first part of the sentence in order to achieve an artistic effect is known as Anaphora.

  • Anaphora, possibly the oldest literary device, has its roots in Biblical Psalms used to emphasize certain words or phrases. Gradually, Elizabethan and Romantic writers brought this device into practice. Examine the following psalm:

    • “O LORD, rebuke me not in thine anger, neither chasten me in thy hot displeasure. Have mercy upon me, O LORD; for I am weak: O LORD, heal me; for my bones are vexed.
    • My soul is also sore vexed: but thou, O LORD, how long?”

(literarydevices.net)

Solution 2:

There's a whole bunch of named figures of speech involving repetition. The specific one for repetition at the beginning of every phrase happens to be called

anaphora.