A.L.I.E. 2.0, also known as the Spirit of the Commander, was an artificial intelligence that resided in a cybernetic neural implant known as the Flame. Created by neuroscientist Becca Franko, the Flame was designed to allow the AI to directly interface with a human brain and augment it. The Flame held the minds of all its previous hosts (a.k.a. the Commanders).
The Flame was central to the Grounder faith such that the Grounders were usually loyal to whoever possessed the Flame, bestowing them the title of Commander. Due to its importance, a spiritual order known as the Flamekeepers was tasked with keeping it safe. The Flame was used to pass experience and wisdom from one Commander to the next. It also enhanced its user's mind and senses.
Those who have the Flame can communicate with the consciousnesses of past commanders while they are in an unconscious state or their mind is in the Flame
Lexa was the commander who allied with and fell in love with Clarke.
Lexa's Flamekeeper, Titus, disapproved of their relationship believing Clarke made Lexa weak by convincing her to be more merciful and during an attempt to kill Clarke, shot Lexa by accident instead. Despite Clarke's desperate attempts to save her, Lexa died from her wound.
As with all of the Commanders before her, Lexa's consciousness continued to live on in the Flame upon her physical death.
Clarke used the Flame to beat the original A.L.I.E. who tried to trap humanity in a digital paradise while controlling their minds. But after Clarke decided to keep the Flame so she could see Lexa and get council from her whenever she needed to
One day Clarke meditated and summoned the “spirit” of Lexa in her mind Lexa I need to talk with you