1. In a bowl, combine tamarind pulp and 1/3 cup hot water. Let cool, rub pulp off seeds, and press mixture through a fine strainer into another small bowl; discard seeds.
2. In a 5- to 6-quart pan over medium heat, stir shallots with oil until golden and crisp, 3 to 6 minutes. Lift out with a slotted spoon and drain on towels.
3. Add garlic and chili paste to pan and stir until garlic is fragrant, about 10 seconds. Add broth, cover, and bring to a boil over high heat.
4. Add shrimp, pineapple, fish sauce, sugar, lime juice, and reserved tamarind pulp. Cook, uncovered, just until shrimp turns pink, 2 to 3 minutes.
5. With a slotted spoon, transfer shrimp and pineapple to wide soup bowls. Stir tomatoes, bean sprouts, basil, and rice-paddy herb into hot broth.
6. Ladle soup mixture into bowls and sprinkle with fried shallots. Add chopped chilies to taste.
For a striking presentation, use shrimp with heads; they are sold in Asian fish markets and some seafood markets. Buy 1 1/2 pounds (21 to 30 per lb.) shrimp and devein in the shells: slide a thin metal skewer through each shell, under and perpendicular to vein, then pull skewer up through shell to draw out vein;repeat in several places along shell back. Rinse shrimp and cook in shells. Tamarind pulp is found in Asian and Latino markets. Purple-tinged,Thai or anise basil and the tiny springs of cumin-scented rice paddy herb can be found in vietnamese markets.