In this paper, we present a long term learning system for content based image retrieval over a network. Relevant feedback is used among different sessions to learn both the similarity function and the best routing for the searched category. Our system is based on mobile agents crawling the network in search of relevant images. An ant-behavior algorithm is used to learn the category dependent routing. With experiments on trecvid'05 key-frame dataset, we show that the smart association of category dependent routing and active learning leads to an improvement of the quality of the retrieval.