Building a non-Markovian coarse-grained model