CrewAI Agent와 Task 입문: 역할을 어떻게 나눠야 안 꼬일까

3 min read

CrewAI 초반 실패는 API 문제가 아니라 역할 분담이 꼬이는 것인 경우가 많습니다.
원칙 하나만 기억하세요. 한 Agent는 한 전문성, 한 Task는 한 가지 일.

Agent를 먼저 나누고 Task를 작성

이렇게 생각하면 쉽습니다:

  • Agent는 "누가"
  • Task는 "무엇을"
  • Context는 "이전 단계에서 다음 단계로 넘길 데이터"

한 Agent에게 조사/작성/검수를 다 시키면, 보통 전부 얕아집니다.

좋은 Agent 설계 예시

researcher:
  role: >
    AI Research Analyst
  goal: >
    Collect accurate and current information
  backstory: >
    You specialize in finding reliable sources and extracting key facts.
  allow_delegation: false
 
writer:
  role: >
    Technical Writer
  goal: >
    Turn raw findings into clear and practical documentation
  backstory: >
    You explain complex ideas in simple language for beginners.
  allow_delegation: false

⚠️ allow_delegation은 기본적으로 꺼두는 것을 권장합니다. 먼저 흐름을 안정화하세요.

좋은 Task 설계 예시

research_task:
  description: >
    Find 8-10 important updates about {topic} in 2026.
    Include what changed and why it matters.
  expected_output: >
    A markdown bullet list.
    Each bullet includes: title, summary, and source URL.
  agent: researcher
 
write_task:
  description: >
    Convert the research bullets into a tutorial article with examples.
  expected_output: >
    A markdown article with intro, 3 sections, and conclusion.
  agent: writer
  context:
    - research_task

초보가 자주 밟는 3가지 함정

  1. Task 설명이 너무 짧다: 모델이 원하는 형식을 모른다
  2. expected_output 없음: 매번 출력 형식이 흔들린다
  3. context 없음: 후속 Task가 이전 결과를 못 받는다

간단 체크리스트

YAML 작성 후 이 5가지를 확인하세요:

  • Agent가 한 가지 전문성만 가지는가?
  • Task가 한 가지 일만 하는가?
  • expected_output에 형식이 명확한가?
  • 의존성 context를 넣었는가?
  • 파일 출력 담당에 output_file을 설정했는가?

다음 단계

분업이 정리됐으면 이제 "어떻게 실행 흐름을 구성할지"를 정해야 합니다.
👉 Crew와 Process