Heat the olive oil in a large pot over medium heat. Add the chopped onions and cook for 4–5 minutes until translucent. Stir in the garlic and ginger and cook for another minute, until fragrant. This builds a flavorful base for the soup.
Sprinkle in the cumin, cinnamon, and smoked paprika. Stir to coat the onions and toast the spices briefly. Then, add the cubed sweet potatoes and sliced carrots, stirring to combine everything.
Add the vegetable broth and bring the mixture to a boil. Once boiling, reduce the heat to a gentle simmer. Cover the pot and let it cook for 25–30 minutes, or until the sweet potatoes and carrots are fork-tender.
Turn off the heat and let the soup cool slightly. Use an immersion blender to puree the soup right in the pot, or transfer it carefully in batches to a standard blender. Blend until smooth and creamy. For a chunkier soup, blend only part of it.
Stir in the coconut milk if using, then taste the soup and add salt and pepper as needed. Simmer for an additional 2–3 minutes to let the flavors meld.
Ladle the soup into bowls and garnish with fresh herbs, a drizzle of coconut milk, or a sprinkle of chili flakes if you like some heat. Serve hot with crusty bread or a simple green salad.