Intelligent agent via javascript