Heat a small saucepan over medium-high heat and add the oil, onions, shallots, and a heavy pinch of salt, and toss to coat with the oil.
Reduce the heat to low and allow the onions and shallots to soften, then caramelize for about 15 minutes, stirring often.
Stir in brown sugar, then the tomatoes, followed by the tomato paste and vinegar. Simmer until the mixture is thick and bubbly.
Stir in the broth and reduce to a jam-like consistency over medium-low heat.
Remove from heat and set half the mixture aside. Puree the other half and fold it back into the reserved mixture.
Fold in the basil and allow to sit at room temperature for 15 minutes.
Taste and adjust seasoning with salt and black pepper, if desired.