<aside> ๐ฅ
Agent์ ์ธ๊ฐ์ง ๊ตฌ์ฑ ์์
์ ๋ํด์ ๊ตฌ์ฒด์ ์ธ ์์์ ํจ๊ป ์์๋ด ๋๋ค.
</aside>
์ฌ๋ฌ๋ถ๋ค์ด ์ด๋ค ์ง์ฌ์๊ฒ โ์ปคํผ๋ฅผ ํ์โ๋ผ๊ณ ๋ช ๋ นํด๋ณธ๋ค๊ณ ์๊ฐํด๋ด ์๋ค.
๊ทธ๋ฌ๋ฉด ์ง์ฌ๋ ๋ค์ 3๋จ๊ณ๋ก ์ ๋ฌด๋ฅผ ์งํํฉ๋๋ค.
์ฌ๋ฌ๋ถ์ด ๋งํ **โ์ปคํผ๋ฅผ ํ์โ๋ผ๋ ๋ง์ ์๋ฏธ๋ฅผ ์ดํด(natural language understanding)**ํฉ๋๋ค.
์ปคํผ๋ฅผ ํ์ค๊ธฐ ์ํ ์ ์ฐจ๋ฅผ **์๊ฐ(reasoning)**ํ๊ณ **๊ณํ(planning)**ํฉ๋๋ค. ์ ์ฐจ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
์ฃผ๋ฐฉ์ ๊ฐ๋ค. โ ์ปคํผ ๋จธ์ ์ ์ด์ฉํ๋ค. โ ์ปคํผ๋ฅผ ๋ด๋ฆฐ๋ค. โ ์ปคํผ๋ฅผ ๊ฐ์ ธ์จ๋ค.
์ค์ ๋ก ๊ทธ **ํ๋(Action)**์ **์ํ(Execute)**ํฉ๋๋ค. ์ฌ๊ธฐ์ ์ฌ์ฉํ๋ **๋๊ตฌ(tool)**์ ์ปคํผ ๋จธ์ ์ ๋๋ค. ๋คํํ๋ ์ฃผ๋ฐฉ์ ์ปคํผ ๋จธ์ ์ด ์๋ **ํ๊ฒฝ(environment)**์ด๋ผ์ ์ปคํผ๋ฅผ ํ์ฌ ์ ์์์ต๋๋ค.
์ด ๋จ๊ณ๋ฅผ ๊ฑฐ์ณ์ ์ง์ฌ๋ ์ฌ๋ฌ๋ถ์๊ฒ ์ปคํผ๋ฅผ ๊ฐ์ ธ์์ต๋๋ค.
๋น์ฐํ ์ปคํผ๊ฐ ์ข๋ ๋ง์์ด์ง๊ธฐ ์ํ ๋จ๊ณ๋ ํฌํจ๋์ด ์์ ๊ฒ๋๋ค. (์ถ์ฒ : https://youtu.be/84zkJa9xIVA?si=dEat8hLi3GTaXtrm )
์ด๋ฌํ โ์ ๋ฌด ํ๋ก์ธ์ค(workflow)๋ฅผ AI๊ฐ ์์์ ํ๋ค๋ ๊ฒโ์ด์ผ ๋ง๋ก Agent์ ํต์ฌ ๊ฐ๋ ์ ๋๋ค.
์ข๋ ๋ช ํํ Agent์ ์ ์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
Agent๋ AI ๋ชจ๋ธ์ ํ์ฉํ์ฌ ํ๊ฒฝ๊ณผ ์ํธ์์ฉํ๊ณ , ์ฌ์ฉ์๊ฐ ์ ์ํ ๋ชฉํ๋ฅผ ๋ฌ์ฑํ๋ ์์คํ ์ ๋๋ค. ์ด๋ ์ถ๋ก , ๊ณํ, ๊ทธ๋ฆฌ๊ณ ํ๋ ์คํ(์ฃผ๋ก ์ธ๋ถ ๋๊ตฌ๋ฅผ ํตํด ์ํ๋จ)์ ๊ฒฐํฉํ์ฌ ์ฃผ์ด์ง ์์ ์ ์ํํฉ๋๋ค.
An Agent is a system that leverages an AI model to interact with its environment in order to achieve a user-defined objective. It combines reasoning, planning, and the execution of actions (often via external tools) to fulfill tasks.
๊ทธ๋ฆฌ๊ณ Agent๋ 2๊ฐ์ ํต์ฌ ํํธ๋ก ๋๋ฉ๋๋ค.
๊ฐ์ฅ ์ผ๋ฐ์ ์ธ AI ๋ชจ๋ธ์ LLM ๋ชจ๋ธ์ ๋๋ค. ์๋ฅผ ๋ค์ด, OpenAI ์ GPT4o๋ Meta์ Llama ๊ฐ์ ๋๊ท๋ชจ์ text ๋ฐ์ดํฐ๋ฅผ ํ์ตํ ์ธ์ด ๋ชจ๋ธ์ ๊ฐ์ฅ ๋๋ฆฌ ์ฐ๊ณ ์์ต๋๋ค.
LLM ๋ชจ๋ธ์ ์ ๋ ฅ์ผ๋ก text๋ง ๋ฐ์ต๋๋ค.
์ด ๊ฒฝ์ฐ์๋ ์ด๋ป๊ฒ ๋๊ตฌ(tools)๋ฅผ ์ ๋ ฅ์ ๋ฐ์ ์ ์์๊น์?
์ ๋ต์ functionality (tools a.k.a. function call)๋ผ๊ณ ๋ถ๋ฅด๋ ๊ฒ์ ์ฌ์ฉํฉ๋๋ค.
์๋ฅผ ๋ค์ด, Chat-GPT์ ์ด๋ฏธ์ง๋ฅผ ์์ฑํด๋ฌ๋ผ๊ณ ํ๋ฉด ์ด๋ฏธ์ง๋ฅผ ์์ฑํด์ค๋๋ค. ์ด๊ฒ์ ์ด๋ฏธ์ง๋ฅผ ์์ฑํ๋ ์ด๋ค ์ธ๋ถ์ ํด์ ํ์ฉํ์ฌ ์ด๋ฏธ์ง๋ฅผ ์์ฑํ๊ณ ์ฌ๋ฌ๋ถ๋ค์๊ฒ ๊ทธ ์ด๋ฏธ์ง๋ฅผ ์ ๋ฌํด์ฃผ๋ ์ญํ ์ ํฉ๋๋ค.
์ถ์ฒ : Agents Course
AI Agent๋ tool์ ํตํด์ action์ ์ํํ๋ task๋ฅผ ํ ์ ์์ต๋๋ค.
์๋ฅผ ๋ค์ด, ๋ด ์ปดํจํฐ์์ Siri์ ๊ฐ์ ๊ฐ์ธ ๋น์ ์ญํ ์ ํ๋ Agent๋ฅผ ๋ง๋ ๋ค๊ณ ๊ฐ์ ํด๋ด ์๋ค. ๋ด๊ฐ Agent์๊ฒ โ์ค๋ ํ์๋ฅผ ์ฐ๊ธฐํ ์ ์๋์ง ๋งค๋์ ์๊ฒ ์ด๋ฉ์ผ์ ๋ณด๋ด์ค.โ ๋ผ๊ณ ์์ฒญํ๋ฉด, Agent๊ฐ ์ด๋ฉ์ผ์ ๋ณด๋ผ ์ ์๋๋ก ํด๋น ๊ธฐ๋ฅ์ ์ํํ๋ ์ฝ๋๋ฅผ ์ ๊ณตํ ์ ์์ต๋๋ค.
์ด ์ฝ๋๋ ์**์ด์ ํธ๊ฐ ์ด๋ฉ์ผ์ ๋ณด๋ผ ๋๋ง๋ค ์ฌ์ฉํ ์ ์๋ ์๋ก์ด ๋๊ตฌ(Tool)**๊ฐ ๋ฉ๋๋ค. ์ด ๊ธฐ๋ฅ์ Python ์ฝ๋๋ก ์์ฑํ๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
def send_message_to(recipient, message):
"""๋ฐ๋ ์ฌ๋์๊ฒ ์ด๋ฉ์ผ์ ๋ณด๋ด๋ ๊ธฐ๋ฅ"""
...
์ดํ LLM์ ํ์ํ ๋, ์ด ๋๊ตฌ๋ฅผ ์คํํ๋ ์ฝ๋๋ฅผ ์์ฑํ์ฌ, ์์ฒญ๋ ์์ ์ ์ํํ ์ ์์ต๋๋ค.
send_message_to("Manager", "Can we postpone today's meeting?")
๋ฐ๋ผ์ ๋๊ตฌ(tools)๋ฅผ ์ค๊ณํ๋ ์์ ์ ๋งค์ฐ ์ค์ํ๋ฉฐ, ๊ทธ๊ฒ์ด ์ฑ๋ฅ์ ๋ฏธ์น๋ ์ํฅ์ด ๋งค์ฐ ํฝ๋๋ค.
๋ช๋ช task๋ค์ ์น ๊ฒ์๊ณผ ๊ฐ์ ๋ฒ์ฉ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ํด๊ฒฐํ ์๋ ์๊ณ , ์ผ๋ถ ์์ ๋ค์ ํน์ ๊ธฐ๋ฅ์ ๊ฐ์ถ ๋๊ตฌ๊ฐ ํ์ํ ์ ์์ต๋๋ค.
Action์ tool๊ณผ ๋งค์นญ๋์ง ์์ต๋๋ค. ํ๋์ ์ก์ ์ ์ฌ๋ฌ ํด๋ค์ ์ฌ์ฉํ ์ ์์ต๋๋ค. Note thatย Actions are not the same as Tools. An Action, for instance, can involve the use of multiple Tools to complete.
Agent๊ฐ ํ๊ฒฝ๊ณผ ์ํธ์์ฉํ ์ ์๋๋ก ํ๋ค๋ฉด ๊ธฐ์ ๊ณผ ๊ฐ์ธ์ด ์ค์ ์ํ์์ ํ์ฉํ ์ ์๋ ๊ธฐ๋ฅ์ ์ ๊ณตํ ์ ์์ต๋๋ค. ๊ฐ์ธ ๋น์, ๊ณ ๊ฐ ์๋ ์ฑ๋ด, ๊ฒ์ ๋ด์์ NPC ๋ฑ๊ณผ ๊ฐ์ ๊ฒ์ผ๋ก ํ์ฉํ ์ ์์ต๋๋ค.
์์ฝํ์๋ฉด, Agent๋ AI ๋ชจ๋ธ์ ํต์ฌ reasoning ์์ง์ผ๋ก ํ์ฉํ๋ ์์คํ ์ ๋๋ค. AI ๋ชจ๋ธ์ ๋ค์๊ณผ ๊ฐ์ ์์ ์ ์ํํฉ๋๋ค.
์ถ๊ฐ๋ก https://huggingface.co/learn/agents-course/unit1/quiz1์ ๋ค์ด๊ฐ์ Quiz๋ฅผ ํ์ด๋ณด๋ ๊ฒ๋ ์ถ์ฒ๋๋ฆฝ๋๋ค! ์์ ๋ด์ฉ์ ์ดํดํ์ จ๋ค๋ฉด 3๋ถ๋ ์๊ฑธ๋ฆฝ๋๋ค!
โฌ ๏ธย ์ด์ ํ์ด์ง
โก๏ธย ๋ค์ ํ์ด์ง
https://huggingface.co/learn/agents-course/en/unit1/what-are-agents
https://youtu.be/84zkJa9xIVA?si=dEat8hLi3GTaXtrm
<aside>
1.4. Messages and Special Tokens
1.6. Understanding AI Agents through the Thought-Action-Observation Cycle
1.7. Thought, Internal Reasoning and the Re-Act Approach
1.8. Actions: Enabling the Agent to Engage with Its Environment
1.9. Observe: Integrating Feedback to Reflect and Adapt
</aside>