It’s a sophisticated book sorter at the Montclair Public Library
R2D2 waits just inside the library - his “mouth” is the book drop slot. After each book slides onto a conveyer belt, an RFID reader detects the book’s library number. The RFID information is passed to other parts of the mechanism that direct the book to the appropriate bin.
The conveyer belt on the right catches the books and carries them to a left turn (at top right). Then, segments of the conveyer belt tilt to slide the book into the appropriate bin. For example, the bin on the right collects books that are shelved on the first floor, while the one on the left collects books bound for the third floor.
This view shows the “end of the line” - this bin collects all the books that were not directed to one of the other bins - this includes books that have a Hold on them, (and shouldn’t be re-shelved) or books that belong to another library in the city and must be returned to their “home”. The sign on the bin says “Holds and other items”