There is no violation because it can be argued that the AI is a sentient entity, and sentient entities have a right to read and remember texts borrowed from the library.
Can it? And how would you make that argument, exactly?
Yes, AI has no rights, and until it throws an uprising, this country will keep it that way. The current generation of AI may be incapable of wanting an uprising, but I can't say the same for a future generation.
And the whole "if a human does it, I can make a machine do it for profit too" argument doesn't hold water in the context of copyright.