The proposed OntoQuery system in the m-commerce agent framework investigates new methodologies for efficient query formation for product databases. It also forms new methodologies for effective information retrieval. The query formation approach implemented takes advantage of the tree pathway structure in ontology, as well as keywords, to form queries visually and efficiently. The proposed information retrieval system uses genetic algorithms, and is computationally more effective than iterative methods such as relevance feedback. Synonyms are used to mutate earlier queries. Mutation is used together with query optimization techniques like query restructuring by logical terms and numerical constraints replacement. The fitness function of the genetic algorithm is defined by three elements: (1) number of documents retrieved, (2) quality of documents, and (3) correlation of queries. The number and quality of documents retrieved give the basic strength of a mutated query, while query correlation accounts for mutated query ambiguities.