In a medium saucepan, combine the onion, garlic, ginger, and wine or sherry. Cover and sweat over low heat for 5 minutes. Add the cumin, cinnamon, paprika, and red pepper flakes and cook, uncovered, 1 minute longer. Add the water or chickpea cooking liquid, salt, sweet potatoes, and apricots. Bring to a boil, cover, and simmer until the sweet potatoes are just tender, about 15 minutes.
Add the chickpeas, raisins, and lemon juice. Cook, stirring occasionally, for about 5 minutes, until the chickpeas are hot. Add the sliced almonds.