To help the seeking story about "beings in the aquarium".
You are right, it’s not Lem. Author is George Martin. The story is called The Sand Kings. The pseudo-intelligent insects, which should be kept in the terrarium, and which can fight, build cult structures, in fact - a whole civilization. And all this can be monitored (and indirectly controlled) by the owner of the terrarium. In "Sand Kings" it is told how the not-to-measure cruel and self-confident lover of exotics "educated" his caregivers and how it ended. A terrible story, I have to say.
I hope it helped.