Accurate characterization of the brain microstructure using diffusion MRI (dMRI) relies on optimal (i.e. information-rich) scanning protocols. Presently, without such protocols, extensive datasets are necessary to image the intricate microarchitecture of the brain by fitting complex biophysical models to the data. This impedes the full realization of dMRI’s potential, particularly in time-constrained clinical scans. To tackle this, we introduce a novel framework based on the Cramér-Rao lower bound (CRLB) to optimize dMRI protocols for any multi-compartment biophysical models, to accurately capture features like axonal diameter index and multiple fiber orientations in a voxel. Unlike previous methods, limited in model complexity or parameter scope, our framework handles all model parameters, including water diffusivities, enhancing estimation fidelity. Leveraging automatic differentiation and parallel computing via TensorFlow, this approach systematically explores the entire parameter space for comprehensive scanning protocol optimization. By optimizing dMRI protocols, this work stands to significantly enhance biophysical modeling accuracy, thereby deepening our understanding of the brain microstructure in health and disease.