Enhancing Peer-to-Peer Applications with Multi-agent Systems