Mechanically guided three-dimensional (3D) assembly based on the controlled buckling of pre-designed 2D thin-film precursors provides deterministic routes to complex 3D mesostructures in diverse functional materials, with access to a broad range of material types and length scales. Existing mechanics studies on this topic mainly focus on the forward problem that aims at predicting the configurations of assembled 3D structures, especially ribbon-shaped structures, given the configuration of initial 2D precursor and loading magnitude. The inverse design problem that maps the target 3D structure onto an unknown 2D precursor in the context of a prescribed loading method is essential for practical applications, but remains a challenge. This paper proposes a systematic optimization method to solve the inverse design of ribbon-type 3D geometries assembled through the buckling-guided approach. In addition to the torsional angle of the cross section, this method introduces the non-uniform width distribution of the initial ribbon structure and the loading mode as additional design variables, which can significantly enhance the optimization accuracy for reproducing the desired 3D centroid line of the target ribbon. Extension of this method allows the inverse design of entire 3D ribbon configurations with specific geometries, taking into account both the centroid line and the torsion for the cross section. Computational and experimental studies over a variety of elaborate examples, encompassing both the single-ribbon and ribbon-framework structures, demonstrate the effectiveness and applicability of the developed method.