Soak the beans in plenty of water overnight the day before.
Drain the beans the next day. Peel onions and garlic and dice them finely. Heat 3 tablespoons of oil in a saucepan. Fry the onions and half the garlic for about 5 minutes. Wash the thyme, shake dry, chop and add to the onions.
Add tomatoes with juice and 1 l water. Season with pepper, bring to the boil and simmer for about 1 1⁄4 hours.
For the pistou, wash the parsley and basil, shake dry and chop the leaves finely. Mix with the rest of the garlic and 6 tablespoons of oil. Season with salt and pepper.
Clean, peel and cut the carrots into small pieces. Cook in the bean pot about 30 minutes before the end of the cooking time. Season to taste with salt and about 1 tbsp. sugar. Serve with pistou.