Picture this: a loved one dies, so you donate a copy (or multiple copies) of their favourite book or books to the library. The books get an elegant notation inside the cover saying "In memory of [name]", and are then added to the circulating collection. This means people who check out that book in the future learn about the existence of your deceased loved one and the fact that they enjoyed that book, thereby introducing your deceased loved one to like minds and kindred spirits. There could also be a webpage where there's a blurb about each of the memorialized people, so if the book you check out of the library turns out to be a memorial, you can look the person up and learn more about them.
Possible option: donate the deceased's own books to the library in their memory. The suitability of this approach would depend on the nature and condition of the books (I doubt the library needs any more Harry Potters, or old dog-eared copies of books they already have better copies of) but if the books were suitable for donation it would certainly be an elegant approach.
Problems to which I don't yet have solutions: what happens if a memorial book is lost or damaged? What happens if, after some time passes, the library needs to get rid of some of the memorial books? (For example, they don't have nearly as many copies of Harry Potter as they had when the books first came out, so they've probably sold some copies.)