Abtract: Characterization and modeling of complex materials by phenomenological models remains challenging due to difficulties in formulating mathematical expressions and internal state variables (ISVs) governing path-dependent behaviors. Data-driven machine learning models, such as deep neural networks and recurrent neural networks (RNNs), have become viable alternatives. However, pure black-box data-driven models mapping inputs to outputs without considering the underlying physics suffer from unstable and inaccurate generalization performance. This study proposes a machine-learned physics-informed data-driven constitutive modeling approach for path-dependent materials based on the measurable material states. The proposed data-driven constitutive model is designed with the consideration of universal thermodynamics principles, where the ISVs essential to the material path-dependency are inferred automatically from the hidden state of RNNs. For materials subjected to fracturing or strain localization, a neural network enriched Galerkin solution, called the N-Adaptive Ritz Method, for weak and strong discontinuities and for adaptive refinement without re-meshing is introduced. These unique combinations of machine learning techniques and advanced computational methods have expanded the horizon of computational mechanics and scientific computing beyond what the conventional computational methods can offer. Applications to plasticity, localization, fracture, thermal fatigue, and digital twins will be presented to demonstrate the effectiveness of these new developments for computational mechanics.