Agentic AI
Agentic AI
AI that autonomously plans and carries out tasks. Capable of tool use and multi-step reasoning. A major trend of 2024.
Agentic AI
AI that autonomously plans and carries out tasks. Capable of tool use and multi-step reasoning. A major trend of 2024.
Agentic AI is an autonomous AI system that goes beyond simply answering questions: it understands goals, formulates its own plans, and uses external tools to complete tasks. Its core capability is multi-step reasoning: breaking down complex tasks into subtasks, evaluating the result of each step, and deciding the next action.
AutoGPT drew widespread public attention when it appeared in 2023, and in 2024 major AI companies, including Anthropic with Claude Computer Use and OpenAI with Operator, competitively released Agentic AI features. Gartner predicts that 33% of enterprise software will include Agentic AI by 2028.
The four core components of Agentic AI are Planning (task decomposition), Tool Use (calling external APIs/tools), Memory (conversation and task records), and Reflection (evaluating and correcting results). The ReAct (Reasoning + Acting) pattern is a representative implementation approach, alternating between reasoning and acting.
In customer service, it receives a refund request and automates everything from order lookup and policy checks to processing; in software development, it analyzes a bug report, fixes the code, and even runs tests. However, at present, rather than fully autonomous operation, a Human-in-the-loop approach, in which human approval is obtained for important decisions, is recommended.
from langchain.agents import create_react_agent, AgentExecutor
from langchain_openai import ChatOpenAI
from langchain.tools import Tool
from langchain import hub
import requests
# LLM 설정
llm = ChatOpenAI(model="gpt-4", temperature=0)
# 도구 정의 (Agent가 사용할 외부 기능)
def search_web(query: str) -> str:
"""웹 검색을 수행합니다."""
# 실제로는 검색 API 호출
return f"'{query}'에 대한 검색 결과..."
def calculate(expression: str) -> str:
"""수학 계산을 수행합니다."""
try:
return str(eval(expression))
except:
return "계산 오류"
def send_email(to: str, subject: str, body: str) -> str:
"""이메일을 전송합니다."""
# 실제로는 이메일 API 호출
return f"이메일 전송 완료: {to}"
tools = [
Tool(name="WebSearch", func=search_web, description="웹 검색"),
Tool(name="Calculator", func=calculate, description="수학 계산"),
Tool(name="SendEmail", func=send_email, description="이메일 전송"),
]
# ReAct 에이전트 생성
prompt = hub.pull("hwchase17/react")
agent = create_react_agent(llm, tools, prompt)
agent_executor = AgentExecutor(
agent=agent,
tools=tools,
verbose=True, # 추론 과정 출력
max_iterations=10, # 무한 루프 방지
handle_parsing_errors=True
)
# 에이전트 실행 - 복잡한 작업도 자율적으로 처리
result = agent_executor.invoke({
"input": "2024년 AI 트렌드를 검색하고, 주요 키워드 3개를 정리해서 team@company.com으로 보내줘"
})
print(result["output"])
"If we upgrade a simple chatbot to Agentic AI, we can raise the customer inquiry resolution rate to 80%. When a refund request comes in, everything from order DB lookup and policy checks to processing is automated. However, we need to set up guardrails so that human approval is required for amounts of 500,000 won or more."
"Please explain the difference between Agentic AI and a conventional LLM. A conventional LLM finishes with a single response, but Agentic AI repeats multiple steps of reasoning and action until the goal is achieved. It is implemented with the ReAct pattern, and tool use and memory management are the key."
"We shouldn't give Agentic AI unlimited permissions. We need to set a Rate Limit for each Tool, set a cost cap, and make Human Approval mandatory for sensitive operations. If it runs wrong even once, the API costs alone could reach millions of won."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
If an Agent fails to achieve its goal, it may keep trying indefinitely. Be sure to set max_iterations and put a cap on API call costs. Real-time cost monitoring is essential in production.
Granting an Agent excessive permissions can cause unintended system changes. Apply the principle of least privilege, and be sure to implement Human-in-the-loop for sensitive operations (deletion, payment, etc.).
An LLM may call a nonexistent tool or pass incorrect parameters. Verify the results of tool calls, and implement a graceful fallback in case of failure.