A swordsman from Sendai domain, he held full mastery of Tennen Rishin-ryu. He trained alongside Kondo, Hijikata, and Okita at the Shieikan dojo in Edo, and when the Shinsengumi was formally organized in 1864 he served as vice commander and general commander. Gentle and scholarly, he was called "the Shinsengumi's strategist." In January 1865, however, he attempted to desert and was brought back from Otsu near Kyoto by Okita Soji. Under the corps regulations, desertion was punishable by death, and Yamanami was ordered to commit seppuku. On February 23, 1865, he performed seppuku at the Mibu barracks with Okita Soji serving as his second. He was thirty-three. His death is remembered as one of the most tragic episodes in Shinsengumi history.