Yes, in the same way that you can authorise a real estate agent to represent you in the sale of a property, a real estate agent can represent you in the purchase of a property.
The primary purpose of retaining an agent would be for his/her negotiation skills thereby purchasing the property at the lowest possible price.
You would agree to a fee with the associated level of service that is required.
The real estate agent would not normally receive a fee from the seller.