QueryRetrieve: smart retrieve