許多研究利用agent來組合Web Service,讓使用者應用service時更加便利。但是對於大量的web services,使用agent組合時須針對每一個service撰寫程式碼,也無法掌握執行狀況。本文提出Behavior Ontology,使開發者以宣告的方式自動動態產生agent行為,並透過state ontology來追蹤行為狀況,當行為發生錯誤,我們的semantic agent根據user profile與state產生另一對應的行為,以完成使用者需求。 Quite a few researches use agent to conveniently composite web services for users. However, most of them must write agent code for each of the services in large quantity. Further, they cannot trace state of executing an agent behavior. In this thesis, we propose a behavior ontology, in which an agent behavior can be automatically and dynamically generated in a declarative manner. Further, the execution state of the agent behavior can be traced by using the state ontology. When an error of the behavior occurs, our semantic agent generates another agent behavior according to the user profile and the execution state to complete user’s request.