Cook the lentils in a large pot of water until tender but not mushy, about 20-25 minutes. Drain and set aside.
Meanwhile, boil the sweet potatoes until fork-tender, about 15 minutes.
Preheat your oven to 375°F (190°C).
In a large skillet, sauté onions, carrots, and celery until softened, about 5-7 minutes.
Add garlic and tomato paste, cooking for another minute until fragrant.
Stir in the cooked lentils, vegetable broth, thyme, and rosemary. Simmer for 10 minutes until the mixture thickens.
While the filling simmers, mash the sweet potatoes with milk, butter, garlic powder, salt, and pepper until smooth.
Transfer the lentil mixture to a 9x13 baking dish, spreading it evenly.
Top with the mashed sweet potatoes, creating peaks with a fork for crispy edges.
Bake for 25-30 minutes until the top is lightly golden and the edges are bubbling.