When we purchased the house we did not have a real estate agent, so we asked the agent who showed us the house to be our agent. This agent worked for the brokerage that was selling the house, so the same brokerage was now representing both the seller and the buyer (us). This type of arrangement is called a "Dual Agency" We could do this because although the brokerage had an agreement with the seller to act as their agent, it was another realtor within the brokerage who was the seller's agent. Each agent is supposed to work with their client's (either the buyer's or the seller's) best interests in mind.
There are pros and cons to going Dual Agency rather than getting another agent from a different brokerage to represent you. The main Pro was the fact that the brokerage gave the seller a 1% discount on the fees when the buying agent was from the same brokerage. Thus, all other things being equal, our offer should seem more attractive. The down side is that you are never sure how much information is being shared between the agents and whether or not your best interests as a buyer are really being represented by the agent. In our case, the agent was representing us only on this one offer. If the offer fell through, they would cease to be our agent. Therefore, there was an incentive for the agent to get us to buy this house over another house. If we had used an independent agent from another brokerage, that incentive would not have existed because the agent would not care so much if we bought this house or another house.
In the end, going Dual Agency worked for us. But for it to work I think you have to have a clear view in your mind of what the value of the property is to you and be prepared to walk away from the deal.