Duos having an afterthought about a melody (5)
I believe the answer is:
pairs
'duos' is the definition.
('pair' can be a synonym of 'duo')
'an afterthought about a melody' is the wordplay.
'an afterthought' becomes 'ps' (as in a PS in a letter).
'about' indicates putting letters inside.
'a melody' becomes 'air' (air can mean a tune or melody).
'ps' enclosing 'air' is 'PAIRS'.
'having' acts as a link.
(Other definitions for pairs that I've seen before include "Duos" , "golfing matches" , "Couples" .)