Smart and green buildings have attracted much attention in recent years. Development of an effective negotiation model for facilitating the bi-directional energy trading between the utility grid and the building is important for enhancing the building intelligence. In this paper, a negotiation agent based on adaptive attitude bidding strategy (AABS) is proposed. A comprehensive set of factors for the integrated smart building and utility grid system is taken into account in developing the negotiation model. The AABS based negotiation agent turns out to be able to dynamically adjust its behavior in response to varying attitudes in the negotiation process. In addition, an improved particle swarm optimization-adaptive attitude bidding strategy (PSO-AABS) based negotiation agent is developed for adaptively adjusting the trader's decisions according to the opponent's behaviors. It turns out to be capable of making rational deals in bi-directional energy trading by maximizing the trader's payoffs with reduced negotiation time. The feasibility of the proposed negotiation agents is evaluated by the simulation results.