Cook the spaghetti in salted water according to the instructions on the packet and drain.
Dice the tomatoes, cut the onion into rings and chop the garlic.
Heat 1 tablespoon of oil and sauté the garlic until translucent. Add the pistachios and fry for 1 minute. Add the peas, then add the stock and simmer for 5 minutes.
Chop the basil and mint.
Stir sour cream, lemon juice and mint into the pea mixture and puree. Season with salt and pepper.
Heat the remaining oil and sauté the onions until translucent. Add the tomatoes and fry for about 2 minutes. Season with salt and pepper, then sprinkle with a pinch of sugar and caramelize. Drizzle with the vinegar.
Mix the spaghetti with the tomatoes, pour the pea and mint sauce over it and sprinkle with the basil.