Combine the cream cheese and mozzarella cheese in a microwave safe bowl. Heat for 30 seconds at a time until melted into a dough. Stirring at each interval.
Add almond flour, baking powder, xanthan gum, dried basil, salt, garlic powder and egg to a medium bowl and mix well.
Add the cheese dough to the medium mixing. Knead the dough until it is well combined into a thick dough.
Chill the dough in the refrigerator for 30 minutes.
Melt the butter in a skillet over medium low heat while the dough is chilling.
Add the onions to the butter, and saute until softened and caramelized. Remove from heat and let cool.
Roll the chilled dough out between two pieces of parchment paper until about ¼ of an inch thick.
Preheat oven to 350 degrees and line a baking sheet with parchment paper.
Cut the rolled out dough into 8 evenly sized rectangles and fold old the edges of each rectangle up slightly.
Top each rectangle of dough with some brie, caramelized onions, and fresh thyme and rosemary.
Bake for 15 minutes and serve!