Preheat oven to 375 degrees F.
Add all tofu filling ingredients to a blender and pulse to combine, scraping down sides as needed. You are looking for a semi-pureed mixture with bits of basil still intact. Taste and adjust seasonings as needed.
In a 9x13-inch dish, begin laying down the sweet potatoes in a single layer, overlapping slightly. Top with one-third of the tofu ricotta mixture and spread using a spoon or spatula. Top with another layer of sweet potatoes, slightly overlapping.
Repeat until you have three total layers of tofu ricotta, and four layers of sweet potatoes. The top layer should be sweet potatoes.
Cover with foil and bake for 50 minutes. Then remove foil, increase oven heat to 400 degrees F, and bake uncovered for another 5-10 minutes to slightly brown up the top layer.
Let lasagna cool slightly before serving.
Top entire lasagna with desired amount of pesto, or reserve for individual servings.