Successful knowledge generalization requires integrating overlapping experiences into flexible memory representations that support inference beyond direct experience. Although context is known to influence memory retrieval, less is known about how context during learning shapes the integration of overlapping associations. Across two experiments using an associative inference paradigm, we examined whether music functions as a contextual scaffold that supports both direct memory and generalization, and whether these two outcomes rely on the same or different mechanisms. In Experiment 1, participants learned overlapping animal-scene associations with background music or in silence and were tested with silence or music either reinstated or removed. Results showed a clear dissociation. For direct associations, only the Music-On condition (music at both encoding and retrieval) exceeded silence, indicating that reinstating the specific encoding context supports episodic retrieval. For generalization, both Music-On and Music-Off conditions outperformed silence and did not differ from each other, indicating that the benefit was established during encoding and persisted regardless of whether music was present at retrieval. Experiment 2 replicated and extended this pattern by replacing the Music-Off condition with an incongruent-music-at-retrieval condition. For direct associations, incongruent music produced no benefit over silence, ruling out generic music-at-retrieval accounts and suggesting that specific context reinstatement drives episodic retrieval. For generalization, both congruent and incongruent music conditions again exceeded the control. Together, these findings suggest that musical context enhances associative memory via two mechanisms: a specific episodic retrieval cue for directly learned associations, and an encoding-phase scaffold promoting integrated memory structures that support later inference.