Minecraft wiki entry for Inventory, associated text: Villagers have 8 slots, not accessible to the player, which they use to collect various farming-related seeds and foods.
Piglins have 8 slots, not accessible to the player, which they use to collect various items.
Agents‌[Education Edition only] have 27 slots that are accessible to the player by a GUI, and can be accessed by the agent according to its programming.
Donkeys and Mules, when equipped with a chest, have 15 inventory slots accessible to the player.
Llamas, when equipped with a chest, have 3, 6, 9, 12 or 15 inventory slots, according to their Strength stat.