Cook the lentils according to package instructions.
In a large skillet, heat the olive oil and garlic until golden. Add the onion, celery, carrots, fennel and a pinch of salt and pepper. Cook, stirring, until softened, about 5 minutes. Stir in the chile flakes and fennel seed. Add the tomato sauce, bring to a simmer, then stir in the lentils. Season with salt and pepper to taste.
Meanwhile, bring a large pot of salted water to a boil for the pasta. Add the pasta, stirring to prevent clumps. Cook to al dente, according to package instructions, strain and return to the pot, drizzled with oil to prevent sticking.
Toss the pasta with bolognese and garnish with basil and parmesan to serve.