  We present atomistic simulations of conductive bridging random access memory
(CBRAM) cells from first-principles combining density-functional theory and the
Non-equilibrium Green's Function formalism. Realistic device structures with an
atomic-scale filament connecting two metallic contacts have been constructed.
Their transport properties have been studied in the ballistic limit and in the
presence of electron-phonon scattering, showing good agreement with
experimental data. It has been found that the relocation of few atoms is
sufficient to change the resistance of the CBRAM by 6 orders of magnitude, that
the electron trajectories strongly depend on the filament morphology, and that
self-heating does not affect the device performance at currents below 1 $\mu$A.
