Alloying metals which are not miscible at the bulk solid phase is an efficient way to diversify the function of materials attracted great interest due to their distinctive electronic, optical, catalytic, and magnetic properties compared to pure metal. But in depth understanding of the diffusion process inside the alloying materials is rather limited, especially at the atomic level. A typical example is the Ag-Bi nanoalloy. Then, periodic DFT calculations, at the GGA level, have been performed to understand the formation of Ag-Bi nanoalloys. The calculated values of segregation energy indicate that the interface between Ag and Bi plays a crucial role in the stabilization of the Ag doped with Bi atom. The strong interaction at the interface between the Bi and Ag atoms tends to produce structural changes in both surfaces, situation more accentuated in the Bi surface due to its less compact structure. The interface helps to the migration of the Bi atoms from the Ag surface to the Ag bulk, a segregation process which is very difficult to occur on a clean surface due to the high density of the Ag cubic phase. However, on clean surfaces of Bi the insertion of Ag atoms is more thermodynamically favorable with concomitant changes on the cell parameters to be capable to form a chemical bond between Ag and Bi.