In this work we propose a modified Chord Length Sampling (CLS) algorithm, endowed with two layers of "memory effects," aimed at solving particle transport problems in one-dimensional spatially nonhomogeneous Markov media. CLS algorithms are a family of Monte Carlo methods which account for the stochastic nature of the media by sampling on-the-fly the random interfaces between material phases during the particle propagation. The possibility for the particles to remember the last crossed interfaces increases the accuracy of these models with respect to reference solutions obtained by solving the Boltzmann equationon a large number of realizations of the Markov media. In previous investigations, CLS models with memory have been tested exclusively for spatially uniform stochastic media: in this paper we extend this class of Monte Carlo methods to the case of spatially nonhomogeneous configurations. The effectiveness and the robustness of the modified CLS are probed considering several benchmark problems with varying material cross sectionsand Markov media densities. The obtained results are a stepping stone towards a generalization to three-dimensional models.