Delete one of the double documents

I’ve got problem with documents (in the same view) in my database that looks quite similar but doesn’t have the same Unique Doc.ID and I just want to keep the most recent one. Therefore I’m thinking of a way to delete just the old ones. Both the documents also have the same key value.

Maybe it’s possible to solve this with an agent!?