First, soak the raw cashews in boiling hot water for ten minutes.
While the cashews are soaking, slice the onion and shallots into wedges.
Add the onion, shallot, and olive oil to a skillet. Begin sautéing on high heat.
When the onions and shallots have softened, about 3-5 minutes, reduce heat to medium low and add the butter and sugar. Continuously stir and brown the caramelized onions and shallots in the skillet. Stir frequently so that it doesn't burn. It will take about 10-15 more minutes.
Preheat the oven to 425.
Roughly chop the spinach and artichoke hearts and place them in a pie pan.
Add the caramelized onions and shallots to the pie dish and mix until incorporated with the spinach and artichoke hearts.
Drain the cashews and add them to a blender. Also add the milk, lemon juice, garlic cloves, nutritional yeast, salt and pepper, and onion powder. Blend until creamy and smooth.
Pour the cashew cheese over the spinach and artichoke hearts. Do not mix.
Bake for 20-25 minutes until golden brown and bubbling.