courses
에이전틱 AI 애플리케이션을 만드는 일은 몇 년 전보다 훨씬 쉬워졌습니다. 이제는 에이전트 루프, 도구 통합, 메모리, 검색, 오케스트레이션을 처음부터 직접 구현하는 대신, 이러한 구성 요소 대부분을 제공하는 Python 프레임워크를 활용할 수 있습니다.
이 글에서 소개하는 여러 프레임워크를 사용해 RAG 애플리케이션, 자율 에이전트, 멀티 에이전트 시스템, 배포 가능한 AI 도구를 직접 만들어 왔습니다.
유연한 에이전트 워크플로에는 LangChain, 데이터 연동 애플리케이션에는 LlamaIndex와 Haystack, 그리고 제공자 모델과의 빠른 통합이 필요할 때는 OpenAI Agents SDK나 Google ADK를 자주 사용합니다.
이들 프레임워크 중 일부는 매우 발전하여, 맞춤형 솔루션을 새로 만드는 일이 종종 불필요해졌습니다. API 키, 약간의 모델 크레딧, 그리고 적합한 프레임워크만 있으면 에이전트를 만들고, 도구나 사내 데이터에 연결하고, 테스트한 뒤 API나 사용자 인터페이스를 통해 배포할 수 있습니다.
이 글은 15개의 Python 프레임워크를 다섯 가지 범주로 나누어 비교합니다: 범용 에이전트 프레임워크, 공식 에이전트 SDK, 멀티 에이전트 오케스트레이션 프레임워크, 데이터 및 RAG 프레임워크, 경량 오픈 모델 프레임워크.
각 섹션에는 프레임워크 동작을 빠르게 이해할 수 있도록 복사해 붙여넣어 바로 테스트 가능한 짧은 Python 예제도 포함되어 있습니다.
범용 에이전트 프레임워크
이 프레임워크들은 에이전트 생성, 도구 연결, 상태 관리, 다단계 워크플로 제어를 위한 폭넓은 빌딩 블록을 제공합니다.
1. LangChain
많은 개발자에게 현대 LLM 애플리케이션 개발은 언어 모델을 외부 데이터, 도구, API, 애플리케이션 로직에 연결하도록 설계된 오픈 소스 Python 프레임워크인 LangChain에서 시작되었습니다. 웹사이트, 문서, 벡터 데이터베이스 등 다양한 데이터 소스와 OpenAI API를 함께 사용해 더 문맥 인지적인 애플리케이션을 만들기 위한, 가장 널리 채택된 프레임워크 중 하나가 되었습니다.
현재 LangChain은 RAG 시스템, 도구를 사용하는 에이전트, 워크플로, 통합, 모니터링, 평가를 포함해 종단간 에이전틱 AI 애플리케이션을 구축하는 완전한 생태계로 발전했습니다. 더 알아보려면 AI Engineering with LangChain 트랙을 살펴보세요.
다음 예시는 질문에 답하기 전에 문서 검색 도구를 사용해 관련 정보를 찾을 수 있는 간단한 LangChain 에이전트를 만듭니다.
# pip install -U langchain "langchain[openai]"
from langchain.agents import create_agent
def search_docs(query: str) -> str:
"""Search the company documentation."""
return f"Documentation found for: {query}"
agent = create_agent(
model="openai:gpt-5.5",
tools=[search_docs],
system_prompt="Use the documentation tool when needed.",
)
result = agent.invoke({
"messages": [{
"role": "user",
"content": "What is our remote-work policy?"
}]
})
print(result["messages"][-1].content)
2. LangGraph
LangChain이 에이전트와 도구를 쉽게 만들 수 있게 해준다면, LangGraph는 그 에이전트가 어떻게 동작하는지를 더 정밀하게 제어할 수 있게 해줍니다. 애플리케이션을 연결된 단계의 그래프로 구조화하여 루프, 도구 호출, 공유 상태, 인간 승인, 멀티 에이전트 워크플로를 더 쉽게 제어할 수 있습니다.
특히, 무엇을 할지 반복적으로 결정하고, 적절한 도구를 선택해 결과를 확인하며, 작업이 끝날 때까지 계속 진행해야 하는 자율 에이전트를 만들 때 유용합니다. LangGraph는 장시간 실행되는 애플리케이션을 위한 영속성, 스트리밍, 체크포인트, 복구도 지원합니다. 자세한 내용은 우리의 LangGraph 튜토리얼을 참고하세요.
다음 예시는 충분한 정보를 얻을 때까지 계산기 도구를 반복 호출할 수 있는 에이전트를 만듭니다:
# pip install -U langgraph langchain langchain-openai
from langchain.chat_models import init_chat_model
from langchain.tools import tool
from langgraph.graph import MessagesState, StateGraph, START
from langgraph.prebuilt import ToolNode, tools_condition
model = init_chat_model("openai:gpt-5.5", temperature=0)
@tool
def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b
@tool
def multiply(a: int, b: int) -> int:
"""Multiply two numbers."""
return a * b
tools = [add, multiply]
model_with_tools = model.bind_tools(tools)
def call_model(state: MessagesState):
response = model_with_tools.invoke(state["messages"])
return {"messages": [response]}
builder = StateGraph(MessagesState)
builder.add_node("agent", call_model)
builder.add_node("tools", ToolNode(tools))
builder.add_edge(START, "agent")
builder.add_conditional_edges("agent", tools_condition)
builder.add_edge("tools", "agent")
agent = builder.compile()
result = agent.invoke({
"messages": [{
"role": "user",
"content": "Add 12 and 8, then multiply the result by 3."
}]
})
print(result["messages"][-1].content)
그래프는 요청을 모델로 보내고, 필요한 도구를 실행하며, 최종 답을 생성할 때까지 모델로 되돌아가는 루프를 이룹니다.
3. Agno
Agno는 에이전트, 멀티 에이전트 팀, 구조화된 워크플로를 구축하기 위한 Python 프레임워크입니다. 또한 AgentOS를 포함해, 개발자가 API를 통해 에이전트를 노출하고, 세션과 트레이스를 저장하며, 프로덕션 애플리케이션으로 운영할 수 있게 도와줍니다. 자체 인프라에서 실행할 수 있으므로, 조직은 데이터와 보안에 대한 더 큰 통제권을 유지할 수 있습니다.
다음 예시는 응답을 만들기 전에 웹 검색을 수행할 수 있는 리서치 에이전트를 만듭니다.
# pip install -U agno ddgs openai
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
name="AI Research Assistant",
model=OpenAIResponses(id="gpt-5.5"),
tools=[DuckDuckGoTools()],
instructions="Search when needed and keep the answer concise.",
)
agent.print_response(
"Find one recent development in open-source AI and summarize it.",
stream=True,
)
에이전트는 최신 정보를 찾기 위해 검색 도구를 사용하고, 사용자에게 짧은 요약을 스트리밍합니다.
4. Pydantic AI
Pydantic AI는 Pydantic 팀이 만든, 에이전트와 생성형 AI 애플리케이션을 구축하기 위한 파이썬 네이티브 프레임워크입니다. 에이전트, 도구, 의존성, 출력이 표준 Python 함수, 타입 힌트, 데코레이터, BaseModel 클래스로 정의되기 때문에 Pydantic 모델이나 FastAPI를 사용할 때와 비슷한 느낌을 줍니다. 이후 Pydantic 검증을 사용해 도구 인자와 모델 출력을 구조화하고 신뢰할 수 있게 유지합니다.
프레임워크를 더 알아보려면 Pydantic AI 튜토리얼을 추천합니다.
다음 예시는 Pydantic 모델로 검증된 글 기획안을 반환하는 에이전트를 만듭니다.
# pip install -U pydantic-ai
from pydantic import BaseModel, Field
from pydantic_ai import Agent
class ArticlePlan(BaseModel):
title: str
key_points: list[str]
reading_time_minutes: int = Field(ge=1)
agent = Agent(
"openai:gpt-5.6-sol",
output_type=ArticlePlan,
instructions="Create concise article plans for technical readers.",
)
result = agent.run_sync(
"Create a short article plan about building AI agents in Python."
)
print(result.output)
에이전트는 ArticlePlan 객체를 생성하고, 반환하기 전에 모든 필드가 요구되는 Python 타입과 규칙을 충족하는지 검증합니다.
공식 에이전트 SDK
공식 에이전트 SDK는 AI 제공사가 유지 관리하며, 자사 모델, API, 도구, 배포 시스템, 관측 플랫폼과의 통합이 대개 가장 간단합니다.
5. OpenAI Agents SDK
OpenAI Agents SDK는 단일 또는 멀티 에이전트 애플리케이션을 구축하기 위한 경량 파이썬 우선 프레임워크입니다. 과도한 추상화를 추가하지 않으면서, 내장 에이전트 루프, 함수형 도구, 핸드오프, 가드레일, 세션, 인간 승인, 트레이싱을 제공합니다.
OpenAI Agents SDK는 단순하고 통합이 빠르며 이해하기 쉬워서 아주 즐겨 사용합니다. 큰 문제 없이 많은 애플리케이션을 이 SDK로 만들었습니다. 또한 실행 내역을 OpenAI 대시보드에서 확인할 수 있는 트레이스를 자동으로 생성하여, 모델 응답, 도구 호출, 핸드오프, 전체 실행 흐름을 쉽게 점검할 수 있습니다.
다음 예시는 놀라운 역사적 사실을 가져오기 위해 Python 함수를 호출할 수 있는 역사 에이전트를 만듭니다.
# pip install openai-agents
import asyncio
from agents import Agent, Runner, function_tool
@function_tool
def history_fun_fact() -> str:
"""Return a surprising historical fact."""
return "The first computer programmer, Ada Lovelace, lived in the 1800s."
agent = Agent(
name="History Assistant",
instructions=(
"Answer history questions clearly and briefly. "
"Use history_fun_fact when it is helpful."
),
tools=[history_fun_fact],
)
async def main():
result = await Runner.run(
agent,
"Tell me something surprising about the history of computing.",
)
print(result.final_output)
if __name__ == "__main__":
asyncio.run(main())
SDK는 에이전트를 실행하고 필요할 때 역사 도구를 호출해 그 결과를 모델에 반환하고, 최종 응답을 생성합니다. 전체 실행은 트레이스 뷰어를 통해 확인할 수 있습니다.
7. Google Agent Development Kit
Google의 Agent Development Kit(ADK)는 단일 에이전트, 도구를 사용하는 어시스턴트, 그래프 워크플로, 멀티 에이전트 시스템을 구축·평가·배포하기 위한 오픈 소스 프레임워크입니다. Gemini 모델과 특히 잘 작동하며, 다른 모델 제공사도 지원합니다.
ADK는 단순하고 Gemini와 자연스럽게 연동되어 제가 가장 좋아하는 프레임워크 중 하나가 되었습니다.
큰 문제 없이 여러 애플리케이션을 ADK로 만들었습니다. 통합의 용이성과 제어 및 내장 기능 측면에서는 여전히 OpenAI Agents SDK가 더 쉽고 유연하다고 느끼지만, ADK는 강력한 대안이며 특히 Gemini 기반 애플리케이션에서 경쟁력이 높습니다.
다음 예시는 행사 시작 시간을 가져오기 위해 Python 함수를 호출할 수 있는 이벤트 어시스턴트를 만듭니다.
# pip install google-adk
from google.adk.agents.llm_agent import Agent
def get_event_time(city: str) -> dict:
"""Return the event starting time for a city."""
return {
"status": "success",
"city": city,
"time": "6:00 PM",
}
root_agent = Agent(
model="gemini-flash-latest",
name="event_assistant",
description="Provides information about events in different cities.",
instruction=(
"Answer event questions clearly. "
"Use the get_event_time tool when the starting time is requested."
),
tools=[get_event_time],
)
에이전트는 특정 도시의 행사 시간을 조회해야 할 때마다 이 함수를 도구로 사용합니다.
8. Claude Agent SDK
Claude Agent SDK는 Claude Code를 구동하는 동일한 에이전트 루프, 도구, 컨텍스트 관리를 활용해 자율 에이전트를 구축할 수 있는 Anthropic의 Python 및 TypeScript 프레임워크입니다. 파일 읽기, 코드 편집, 명령 실행, MCP 도구 연결, 장시간 작업을 수행해야 하는 에이전트에 특히 유용합니다.
Anthropic, OpenAI, Google은 자사 모델을 각자의 에이전트 프레임워크와 긴밀하게 통합해 도구, 세션, 트레이싱 등 고급 기능을 빠르게 설정할 수 있게 합니다.
다만 Claude Agent SDK는 임의의 오픈 소스나 로컬 호스팅 모델이 아닌, Claude에 특화되어 설계되었습니다. 자세한 내용은 우리의 Claude Agent SDK 튜토리얼에서 확인할 수 있습니다.
다음 예시는 Python 파일을 검토하고 버그를 식별·자동 수정하는 코딩 에이전트를 만듭니다.
# pip install claude-agent-sdk
import asyncio
from claude_agent_sdk import (
AssistantMessage,
ClaudeAgentOptions,
ResultMessage,
query,
)
async def main():
async for message in query(
prompt="Review app.py for errors that could cause crashes and fix them.",
options=ClaudeAgentOptions(
allowed_tools=["Read", "Edit", "Glob"],
permission_mode="acceptEdits",
),
):
if isinstance(message, AssistantMessage):
for block in message.content:
if hasattr(block, "text"):
print(block.text)
elif hasattr(block, "name"):
print(f"Tool used: {block.name}")
elif isinstance(message, ResultMessage):
print(f"Completed: {message.subtype}")
if __name__ == "__main__":
asyncio.run(main())
SDK는 에이전트 루프를 실행하는 동안 Claude가 파일을 읽고, 필요한 도구를 선택하며, 코드를 수정하고, 작업이 완료될 때까지 진행 상황을 스트리밍합니다.
멀티 에이전트 오케스트레이션 프레임워크
멀티 에이전트 프레임워크는 여러 특화 에이전트를 조정합니다. 각 에이전트는 더 큰 워크플로의 특정 역할, 목표, 도구 세트, 단계에 배정됩니다.
9. CrewAI
CrewAI는 멀티 에이전트 팀을 구축하기 위한 인기 있는 Python 프레임워크입니다. 개발자는 서로 다른 역할, 목표, 작업을 가진 에이전트를 만든 뒤, 이들을 자율적으로 협업하는 하나의 크루로 결합할 수 있습니다. 작업은 순차적으로 실행되거나, 관리자가 가장 적합한 에이전트에게 일을 조율·위임하는 계층적 프로세스로도 수행될 수 있습니다.
다음 Python 예시는 함께 일해 짧은 보고서를 작성하는 연구원과 작가를 만듭니다.
# pip install crewai
# Set OPENAI_API_KEY before running
from crewai import Agent, Crew, Process, Task
researcher = Agent(
role="AI Researcher",
goal="Find the key facts about {topic}",
backstory="You research technical topics carefully.",
)
writer = Agent(
role="Technical Writer",
goal="Turn research into a clear summary",
backstory="You explain complex topics simply.",
)
research_task = Task(
description="Research {topic} and identify three key findings.",
expected_output="Three concise findings.",
agent=researcher,
)
writing_task = Task(
description="Write a short summary using the research findings.",
expected_output="A clear one-paragraph report.",
agent=writer,
context=[research_task],
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
process=Process.sequential,
)
result = crew.kickoff(inputs={"topic": "agentic AI"})
print(result.raw)
연구원이 첫 번째 작업을 완료하면, 작가가 그 출력물을 컨텍스트로 사용해 최종 보고서를 작성합니다.
10. MetaGPT
MetaGPT는 제품 관리자, 아키텍트, 프로젝트 매니저, 엔지니어 등 특화 에이전트를 활용해 소프트웨어 회사를 모델링하는 멀티 에이전트 프레임워크입니다. 이 에이전트들은 구조화된 운영 절차를 따르며, 짧은 요구사항을 계획, 기술 설계, 문서, 작동하는 코드로 변환합니다.
다음 예시는 소프트웨어 팀을 만들고, 간단한 커맨드라인 할 일 관리자를 구축하도록 요청합니다.
# pip install metagpt
# Configure a supported LLM API before running
import asyncio
from metagpt.roles import (
Architect,
Engineer,
ProductManager,
ProjectManager,
)
from metagpt.team import Team
async def startup(idea: str):
company = Team()
company.hire([
ProductManager(),
Architect(),
ProjectManager(),
Engineer(),
])
company.invest(investment=3.0)
company.run_project(idea=idea)
await company.run(n_round=5)
if __name__ == "__main__":
asyncio.run(
startup("Build a simple command-line task manager")
)
에이전트들은 요구사항을 각자의 역할에 맞게 분담하고, 협업하여 소프트웨어 프로젝트를 계획하고 개발합니다.
11. AgentScope
AgentScope는 제어 가능하고 관측 가능한 에이전트·멀티 에이전트 애플리케이션을 구축하는 Python 프레임워크입니다. 준비된 에이전트, 도구, 메모리, 메시지 라우팅, 스트리밍, 병렬 도구 호출, 워크플로, 트레이싱, 인간 개입을 제공합니다. AgentScope Studio를 사용해 에이전트 실행을 점검·시각화할 수도 있습니다.
다음 예시는 계산을 완료하기 위해 Python 코드를 작성하고 실행할 수 있는 ReAct 에이전트를 만듭니다.
# pip install agentscope
# Set DASHSCOPE_API_KEY before running
import asyncio
import os
from agentscope.agent import ReActAgent
from agentscope.formatter import DashScopeChatFormatter
from agentscope.memory import InMemoryMemory
from agentscope.message import Msg
from agentscope.model import DashScopeChatModel
from agentscope.tool import Toolkit, execute_python_code
async def main():
toolkit = Toolkit()
toolkit.register_tool_function(execute_python_code)
agent = ReActAgent(
name="Nova",
sys_prompt="You are a helpful Python assistant named Nova.",
model=DashScopeChatModel(
model_name="qwen-max",
api_key=os.environ["DASHSCOPE_API_KEY"],
stream=True,
),
formatter=DashScopeChatFormatter(),
toolkit=toolkit,
memory=InMemoryMemory(),
)
await agent(
Msg(
name="user",
content="Use Python to calculate the sum of numbers from 1 to 100.",
role="user",
)
)
if __name__ == "__main__":
asyncio.run(main())
에이전트는 Python 실행 도구 호출을 결정하고, 생성된 코드를 실행한 뒤, 그 결과를 사용해 사용자에게 답합니다.
12. CAMEL-AI
CAMEL-AI는 에이전트, 멀티 에이전트 사회, 롤플레잉 시뮬레이션을 구축하기 위한 오픈 소스 Python 프레임워크입니다. 연구 성격이 강하며, 에이전트 협업, 도구, 메모리, 검색, 데이터 생성, 세계 시뮬레이션을 위한 구성 요소를 제공합니다. Ollama, vLLM, SGLang 등 플랫폼을 통해 클라우드 모델과 로컬 호스팅 모델도 지원합니다.
다음 예시는 질문에 답하기 전에 웹을 검색할 수 있는 에이전트를 만듭니다.
# pip install "camel-ai[web_tools]"
# Set OPENAI_API_KEY before running
from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.toolkits import SearchToolkit
from camel.types import ModelPlatformType, ModelType
model = ModelFactory.create(
model_platform=ModelPlatformType.OPENAI,
model_type=ModelType.GPT_5_5,
model_config_dict={"temperature": 0.0},
)
agent = ChatAgent(
system_message="You are a helpful AI research assistant.",
model=model,
tools=[SearchToolkit().search_duckduckgo],
)
response = agent.step(
"What are the main uses of multi-agent AI systems?"
)
print(response.msgs[0].content)
에이전트는 최신 정보가 필요할 때 DuckDuckGo 검색을 사용한 뒤 최종 답을 반환합니다.
데이터 및 RAG 에이전트 프레임워크
이 프레임워크들은 LLM과 에이전트를 문서, 데이터베이스, API, 기타 사내 데이터 소스에 연결하여, 응답 전에 관련 문맥을 검색할 수 있게 도와줍니다.
13. LlamaIndex
LlamaIndex는 사내 또는 도메인 특화 데이터 위에서 문맥 인지형 애플리케이션을 구축하기 위한 Python 프레임워크입니다. 커넥터, 인덱스, 리트리버, 쿼리 엔진, 에이전트, 워크플로를 제공하여 RAG, 엔터프라이즈 검색, 문서 어시스턴트 같은 애플리케이션을 만들 수 있습니다.
RAG 애플리케이션을 만들기 시작했을 때 LlamaIndex는 제가 가장 좋아하던 프레임워크 중 하나였습니다. 데이터 로딩, 인덱싱, 쿼리 처리가 매우 쉬웠고, 동일한 애플리케이션을 LangChain으로 만드는 것보다 코드가 더 간단하고 짧은 경우가 많았습니다. 더 알아보려면 LlamaIndex 과정을 수강해 보세요.
다음 예시는 폴더에서 문서를 로드해 검색 가능한 인덱스를 만들고, 검색된 컨텍스트를 사용해 질문에 답합니다.
# pip install llama-index
# Set OPENAI_API_KEY before running
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
documents = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query(
"What are the main findings in these documents?"
)
print(response)
LlamaIndex는 data 폴더의 파일을 인덱싱하고, 답을 생성하기 전에 관련 정보를 검색합니다.
14. Haystack
Haystack은 프로덕션 준비가 된 RAG 파이프라인, 시맨틱 검색 시스템, 에이전트, 데이터 중심 AI 애플리케이션을 구축하는 오픈 소스 Python 프레임워크입니다. 모듈식 파이프라인 구조를 통해 정보 검색, 프롬프트 구성, 모델 전송 방식에 대한 명확한 제어를 제공합니다.
큰 문제 없이 Haystack으로 RAG와 멀티 에이전트 애플리케이션을 만들어 왔습니다. 범용 프레임워크이지만, 특히 LLM을 문서, 텍스트, 검색 시스템 및 기타 데이터 소스에 연결하는 애플리케이션에 유용합니다.
다음 예시는 몇 개의 문서를 저장하고, 가장 관련도 높은 문서를 검색해 이를 사용해 질문에 답합니다.
# pip install -U haystack-ai
# Set OPENAI_API_KEY before running
from haystack import Document, Pipeline
from haystack.components.builders import ChatPromptBuilder
from haystack.components.generators.chat import (
OpenAIResponsesChatGenerator,
)
from haystack.components.retrievers import InMemoryBM25Retriever
from haystack.dataclasses import ChatMessage
from haystack.document_stores.in_memory import InMemoryDocumentStore
document_store = InMemoryDocumentStore()
document_store.write_documents([
Document(content="The London AI event starts at 6:00 PM."),
Document(content="The Berlin AI event starts at 7:00 PM."),
])
template = [
ChatMessage.from_system(
"Answer using the following documents:\n"
"{% for doc in documents %}{{ doc.content }}{% endfor %}"
),
ChatMessage.from_user("{{ question }}"),
]
pipeline = Pipeline()
pipeline.add_component(
"retriever",
InMemoryBM25Retriever(document_store),
)
pipeline.add_component(
"prompt_builder",
ChatPromptBuilder(template=template),
)
pipeline.add_component(
"llm",
OpenAIResponsesChatGenerator(model="gpt-5.5"),
)
pipeline.connect("retriever", "prompt_builder.documents")
pipeline.connect("prompt_builder", "llm")
question = "When does the London AI event start?"
result = pipeline.run({
"retriever": {"query": question},
"prompt_builder": {"question": question},
})
print(result["llm"]["replies"][0].text)
Haystack은 일치하는 문서를 검색해 프롬프트에 추가하고, GPT-5.5를 사용해 근거 있는 답을 생성합니다.
경량 및 오픈 모델 프레임워크
이 프레임워크들은 호스팅되었거나 로컬에서 실행되는 오픈 모델로 에이전트를 만들기 위한 더 단순한 추상화를 제공합니다.
15. Hugging Face smolagents
Hugging Face smolagents는 적은 양의 코드만으로 에이전트를 구축할 수 있는 경량 Python 프레임워크입니다. CodeAgent는 Python을 작성해 동작을 수행하고, ToolCallingAgent는 구조화된 도구 호출을 사용합니다. Hugging Face 모델, Inference Providers, 로컬 호스팅 오픈 소스 모델과 특히 잘 작동합니다.
다음 예시는 웹 검색 에이전트를 만들고, 연구 위임 시점을 결정하는 매니저 에이전트에 이를 맡깁니다.
# pip install -U "smolagents[toolkit]"
# Set HF_TOKEN before running
from smolagents import (
CodeAgent,
InferenceClientModel,
ToolCallingAgent,
WebSearchTool,
)
model = InferenceClientModel(
model_id="Qwen/Qwen3-Next-80B-A3B-Thinking"
)
web_agent = ToolCallingAgent(
tools=[WebSearchTool()],
model=model,
name="web_search_agent",
description="Searches the web and returns useful information.",
)
manager_agent = CodeAgent(
tools=[],
model=model,
managed_agents=[web_agent],
)
result = manager_agent.run(
"Who created Hugging Face, and when was it founded?"
)
print(result)
매니저는 최신 정보가 필요할 때를 판단해 전문 웹 에이전트에게 검색을 위임하고, 이후 최종 답을 생성합니다.
프레임워크 빠른 비교
아래 표는 각 프레임워크의 주요 강점과 가장 적합한 에이전틱 AI 애플리케이션 유형을 비교합니다.
|
Framework |
Main strength |
Choose it when |
|
LangChain |
Large integration ecosystem |
You need broad integrations, tools, and flexibility |
|
LangGraph |
Stateful graph orchestration |
You need controlled loops, durable execution, and complex workflows |
|
Agno |
Complete agent platform |
You want to build, self-host, and manage agent services |
|
Pydantic AI |
Type-safe Python development |
You need validated tools, dependencies, and structured outputs |
|
OpenAI Agents SDK |
Simple agent development and tracing |
You primarily use OpenAI models and want fast integration |
|
Google ADK |
Gemini-native agent development |
You use Gemini, Google Cloud, or multi-agent workflows |
|
Claude Agent SDK |
Computer, file, and command tools |
You are building coding, research, or long-running agents with Claude |
|
CrewAI |
Role-based agent teams |
Multiple specialized agents need to collaborate on a project |
|
MetaGPT |
Software-company simulation |
You want agents to plan and generate complete software projects |
|
AgentScope |
Observable and controllable agents |
You need traceable agents or multi-agent applications |
|
CAMEL-AI |
Multi-agent research and simulation |
You are studying role-playing, agent societies, or large agent systems |
|
LlamaIndex |
Data-connected and context-aware applications |
Your agents need to retrieve and reason over private documents |
|
Haystack |
Modular and transparent RAG pipelines |
You need control over retrieval, prompting, and data flow |
|
smolagents |
Lightweight open-model agents |
You want minimal abstractions, code agents, or local model support |
마무리
에이전틱 AI를 막 시작한다면, OpenAI Agents SDK, Google ADK, Claude Agent SDK 같은 공식 SDK부터 시작하겠습니다. 이들은 자체 모델과 API와 긴밀하게 작동하므로 설정이 대체로 간단합니다. API 키를 추가하고 크레딧을 충전한 뒤 바로 구축을 시작하면 됩니다.
이들 SDK는 에이전트를 만들고 도구를 연결하며 실행 중 무슨 일이 있었는지 점검하기 쉽게 해준다는 점이 마음에 듭니다. 몇 줄의 Python만으로도 유용한 에이전트나 소규모 멀티 에이전트 시스템까지 만들 수 있습니다.
더 큰 유연성이 필요할 때는 보통 LangChain이나 LangGraph를 봅니다. 많은 통합이 필요하면 LangChain이, 상태, 루프, 더 긴 워크플로를 더 잘 제어하려면 LangGraph가 유용합니다.
서로 다른 역할의 에이전트 팀에는 CrewAI가 좋은 선택입니다. RAG, 사내 문서, 데이터 연동 애플리케이션에는 LlamaIndex나 Haystack을 추천합니다.
마지막으로, 오픈 또는 로컬 모델과 가볍고 간단하게 사용하고 싶을 때는 smolagents가 좋은 선택입니다.
제 조언은, 프로젝트에 맞는 가장 단순한 프레임워크로 시작하는 것입니다. 작은 버전을 만들고 제대로 테스트한 뒤, 정말 필요할 때만 복잡성을 더하세요.
FAQs
표준 LLM 프롬프트와 비교해 AI 에이전트를 실행하는 데 얼마나 비용이 드나요?
Python 프레임워크 자체는 오픈 소스이며 무료지만, 에이전트를 실행하는 비용은 표준 LLM API 호출보다 상당히 높을 수 있습니다. 에이전트는 루프 내에서 시스템 프롬프트, 도구 설명, 이전 도구 출력, 추론 단계(예: ReAct)를 모델로 계속 보내기 때문에 토큰 사용량이 빠르게 누적됩니다. 단일 사용자 요청이 최종 답에 도달하기까지 다섯 번 또는 여섯 번의 LLM 호출을 유발할 수도 있습니다. 비용을 관리하기 위해, 개발자는 간단한 라우팅 작업에는 더 작고 저렴한 모델을 사용하고, 복잡한 추론에는 더 큰 모델을 사용하는 전략을 자주 채택합니다.
내 에이전트가 실제로 잘 작동하는지 어떻게 평가하나요?
비결정적 에이전트를 테스트하려면 표준 단위 테스트만으로는 충분하지 않습니다. 개발자는 Ragas, TruLens, DeepEval 같은 특화된 "LLM-as-a-judge" 평가 프레임워크를 사용합니다. 이 도구들은 테스트 질문 데이터셋에 대해 에이전트를 실행하고 다음과 같은 지표로 출력을 점수화합니다.
- 근거성(Groundedness): 에이전트가 환각하지 않았으며, 답이 전적으로 검색된 문맥에 기반했나요?
- 도구 선택 정확도: 해당 작업에 알맞은 도구를 선택했나요?
- 답변 관련성: 최종 응답이 실제로 사용자의 프롬프트를 다루고 있나요?
표준 RAG 파이프라인(LlamaIndex/Haystack)과 \"에이전틱\" RAG 시스템의 차이는 무엇인가요?
표준 RAG 파이프라인은 고정된 정적 경로를 따릅니다. 사용자 쿼리를 받아 벡터 데이터베이스를 검색하고, 결과를 프롬프트에 삽입한 다음, 답을 생성합니다. 한 번 실행하고 종료합니다. 에이전틱 RAG 시스템은 검색 프로세스에 대한 자율성을 LLM에 부여합니다. 에이전트는 검색이 필요한지 여부를 결정하고, 더 넓은 문맥을 수집하기 위해 서로 다른 검색 쿼리를 여러 개 생성하며, 검색된 문서가 유용한지 평가하고, 정보가 불완전하면 다시 검색을 선택한 뒤 최종적으로 사용자에게 답합니다.