도우미에서 자율 에이전트로
챗봇에서 완전한 자율 에이전트에 이르는 단계별 변화와 각 단계에서 달라지는 점을 살펴봅니다.
도우미에서 자율 에이전트로은(는) CoddyKit의 무료 AI Agents 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 AI Agents 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. AI Agents 강의에는 총 4개의 강의가 포함되어 있습니다.
자율성 스펙트럼
AI 시스템은 완전히 반응적인 시스템부터 완전히 자율적인 시스템까지 연속선상에 존재합니다. 에이전트가 이 스펙트럼에서 어느 위치에 있는지 이해하면 필요한 아키텍처 구성 요소, 필요한 인간 감독의 수준, 예상해야 할 장애 유형을 결정할 수 있습니다.
1단계: 순수 챗봇
순수 챗봇은 메시지에 텍스트로 응답합니다. 현재 컨텍스트 창을 넘어서는 메모리도, 도구도, 목표도, 세상에서 행동을 수행하는 능력도 없습니다. 모든 상호작용은 상태를 유지하지 않습니다. 필요한 인간 감독 수준은 최소입니다. 텍스트만 생성할 수 있고 행동할 수 없기 때문입니다.
import anthropic
# Level 1: Pure chatbot — single turn, no memory, no tools
def pure_chatbot(user_message: str) -> str:
client = anthropic.Anthropic(api_key='YOUR_API_KEY')
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=512,
messages=[{'role': 'user', 'content': user_message}]
)
return response.content[0].text
# What it has:
# - Language understanding
# - Knowledge from training
# What it lacks:
# - Memory (no history between sessions)
# - Tools (cannot access external data)
# - Goals (no objective to pursue)
# - Proactivity (only responds, never initiates)
response = pure_chatbot('What is the capital of Australia?')
print(response)2단계: 도구 보강 에이전트
도구 보강 에이전트는 웹 검색, 데이터베이스 질의, 코드 실행, API 호출과 같은 외부 기능을 추가합니다. 최신 데이터가 필요한 질문에도 답할 수 있습니다. 메모리는 세션 내에서 유지될 수 있습니다. 필요한 인간 감독 수준은 보통입니다. 데이터를 읽을 수 있지만 행동은 일반적으로 읽기 전용이거나 위험이 낮기 때문입니다.
import anthropic
# Level 2: Tool-augmented agent
def tool_augmented_agent(user_message: str, conversation_history: list) -> str:
client = anthropic.Anthropic(api_key='YOUR_API_KEY')
tools = [
{
'name': 'search_web',
'description': 'Search the web for current information',
'input_schema': {'type': 'object',
'properties': {'query': {'type': 'string'}},
'required': ['query']}
}
]
conversation_history.append({'role': 'user', 'content': user_message})
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=1024,
tools=tools,
messages=conversation_history
)
# Handle tool use...
return response.content[-1].text if response.stop_reason == 'end_turn' else '[tool called]'
# What changed vs Level 1:
# + Tools (external data access)
# + Session memory (conversation history)
# Still lacking:
# - Persistent cross-session memory
# - Goals (still reactive)
# - Proactivity3단계: 목표 지향 에이전트
목표 지향 에이전트는 여러 단계에 걸쳐 정의된 목표를 추구하며, 도구 호출 사이에 상태를 유지합니다. 목표를 하위 작업으로 분해하는 계획 수립기가 있습니다. 필요한 인간 감독 수준은 높습니다. 실제 세계에 누적된 영향을 줄 수 있는 여러 단계의 행동을 수행하기 때문입니다.
# Level 3: Goal-directed agent
class GoalDirectedAgent:
def __init__(self, goal: str, tools: list, client):
self.goal = goal
self.tools = tools
self.client = client
self.memory = [] # persistent across steps
self.plan = self._make_plan()
def _make_plan(self) -> list:
response = self.client.messages.create(
model='claude-opus-4-5', max_tokens=512,
messages=[{'role': 'user', 'content':
f'Goal: {self.goal}\n'
'Create a numbered list of steps to achieve this goal. '
'Each step should be a single tool call or reasoning step.'
}]
)
return response.content[0].text
def step(self) -> str:
# Execute next planned step
return 'step executed'
# What changed vs Level 2:
# + Goal: has an objective to pursue
# + Planning: decomposes goal into sub-tasks
# + Persistent memory across steps
# Still lacking:
# - Self-directed (still initiated by human)
# - Self-improvement
if __name__ == '__main__':
class FakeContent:
def __init__(self, text):
self.text = text
class FakeResponse:
def __init__(self, text):
self.content = [FakeContent(text)]
class FakeMessages:
def create(self, **kwargs):
return FakeResponse('1. Search web for topic\n2. Summarize findings\n3. Draft report')
class FakeClient:
def __init__(self):
self.messages = FakeMessages()
agent = GoalDirectedAgent(goal='Write a market report', tools=[], client=FakeClient())
print('Goal:', agent.goal)
print('Plan:')
print(agent.plan)
4단계: 자기 주도 에이전트
자기 주도 에이전트는 자체적으로 하위 목표를 설정하고, 관련 이벤트가 있는지 환경을 모니터링하며, 인간의 요청 없이 행동을 시작합니다. 장기 메모리와 월드 모델을 갖추고 있으며 상황이 바뀌면 계획을 다시 세울 수 있습니다. 필요한 인간 감독 수준은 매우 높습니다. 자율적으로 행동을 시작하기 때문입니다.
import time
# Level 4: Self-directed agent (simplified sketch)
class SelfDirectedAgent:
def __init__(self, mission: str, client):
self.mission = mission
self.client = client
self.goals_queue = []
self.long_term_memory = []
self.running = False
def start(self):
self.running = True
self._generate_initial_goals()
while self.running:
self._observe_environment()
self._prioritise_goals()
if self.goals_queue:
goal = self.goals_queue.pop(0)
self._pursue_goal(goal)
time.sleep(60) # autonomous monitoring loop
def _observe_environment(self):
# Agent monitors for events without being asked
print('Observing environment...')
def _generate_initial_goals(self):
# Agent decomposes its mission into actionable goals
self.goals_queue = ['Monitor inbox', 'Check project status']
def _prioritise_goals(self):
# Agent re-orders goals based on new observations
pass
def _pursue_goal(self, goal: str):
print(f'Pursuing: {goal}')
if __name__ == '__main__':
agent = SelfDirectedAgent(mission='Manage my inbox proactively', client=None)
agent._generate_initial_goals()
print('Initial goals:', agent.goals_queue)
agent._observe_environment()
goal = agent.goals_queue.pop(0)
agent._pursue_goal(goal)
각 단계에서 달라지는 점: 메모리
자율성 수준이 높아질수록 메모리 요구 사항도 증가합니다. 1단계는 컨텍스트 창만 사용합니다(세션 메모리). 2단계에서는 지속적인 세션 기록이 추가됩니다. 3단계에서는 구조화된 작업 상태가 추가됩니다. 4단계에서는 일화적 메모리(무슨 일이 일어났는지), 의미적 메모리(에이전트가 무엇을 알고 있는지), 절차적 메모리(작업을 수행하는 방법)가 필요합니다.
MEMORY_BY_LEVEL = {
'L1_chatbot': {
'scope': 'context_window_only',
'persistence': 'none',
'implementation': 'messages list in current API call'
},
'L2_tool_augmented': {
'scope': 'session',
'persistence': 'in-memory (lost on restart)',
'implementation': 'conversation_history list'
},
'L3_goal_directed': {
'scope': 'task',
'persistence': 'persists for task duration',
'implementation': 'SQLite or Redis with task state'
},
'L4_self_directed': {
'scope': 'long_term',
'persistence': 'indefinite',
'implementation': 'vector DB (episodic) + structured DB (semantic) + prompt cache (procedural)'
}
}
for level, info in MEMORY_BY_LEVEL.items():
print(f'{level}: {info["implementation"]}')각 단계에서 달라지는 점: 계획 수립
계획 수립 요구 사항도 자율성에 따라 증가합니다. 1단계에는 계획 수립이 없습니다. 2단계에서는 한 단계의 추론을 수행할 수 있습니다. 3단계에서는 여러 단계의 계획 수립을 사용합니다(Chain of Thought, ReAct). 4단계에서는 실패 시 계획을 다시 세우는 계층적 계획 수립이 필요합니다.
PLANNING_BY_LEVEL = {
'L1': 'None — single response',
'L2': 'Single-step tool selection (which tool to call now)',
'L3': 'Multi-step plan (goal -> ordered sub-tasks -> tool calls)',
'L4': 'Hierarchical plan (mission -> goals -> tasks -> actions) + replan on failure'
}
# L3 multi-step planning example:
def plan_goal(goal: str, client) -> list:
import anthropic
response = client.messages.create(
model='claude-opus-4-5', max_tokens=512,
messages=[{'role': 'user', 'content':
f'Break this goal into 3-5 concrete steps:\nGoal: {goal}\n'
'Return JSON: {"steps": [{"step": int, "action": str, "tool": str}]}'
}]
)
import json
return json.loads(response.content[0].text)
for lvl, desc in PLANNING_BY_LEVEL.items():
print(f'{lvl}: {desc}')단계별 인간 감독 요구 사항
자율성이 높아질수록 인간 감독 메커니즘의 필요성도 커집니다. 1단계에는 거의 필요하지 않습니다. 4단계에는 승인 단계, 행동 기록, 중단 메커니즘, 이상 징후 감지를 포함한 명시적인 감독 아키텍처가 필요합니다.
OVERSIGHT_BY_LEVEL = {
'L1_chatbot': [
'None required (output only)'
],
'L2_tool_augmented': [
'Review tool permissions (read-only vs write)',
'Audit logs of tool calls'
],
'L3_goal_directed': [
'Human approval before irreversible actions',
'Plan review before execution starts',
'Progress checkpoints',
'Full audit trail'
],
'L4_self_directed': [
'Human approval before high-impact actions',
'Real-time action streaming to oversight dashboard',
'Emergency stop mechanism',
'Anomaly detection on goal drift',
'Regular review of long-term memory state',
'Corrigibility: agent must accept shutdown'
]
}
for level, requirements in OVERSIGHT_BY_LEVEL.items():
print(f'{level}:')
for req in requirements:
print(f' - {req}')능동성: 핵심적인 변화
어시스턴트에서 자율 에이전트로 전환될 때 가장 근본적으로 달라지는 점은 능동성입니다. 어시스턴트는 기다리지만 에이전트는 먼저 행동을 시작합니다. 따라서 에이전트는 환경을 모니터링하고, 관련 이벤트를 인식하고, 요청을 받지 않아도 언제 행동할지 결정해야 합니다.
# Proactive monitoring pattern
import asyncio
from datetime import datetime
class ProactiveMonitor:
def __init__(self, agent_fn, check_fn, interval_seconds: int = 60):
self.agent_fn = agent_fn
self.check_fn = check_fn
self.interval = interval_seconds
async def run(self):
print(f'Proactive monitor started, checking every {self.interval}s')
while True:
try:
events = await self.check_fn()
for event in events:
print(f'[{datetime.utcnow().isoformat()}] Event: {event}')
await self.agent_fn(event)
except Exception as e:
print(f'Monitor error: {e}')
await asyncio.sleep(self.interval)
# Example: agent monitors for new emails every 5 minutes
# and proactively drafts replies or flags urgent ones
async def example_setup():
monitor = ProactiveMonitor(
agent_fn=lambda e: print(f'Agent handling: {e}'),
check_fn=lambda: [], # replace with real inbox check
interval_seconds=300
)
# await monitor.run()
if __name__ == '__main__':
import asyncio
async def demo():
async def check_fn():
return ['New email from boss@example.com']
async def agent_fn(event):
print(f'Agent drafting reply for: {event}')
monitor = ProactiveMonitor(agent_fn=agent_fn, check_fn=check_fn, interval_seconds=1)
try:
await asyncio.wait_for(monitor.run(), timeout=0.3)
except asyncio.TimeoutError:
pass
asyncio.run(demo())
단계별 오류 복구
오류 복구 요구 사항도 단계에 따라 증가합니다. 챗봇은 사과만 합니다. 도구 에이전트는 도구 호출을 재시도합니다. 목표 에이전트는 실패한 단계를 피해 계획을 다시 세웁니다. 자기 주도 에이전트는 오류를 자율적으로 감지하고, 분류하고, 상위 단계로 전달하며, 향후 같은 실패를 피할 수 있도록 월드 모델을 업데이트합니다.
# Error recovery strategies by autonomy level
def chatbot_error_recovery(error: Exception) -> str:
return 'I\'m sorry, I encountered an error. Please try again.'
def tool_agent_error_recovery(tool_name: str, error: Exception, retries: int) -> str:
if retries < 3:
return f'Retrying {tool_name} ({retries+1}/3)'
return f'Tool {tool_name} unavailable after 3 retries, skipping'
def goal_agent_error_recovery(failed_step: dict, plan: list, client) -> list:
import anthropic, json
client_obj = anthropic.Anthropic(api_key='YOUR_API_KEY')
response = client_obj.messages.create(
model='claude-opus-4-5', max_tokens=256,
messages=[{'role': 'user', 'content':
f'Step failed: {failed_step}\nRemaining plan: {plan}\n'
'Revise the remaining plan to work around the failure. Return JSON plan.'
}]
)
return json.loads(response.content[0].text)
print('Error recovery patterns defined for each autonomy level')적절한 단계 선택
모든 사용 사례에 4단계가 필요한 것은 아닙니다. 요구 사항을 충족하는 가장 낮은 단계에서 시작하고, 필요할 때만 복잡성을 추가합니다. 자율성이 커지면 복잡성과 감독 부담, 예기치 않은 동작의 가능성도 커집니다.
def recommend_autonomy_level(requirements: dict) -> str:
needs_realtime = requirements.get('realtime_data', False)
needs_multistep = requirements.get('multi_step_tasks', False)
needs_unsupervised = requirements.get('runs_unsupervised', False)
needs_initiative = requirements.get('initiates_actions', False)
if needs_initiative and needs_unsupervised:
return 'L4_self_directed (high oversight required)'
if needs_multistep:
return 'L3_goal_directed (plan review recommended)'
if needs_realtime:
return 'L2_tool_augmented (audit logs required)'
return 'L1_chatbot (minimal oversight)'
# Examples:
print(recommend_autonomy_level({
'realtime_data': True, 'multi_step_tasks': False,
'runs_unsupervised': False, 'initiates_actions': False
}))
print(recommend_autonomy_level({
'realtime_data': True, 'multi_step_tasks': True,
'runs_unsupervised': True, 'initiates_actions': True
}))지식 확인
목표 지향 에이전트(3단계)와 자기 주도 에이전트(4단계)의 가장 근본적인 기능 차이는 무엇입니까?
복습: 어시스턴트에서 자율 에이전트로
훌륭합니다! 다음 내용을 학습하셨습니다.
- L1 챗봇: 반응형, 텍스트만 처리, 메모리 없음, 감독 불필요
- L2 도구 보강 에이전트: 세션 메모리, 도구 호출, 보통 수준의 감독
- L3 목표 지향 에이전트: 여러 단계의 계획 수립, 작업 범위 메모리, 승인 단계
- L4 자기 주도 에이전트: 능동적, 장기 메모리, 계층적 계획 수립, 높은 수준의 감독
- 경험 법칙: 요구 사항을 충족하는 가장 낮은 단계에서 시작합니다
다음 주제는 월드 모델과 예측적 계획 수립, 즉 행동하기 전에 에이전트가 시뮬레이션하는 방법입니다.
자주 묻는 질문
“도우미에서 자율 에이전트로” 강의는 무료인가요?
네 — “도우미에서 자율 에이전트로” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 AI Agents 강의 전체를 잠금 해제할 수 있습니다. AI Agents 강의에는 총 4개의 강의가 포함되어 있습니다.
“도우미에서 자율 에이전트로”에서 뭘 배우나요?
챗봇에서 완전한 자율 에이전트에 이르는 단계별 변화와 각 단계에서 달라지는 점을 살펴봅니다. 브라우저에서 직접 실행하는 실습 코드로 AI Agents을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
AI Agents을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 AI Agents은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.
“도우미에서 자율 에이전트로” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 AI Agents 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 AI Agents 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 도우미에서 자율 에이전트로
- 세계 모델과 예측 계획
- 자율 에이전트의 정렬 과제
- 연구의 최전선: AGI와 그 너머