This paper presents "Self-Chord," a peer-to-peer (P2P) system that inherits the ability of Chord-like structured systems for the construction and maintenance of an overlay of peers, but features enhanced functionalities deriving from ant-inspired algorithms, such as autonomous behavior, self-organization, and capacity to adapt to a changing environment. As opposed to the structured P2P systems deployed so far, resource indexing and placement is uncorrelated with network structure and topology, and resource keys are organized and managed by self-organizing mobile agents through simple local operations driven by probabilistic choices. Self-Chord has three main features that are particularly advantageous in Grid and Cloud Computing: 1) it is possible to give a semantic meaning to keys, which enables the execution of range queries; 2) the keys are fairly distributed over the peers, thus improving the balancing of storage responsibilities; 3) maintenance load is also limited becau...