Soak the beans in plenty of water overnight.
Pour the beans into a sieve and let them drain. Peel onions and garlic and dice finely. Heat 4 tablespoons of oil. Fry the onions and half of the garlic for about 5 minutes. Add the beans. Add tomatoes and 1 l water. Season with pepper and 1 tablespoon thyme, bring to the boil and simmer for about 1 1⁄4 hours.
For the pistou, wash parsley and basil, shake dry, pluck leaves from the stalks and chop finely. Mix the remaining garlic, herbs and 6 tbsp. oil and season with salt and pepper.
Peel and wash the carrots, cut them in half lengthwise and cut them into thin slices. Add to the beans about 20 minutes before the end of the cooking time and cook with them. Season bean stew with salt, pepper and approx. 1 tbsp. sugar to taste. Arrange and sprinkle with pistou for each dish.