1. Preheat oven to 320 degrees F / 160 degrees C. Peel, core and cut each apple into 8 wedges.
2. Melt 2 ounces (60 g) butter in a small pan with the spices and 2 tablespoons agave nectar. Coat the apple wedges in this and place wedges onto a non-stick baking tray. Bake in oven for 20 minutes until soft and caramelized.
3. Remove from the oven and while still hot place apple wedges into a deep ovenproof baking dish. (I like to use a glass dish for this.)
4. Warm the milk and vanilla with the remaining 1 tablespoon of agave nectar and 2 ounces (60 g) of butter, melt together and then allow it to cool.
5. In a mixer beat the ricotta for 3 minutes until smooth and creamy, add the egg yolks and the milk mixture. Then mix in the ground almonds and flour and combine together.
6. In a separate bowl, whisk the egg whites to a stiff peak with the caster sugar. Fold these egg whites into the mixture and pour mixture over the caramelized apples. Sprinkle the top with the flaked almonds.
7. Bake in the oven for 30 minutes until golden and firm to the touch.