Preheat your oven to 350°F
Bring a pot of salted water to a boil and add the green beans.
Cook until bright green and just tender, about 5 minutes.
Drain the water and add the green beans to a medium size casserole dish.
Heat a medium skillet over medium heat and add the diced bacon.
Cook the bacon until crisp, about 4-5 minutes, then use a slotted spoon to remove to a paper-towel lined plate.
Drain all but 1 tablespoon of the bacon grease from the skillet and return it to the heat.
Add the shallot and cook, stirring frequently, until softened, about 2-3 minutes.
Stir in the cream cheese, heavy whipping cream, salt, and pepper.
Cook until the cheese is fully melted and smooth.
Stir the cream cheese mixture into the green beans.
Melt the butter, then stir in the almond flour until it resembles crumbs.
Sprinkle the almond flour crumbs over the green beans along with the bacon.
Bake for 20-25 minutes, or until the casserole is hot and bubbly and the almond flour crumbs are lightly browned.