In this paper we propose a methodology for deriving a model of a complex system by exploiting the information extracted from Topological Data Analysis. Central to our approach is the S[B] paradigm in which a complex system is represented by a two-level model. One level, the structural S one, is derived using the newly introduced quantitative concept of Persistent Entropy. The other level, the behavioral B one, is characterized by a network of interacting computational agents described by a Higher Dimensional Automaton. The methodology yields also a representation of the evolution of the derived two-level model as a Persistent Entropy Automaton. The presented methodology is applied to a real case study, the Idiotypic Network of the mammal immune system.