Intelligent agents and active databases have a number of common characteristics, the most important of which is that they both execute actions by firing rules upon events occurring provided certain conditions hold. This paper assumes that the knowledge of an intelligent agent is expressed using a set of active rules and proposes a method for optimising the rule-base of such an agent using a Genetic Algorithm. We illustrate the applicability of this method by using it to optimise the performance of a self-adaptive network. The benefits of our approach are simplified design and reduced development and maintenance times of rule-based agents in the face of dynamically evolving environments.