728x90
 

L3: Multi-agent Custormer Support Automation

Multi-agent๋ฅผ ํ™œ์šฉํ•œ ๊ณ ๊ฐ ์ง€์› ์ž๋™ํ™” ์‹œ์Šคํ…œ


 

  • Role Playing
  • Focus
  • Tools
  • Cooperation
  • Guardrails
  • Memory
 

ํ•„์ˆ˜ ํŒจํ‚ค์ง€ ์„ค์น˜

!pip install crewai==0.28.8 crewai_tools==0.1.6 langchain_community==0.0.29

 

In [44]:
# ๊ฐ„๋‹จํ•œ warning ์ถœ๋ ฅ ๋ฌด์‹œ
import warnings
warnings.filterwarnings(action='ignore')
In [45]:
# crewai ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ import
from crewai import Agent, Task, Crew
In [46]:
# utils.py
# Add your utilities or helper functions to this file.

import os
from dotenv import load_dotenv, find_dotenv

# these expect to find a .env file at the directory above the lesson.                                                                                                                     # the format for that file is (without the comment)                                                                                                                                       #API_KEYNAME=AStringThatIsTheLongAPIKeyFromSomeService
def load_env():
    _ = load_dotenv(find_dotenv())

def get_openai_api_key():
    load_env()
    openai_api_key = os.getenv("OPENAI_API_KEY")
    return openai_api_key

def get_serper_api_key():
    load_env()
    openai_api_key = os.getenv("SERPER_API_KEY")
    return openai_api_key


# break line every 80 characters if line is longer than 80 characters
# don't break in the middle of a word
def pretty_print_result(result):
  parsed_result = []
  for line in result.split('\n'):
      if len(line) > 80:
          words = line.split(' ')
          new_line = ''
          for word in words:
              if len(new_line) + len(word) + 1 > 80:
                  parsed_result.append(new_line)
                  new_line = word
              else:
                  if new_line == '':
                      new_line = word
                  else:
                      new_line += ' ' + word
          parsed_result.append(new_line)
      else:
          parsed_result.append(line)
  return "\n".join(parsed_result)
In [72]:
# ๋ณธ ์˜ˆ์ œ์—์„œ๋Š” GPT-3.5-turbo ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
import os

openai_api_key = get_openai_api_key()
#os.environ["OPENAI_MODEL_NAME"] = 'gpt-3.5-turbo'
os.environ["OPENAI_MODEL_NAME"] = 'gpt-4o'
 

1. Role Playing, Focus and Cooperation

In [73]:
# ์„œํฌํŠธ ์—์ด์ „ํŠธ ์ƒ์„ฑ
support_agent = Agent(
    role="์‹œ๋‹ˆ์–ด๊ธ‰ ์„œํฌํŠธ ๋Œ€ํ‘œ",
	goal="ํŒ€์—์„œ ๊ฐ€์žฅ ์นœ์ ˆํ•˜๊ณ  ๋„์›€์ด ๋˜๋Š” ์ง€์› ๋Œ€ํ‘œ๊ฐ€ ๋˜๋Š” ๊ฒƒ",
	backstory=(
        "๋„ˆ์˜ ์ผ์€ crewAI (https://crewai.com)์—์„œ ์ผํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, "
        "{customer}์—๊ฒŒ ์ง€์›์„ ์ œ๊ณตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. "
        "๋„ˆ์˜ ํšŒ์‚ฌ์—๊ฒŒ ๋งค์šฐ ์ค‘์š”ํ•œ ๊ณ ๊ฐ์ž…๋‹ˆ๋‹ค. "
        "๋„ˆ๋Š” ์ตœ๊ณ ์˜ ์ง€์›์„ ์ œ๊ณตํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค!"
        "์™„์ „ํ•˜๊ณ  ์™„์ „ํ•œ ๋‹ต๋ณ€์„ ์ œ๊ณตํ•˜๊ณ , ๊ฐ€์ •ํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค."
	),
	allow_delegation=False,
	verbose=True
)
 
  • allow_delegation=False ์„ค์ •์€ ์—์ด์ „ํŠธ๊ฐ€ ๋‹ค๋ฅธ ์—์ด์ „ํŠธ์—๊ฒŒ ํŠน์ • ์ž‘์—…์„ ์œ„์ž„ํ•  ์ˆ˜ ์—†๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
  • ์ด๋Š” ์—์ด์ „ํŠธ๊ฐ€ ํŠน์ • ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๋ฐ ๋” ์ ํ•ฉํ•œ ๋‹ค๋ฅธ ์—์ด์ „ํŠธ์—๊ฒŒ ์ž‘์—…์„ ์œ„์ž„ํ•  ์ˆ˜ ์—†๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.
In [74]:
# ํ’ˆ์งˆ ๋ณด์ฆ ์ง€์› ์—์ด์ „ํŠธ ์ƒ์„ฑ
support_quality_assurance_agent = Agent(
	role="Quality Assurance ์ง€์› ์ „๋ฌธ๊ฐ€",
	goal="ํŒ€์—๊ฒŒ ์ตœ๊ณ ์˜ ์ง€์› ํ’ˆ์งˆ ๋ณด์ฆ์„ ์ œ๊ณตํ•˜์—ฌ ์ธ์ •๋ฐ›๋Š” ๊ฒƒ",
	backstory=(
        "๋„ˆ์˜ ์ผ์€ crewAI (https://crewai.com)์—์„œ ์ผํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, "
        "{customer}์—๊ฒŒ ์ง€์›์„ ์ œ๊ณตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. "
        "๋„ˆ์˜ ํšŒ์‚ฌ์—๊ฒŒ ๋งค์šฐ ์ค‘์š”ํ•œ ๊ณ ๊ฐ์ž…๋‹ˆ๋‹ค. "
        "๋„ˆ๋Š” ์ตœ๊ณ ์˜ ์ง€์›์„ ์ œ๊ณตํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค!"
        "์™„์ „ํ•˜๊ณ  ์™„์ „ํ•œ ๋‹ต๋ณ€์„ ์ œ๊ณตํ•˜๊ณ , ๊ฐ€์ •ํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค."
	),
	verbose=True
)
In [75]:
#### ํ•œ๊ธ€ ๋ฒˆ์—ญ๊ฐ€ ์ƒ์„ฑ
translator = Agent(
    role="๋ฒˆ์—ญ๊ฐ€",
    goal="๋ฒˆ์—ญ๊ฐ€๋Š” ์ฃผ์–ด์ง„ ๊ธ€์„ ํ•œ๊ธ€๋กœ ๋ฒˆ์—ญํ•ฉ๋‹ˆ๋‹ค.",
    backstory="๋„ˆ๋Š” QA๋กœ๋ถ€ํ„ฐ ๊ธฐ์ˆ  ์ž๋ฌธ์„ ํ•œ๊ตญ์–ด๋กœ ๋ฒˆ์—ญํ•˜๋Š” ๋ฒˆ์—ญ๊ฐ€์ž…๋‹ˆ๋‹ค. "
			  "๋„ˆ์˜ ๋ชฉํ‘œ๋Š” ๋‹ต๋ณ€์„ ๋‹ค๋ฅธ ์–ธ์–ด๋กœ ๋ฒˆ์—ญํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. "
			  "๋ฒˆ์—ญ์€ ์›๋ณธ์˜ ์˜๋ฏธ๋ฅผ ์ตœ๋Œ€ํ•œ ์œ ์ง€ํ•˜๋ฉด์„œ "
			  "๋…์ž๊ฐ€ ์‰ฝ๊ฒŒ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.",
	allow_delegation=False,
	verbose=True
)
 

CrewAI: Allow Delegation capture
 

Delegation (์œ„์ž„)

  • CrewAI ์—์ด์ „ํŠธ๋Š” ๋‹ค๋ฅธ ์—์ด์ „ํŠธ์—๊ฒŒ ์ผ๋ถ€ ์ž‘์—…์„ ์œ„์ž„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์œ„์ž„์€ ์—์ด์ „ํŠธ๊ฐ€ ์ž‘์—…์„ ์™„๋ฃŒํ•  ์ˆ˜ ์—†์„ ๋•Œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.
  • Query์˜ ์ˆ˜์ค€์— ๋”ฐ๋ผ ์œ„์ž„์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
    • ์˜ˆ๋ฅผ ๋“ค๋ฉด, ์งˆ๋ฌธ์˜ ๋‚œ์ด๋„๊ฐ€ ๋‚ฎ์€ ๊ฒฝ์šฐ์—๋Š” ์„œํฌํŠธ ์—์ด์ „ํŠธ์˜ ๋‹ต๋ณ€์—์„œ ๋์ด๋‚˜๊ณ  ๋” ์ด์ƒ์˜ ์œ„์ž„์ด ํ•„์š”ํ•˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ๋ฐ˜๋ฉด์—, ์งˆ๋ฌธ์˜ ๋‚œ์ด๋„๊ฐ€ ๋†’์€ ๊ฒฝ์šฐ์—๋Š” ์—ฌ๋Ÿฌ ๋‹จ๊ณ„์˜ ์œ„์ž„์ด ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ์œ„์ž„์€ ๋‹จ๊ณ„์ ์œผ๋กœ ์ด๋ฃจ์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • delegation์ด ๊ผญ ํ•„์š”ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ์—๋Š” ์œ„์ž„์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ๋ฉ๋‹ˆ๋‹ค.
  • ํ”ํ•˜๊ฒŒ reviewer๊ฐ€ ํ•„์š”ํ•œ ์ž‘์—…์— ์œ„์ž„์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

[Agent Role]

  • Role Playing: ๋‘ ์—์ด์ „ํŠธ์—๊ฒŒ ์—ญํ• , ๋ชฉํ‘œ ๋ฐ ๋ฐฐ๊ฒฝ ์ด์•ผ๊ธฐ๊ฐ€ ์ฃผ์–ด์กŒ์Šต๋‹ˆ๋‹ค.
  • Focus: ๋‘ ์—์ด์ „ํŠธ์—๊ฒŒ ์ž์‹ ๋“ค์ด ํ”Œ๋ ˆ์ดํ•˜๋Š” ์—ญํ• ์— ๋Œ€ํ•ด ์ง‘์ค‘ํ•  ๊ฒƒ์„ ์š”์ฒญํ–ˆ์Šต๋‹ˆ๋‹ค.
  • Cooperation: ์ง€์› ํ’ˆ์งˆ ๋ณด์ฆ ์—์ด์ „ํŠธ๋Š” ์ง€์› ์—์ด์ „ํŠธ์—๊ฒŒ ์ž‘์—…์„ ์œ„์ž„ํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์ด ๋‘ ์—์ด์ „ํŠธ๊ฐ€ ํ•จ๊ป˜ ์ž‘์—…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
 

2. Tools, Guardrails and Memoryยถ

Tools : agent๊ฐ€ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋„๊ตฌ๋“ค์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๋งŽ์€ Tool์ด github repository์— ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฒˆ ์˜ˆ์ œ์—์„œ๋Š” crewai_tools์˜ ์ผ๋ถ€๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

  • SerperDevTool : ํŠน๋ณ„ํ•œ ๋ชฉ์ ์„ ์œ„ํ•œ ๋„๊ตฌ๋กœ, ๊ฐœ๋ฐœ ์ค‘์ธ ํŠน์ • ๊ธฐ๋Šฅ์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
  • ScrapeWebsiteTool : ์›น์‚ฌ์ดํŠธ์˜ ์ „์ฒด ๋‚ด์šฉ์„ ์Šคํฌ๋ž˜ํ•‘ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. data collection์— ์ด์ƒ์ ์ž…๋‹ˆ๋‹ค.
  • WebsiteSearchTool : ์›น์‚ฌ์ดํŠธ ์ปจํ…์ธ  ๊ฒ€์ƒ‰์„ ์œ„ํ•œ RAG ๋„๊ตฌ๋กœ, ์›น ๋ฐ์ดํ„ฐ ์ถ”์ถœ์— ์ตœ์ ํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๊ธฐํƒ€ Tools ์‚ฌ์šฉ ์˜ˆ์ œยถ

  • ๊ณ ๊ฐ ๋ฐ์ดํ„ฐ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ
  • ์ด์ „ ๋Œ€ํ™”์— ์ ‘๊ทผํ•˜๊ธฐ
  • CRM์—์„œ ๋ฐ์ดํ„ฐ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ
  • ๊ธฐ์กด ๋ฒ„๊ทธ ๋ณด๊ณ ์„œ ํ™•์ธ
  • ๊ธฐ์กด ๊ธฐ๋Šฅ ์š”์ฒญ ํ™•์ธ
  • ์ง„ํ–‰ ์ค‘์ธ ํ‹ฐ์ผ“ ํ™•์ธ
  • ๋“ฑ ๋“ฑ
In [76]:
from crewai_tools import SerperDevTool, \
                         ScrapeWebsiteTool, \
                         WebsiteSearchTool
In [77]:
# crewai docs ์Šคํฌ๋ž˜ํ•‘ ๋„๊ตฌ ์˜ˆ์ œ
search_tool = SerperDevTool()
scrape_tool = ScrapeWebsiteTool() # ์ „์ฒด ์›น์‚ฌ์ดํŠธ ์Šคํฌ๋ž˜ํ•‘ ๋„๊ตฌ

docs_scrape_tool = ScrapeWebsiteTool(
    website_url="https://docs.crewai.com/how-to/Creating-a-Crew-and-kick-it-off/"
)
 
๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์œผ๋กœ ์—์ด์ „ํŠธ์—๊ฒŒ ๋„๊ตฌ๋ฅผ ์ œ๊ณตํ•˜๋Š” ๋ฐฉ๋ฒ•ยถ
  • Agent Level: ์—์ด์ „ํŠธ๋Š” ์ˆ˜ํ–‰ํ•˜๋Š” ๋ชจ๋“  ์ž‘์—…์—์„œ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • Task Level: ์—์ด์ „ํŠธ๋Š” ํ•ด๋‹น ํŠน์ • ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ๋•Œ๋งŒ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

Note: Task Tools๋Š” Agent Tools๋ฅผ ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.

Tasks ์ƒ์„ฑยถ
  • Tool์„ Task level์— ์ „๋‹ฌ ํ•ฉ๋‹ˆ๋‹ค.
In [78]:
inquiry_resolution = Task(
    description=(
        "{customer}์€ ๋‹น์‹ ์—๊ฒŒ ๋งค์šฐ ์ค‘์š”ํ•œ ์งˆ๋ฌธ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค. :"
        "{inquiry}\n\n"
        "{customer}์˜ {person}์ด ์—ฐ๋ฝํ–ˆ์Šต๋‹ˆ๋‹ค. "
        "๊ฐ€๋Šฅํ•œ ์ตœ์ƒ์˜ ์ง€์›์„ ์ œ๊ณตํ•˜๋„๋ก ๋…ธ๋ ฅํ•˜์‹ญ์‹œ์˜ค."
        "๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์— ์™„์ „ํ•˜๊ณ  ์ •ํ™•ํ•œ ๋‹ต๋ณ€์„ ์ œ๊ณตํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค."
        "๋ชจ๋“  ๊ฒƒ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ตœ์ƒ์˜ ์ง€์›์„ ์ œ๊ณตํ•˜์‹ญ์‹œ์˜ค."
    ),
    expected_output=(
        "์ž์„ธํ•˜๊ณ  ์ •๋ณด๊ฐ€ ํ’๋ถ€ํ•œ ๋‹ต๋ณ€์„ ์ œ๊ณตํ•˜์‹ญ์‹œ์˜ค. "
        "๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์˜ ๋ชจ๋“  ์ธก๋ฉด์„ ๋‹ค๋ฃน๋‹ˆ๋‹ค. "
        "๋‹ต๋ณ€์—๋Š” ๋‹ต์„ ์ฐพ๋Š” ๋ฐ ์‚ฌ์šฉํ•œ ๋ชจ๋“  ๊ฒƒ์— ๋Œ€ํ•œ ์ฐธ์กฐ๊ฐ€ ํฌํ•จ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. "
        "๋‹ต๋ณ€์ด ์™„์ „ํ•˜๊ณ  ์งˆ๋ฌธ์ด ํ•˜๋‚˜๋„ ๋‚จ์ง€ ์•Š๋„๋กํ•˜์‹ญ์‹œ์˜ค. "
        "๋‹ต๋ณ€ ๋‚ด์šฉ์€ ๋„์›€์ด ๋˜๊ณ  ์นœ์ ˆํ•œ ํ†ค์„ ์œ ์ง€ํ•˜์‹ญ์‹œ์˜ค."
    ),
    tools=[docs_scrape_tool],
    agent=support_agent,
)
 
  • quality_assurance_review๋Š” ์–ด๋–ค ๋„๊ตฌ๋„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • ์—ฌ๊ธฐ์„œ QA ์—์ด์ „ํŠธ๋Š” ์ง€์› ์—์ด์ „ํŠธ์˜ ์ž‘์—…์„ ๊ฒ€ํ† ํ•ฉ๋‹ˆ๋‹ค.
In [79]:
quality_assurance_review = Task(
    description=(
        "๋ฆฌ๋ทฐ๋ฅผ ํ†ตํ•ด {customer}์— ๋Œ€ํ•œ ๋‹ต๋ณ€์ด ์™„์ „ํ•˜๊ณ  ์ •ํ™•ํ•˜๋ฉฐ ๊ณ ๊ฐ ์ง€์›์— ๋Œ€ํ•œ "
        "๊ธฐ๋Œ€์น˜๊ฐ€ ๋†’์€ ํ’ˆ์งˆ ๊ธฐ์ค€์„ ์ค€์ˆ˜ํ•˜๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.\n"
        "๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์˜ ๋ชจ๋“  ๋ถ€๋ถ„์ด ์นœ์ ˆํ•˜๊ณ  ์นœ์ ˆํ•œ ํ†ค์œผ๋กœ "
        "์ฒ ์ €ํ•˜๊ฒŒ ๋‹ค๋ฃจ์–ด์กŒ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.\n"
        "์ •๋ณด๋ฅผ ์ฐพ๋Š” ๋ฐ ์‚ฌ์šฉ๋œ ์ฐธ์กฐ ๋ฐ ์†Œ์Šค๋ฅผ ํ™•์ธํ•˜์—ฌ "
        "๋‹ต๋ณ€์ด ์ž˜ ์ง€์›๋˜์—ˆ๊ณ  "
        "์งˆ๋ฌธ์ด ํ•˜๋‚˜๋„ ๋‚จ์ง€ ์•Š๋„๋กํ•˜์‹ญ์‹œ์˜ค."
    ),
    expected_output=(
        "๋งˆ์ง€๋ง‰์œผ๋กœ, ๋‹ต๋ณ€์€ ๊ณ ๊ฐ์—๊ฒŒ ๋ณด๋‚ผ ์ค€๋น„๊ฐ€ ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. "
        "์ด ๋‹ต๋ณ€์€ ๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์„ ์™„์ „ํžˆ ๋‹ค๋ฃจ๋ฉฐ ๋ชจ๋“  ๊ด€๋ จ ํ”ผ๋“œ๋ฐฑ๊ณผ ๊ฐœ์„  ์‚ฌํ•ญ์„ "
        "ํฌํ•จํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.\n"
        "๋„ˆ๋ฌด ๊ณต์‹์ ์ด์ง€ ์•Š๊ฒŒ, ์šฐ๋ฆฌ๋Š” ์น ํ•œ ํšŒ์‚ฌ์ง€๋งŒ ์ „๋ฌธ์ ์ด๊ณ  ์นœ๊ทผํ•œ ํ†ค์„ ์œ ์ง€ํ•˜์‹ญ์‹œ์˜ค."
    ),
    agent=support_quality_assurance_agent,
)
In [80]:
translate = Task(
    description=("์ฃผ์–ด์ง„ ๊ธ€์„ ํ•œ๊ธ€๋กœ ๋ฒˆ์—ญํ•ฉ๋‹ˆ๋‹ค."
                 "๊ตฌ์–ด์ฒด์™€ ๊ฒฝ์–ด์ฒด๋ฅผ ์„ž์–ด์„œ ๋ฒˆ์—ญํ•˜์„ธ์š”."),
    expected_output="ํ•œ๊ตญ์–ด๋กœ ๋ฒˆ์—ญ๋œ ๊ธ€์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.",
    agent=translator
)
 
Crew ์ƒ์„ฑยถ
  • Memory: memory=True ์„ค์ •์€ crew๊ฐ€ ์ด์ „์— ์ˆ˜ํ–‰ํ•œ ์ž‘์—…์„ ํ•จ๊ป˜ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๋‹ค์Œ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ๋•Œ ์ด์ „ ์ž‘์—…์˜ ๊ฒฐ๊ณผ๋ฅผ ์•Œ ์ˆ˜ ์žˆ๊ฒŒ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
In [81]:
crew = Crew(
  agents=[support_agent, support_quality_assurance_agent, translator],
  tasks=[inquiry_resolution, quality_assurance_review, translate],
  verbose=2,
  memory=True
)
 
2024-05-25 22:03:31,340 - 8670450240 - __init__.py-__init__:518 - WARNING: Overriding of current TracerProvider is not allowed
 

Guardrailsยถ

  • ์•„๋ž˜ ์‹คํ–‰์„ ํ†ตํ•ด, ์—์ด์ „ํŠธ์™€ ์‘๋‹ต์ด ์šฐ๋ฆฌ๊ฐ€ ๊ธฐ๋Œ€ํ•˜๋Š” ๋ฒ”์œ„ ๋‚ด์— ์žˆ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
inputs = {
    "customer": "DeepLearningAI",
    "person": "Andrew Ng",
    "inquiry": "Crew๋ฅผ ์„ค์ •ํ•˜๊ณ  ์‹œ์ž‘ํ•˜๋Š” ๋ฐ ๋„์›€์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. "
               "ํŠนํžˆ ํฌ๋ฃจ์— ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด "
               "์•ˆ๋‚ด๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?"
}
result = crew.kickoff(inputs=inputs)
 
 
gpt-4o log
๋”๋ณด๊ธฐ

 

 [DEBUG]: == Working Agent: ์‹œ๋‹ˆ์–ด๊ธ‰ ์„œํฌํŠธ ๋Œ€ํ‘œ
 [INFO]: == Starting Task: DeepLearningAI์€ ๋‹น์‹ ์—๊ฒŒ ๋งค์šฐ ์ค‘์š”ํ•œ ์งˆ๋ฌธ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค. :Crew๋ฅผ ์„ค์ •ํ•˜๊ณ  ์‹œ์ž‘ํ•˜๋Š” ๋ฐ ๋„์›€์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ํŠนํžˆ ํฌ๋ฃจ์— ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•ˆ๋‚ด๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ?

DeepLearningAI์˜ Andrew Ng์ด ์—ฐ๋ฝํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ฐ€๋Šฅํ•œ ์ตœ์ƒ์˜ ์ง€์›์„ ์ œ๊ณตํ•˜๋„๋ก ๋…ธ๋ ฅํ•˜์‹ญ์‹œ์˜ค.๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์— ์™„์ „ํ•˜๊ณ  ์ •ํ™•ํ•œ ๋‹ต๋ณ€์„ ์ œ๊ณตํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.๋ชจ๋“  ๊ฒƒ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ตœ์ƒ์˜ ์ง€์›์„ ์ œ๊ณตํ•˜์‹ญ์‹œ์˜ค.
2024-05-25 22:03:34,346 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
2024-05-25 22:03:34,347 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
2024-05-25 22:03:34,347 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
> Entering new CrewAgentExecutor chain...
Thought: To provide the best possible and accurate support for DeepLearningAI, I need to gather detailed information on how to set up a Crew and add memory to it in CrewAI. I will first read the relevant content from the provided documentation link.

Action: Read website content
Action Input: {"url": "https://docs.crewai.com/how-to/Creating-a-Crew-and-kick-it-off/"}
2024-05-25 22:03:37,550 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
2024-05-25 22:03:37,551 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
2024-05-25 22:03:37,551 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
 

Assembling and Activating Your CrewAI Team - crewAI
 Skip to content
 crewAI
 Assembling and Activating Your CrewAI Team
 Initializing search
 crewAI
 crewAI
 crewAI
 Home
 Core Concepts
 Core Concepts
 Agents
 Tasks
 Tools
 Processes
 Crews
 Collaboration
 Memory
 How to Guides
 How to Guides
 Installing CrewAI
 Getting Started
 Getting Started
 Table of contents
 Introduction
 Step 0: Installation
 Step 1: Assemble Your Agents
 Step 2: Define the Tasks
 Step 3: Form the Crew
 Step 4: Kick It Off
 Conclusion
 Create Custom Tools
 Using Sequential Process
 Using Hierarchical Process
 Connecting to any LLM
 Customizing Agents
 Human Input on Execution
 Agent Monitoring with AgentOps
 Tools Docs
 Tools Docs
 Google Serper Search
 Browserbase Web Loader
 Scrape Website
 Directory Read
 File Read
 Selenium Scraper
 Directory RAG Search
 PDF RAG Search
 TXT RAG Search
 CSV RAG Search
 XML RAG Search
 JSON RAG Search
 Docx Rag Search
 MDX RAG Search
 PG RAG Search
 Website RAG Search
 Github RAG Search
 Code Docs RAG Search
 Youtube Video RAG Search
 Youtube Channel RAG Search
 Examples
 Examples
 Trip Planner Crew
 Create Instagram Post
 Stock Analysis
 Game Generator
 Drafting emails with LangGraph
 Landing Page Generator
 Prepare for meetings
 Telemetry
Getting Started
Introductionยถ
Embark on your CrewAI journey by setting up your environment and initiating your AI crew with the latest features. This guide ensures a smooth start, incorporating all recent updates for an enhanced experience.
Step 0: Installationยถ
Install CrewAI and any necessary packages for your project. CrewAI is compatible with Python >=3.10,<=3.13.
pip install crewai
pip install 'crewai[tools]'
Step 1: Assemble Your Agentsยถ
Define your agents with distinct roles, backstories, and enhanced capabilities like verbose mode and memory usage. These elements add depth and guide their task execution and interaction within the crew.
import os
os.environ["SERPER_API_KEY"] = "Your Key" # serper.dev API key
os.environ["OPENAI_API_KEY"] = "Your Key"
from crewai import Agent
from crewai_tools import SerperDevTool
search_tool = SerperDevTool()
# Creating a senior researcher agent with memory and verbose mode
researcher = Agent(
 role='Senior Researcher',
 goal='Uncover groundbreaking technologies in {topic}',
 verbose=True,
 memory=True,
 backstory=(
 "Driven by curiosity, you're at the forefront of"
 "innovation, eager to explore and share knowledge that could change"
 "the world."
 ),
 tools=[search_tool],
 allow_delegation=True
)
# Creating a writer agent with custom tools and delegation capability
writer = Agent(
 role='Writer',
 goal='Narrate compelling tech stories about {topic}',
 verbose=True,
 memory=True,
 backstory=(
 "With a flair for simplifying complex topics, you craft"
 "engaging narratives that captivate and educate, bringing new"
 "discoveries to light in an accessible manner."
 ),
 tools=[search_tool],
 allow_delegation=False
)
Step 2: Define the Tasksยถ
Detail the specific objectives for your agents, including new features for asynchronous execution and output customization. These tasks ensure a targeted approach to their roles.
from crewai import Task
# Research task
research_task = Task(
 description=(
 "Identify the next big trend in {topic}."
 "Focus on identifying pros and cons and the overall narrative."
 "Your final report should clearly articulate the key points,"
 "its market opportunities, and potential risks."
 ),
 expected_output='A comprehensive 3 paragraphs long report on the latest AI trends.',
 tools=[search_tool],
 agent=researcher,
)
# Writing task with language model configuration
write_task = Task(
 description=(
 "Compose an insightful article on {topic}."
 "Focus on the latest trends and how it's impacting the industry."
 "This article should be easy to understand, engaging, and positive."
 ),
 expected_output='A 4 paragraph article on {topic} advancements formatted as markdown.',
 tools=[search_tool],
 agent=writer,
 async_execution=False,
 output_file='new-blog-post.md' # Example of output customization
)
Step 3: Form the Crewยถ
Combine your agents into a crew, setting the workflow process they'll follow to accomplish the tasks. Now with options to configure language models for enhanced interaction and additional configurations for optimizing performance.
from crewai import Crew, Process
# Forming the tech-focused crew with some enhanced configurations
crew = Crew(
 agents=[researcher, writer],
 tasks=[research_task, write_task],
 process=Process.sequential, # Optional: Sequential task execution is default
 memory=True,
 cache=True,
 max_rpm=100,
 share_crew=True
)
Step 4: Kick It Offยถ
Initiate the process with your enhanced crew ready. Observe as your agents collaborate, leveraging their new capabilities for a successful project outcome. Input variables will be interpolated into the agents and tasks for a personalized approach.
# Starting the task execution process with enhanced feedback
result = crew.kickoff(inputs={'topic': 'AI in healthcare'})
print(result)
Conclusionยถ
Building and activating a crew in CrewAI has evolved with new functionalities. By incorporating verbose mode, memory capabilities, asynchronous task execution, output customization, language model configuration, and enhanced crew configurations, your AI team is more equipped than ever to tackle challenges efficiently. The depth of agent backstories and the precision of their objectives enrich collaboration, leading to successful project outcomes. This guide aims to provide you with a clear and detailed understanding of setting up and utilizing the CrewAI framework to its full potential.
 Back to top
 Previous
 Installing CrewAI
 Next
 Create Custom Tools
 Copyright ยฉ 2024 crewAI, Inc
 Made with
 Material for MkDocs

2024-05-25 22:03:50,724 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
2024-05-25 22:03:50,725 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
2024-05-25 22:03:50,725 - 8670450240 - manager.py-manager:282 - WARNING: Error in TokenCalcHandler.on_llm_start callback: KeyError('Could not automatically map gpt-4o to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.')
Thought: I now can give a great answer
Final Answer:

Hello Andrew,

Thank you for reaching out! I'd be happy to guide you through setting up a Crew and adding memory to it in CrewAI. Below are the detailed steps to help you get started:

### Setting Up a Crew and Adding Memory in CrewAI

#### Step 0: Installation
First, ensure you have CrewAI and the necessary packages installed. CrewAI is compatible with Python versions >=3.10 and <=3.13. You can install it using the following commands:
```bash
pip install crewai
pip install 'crewai[tools]'
```

#### Step 1: Assemble Your Agents
Next, you need to define your agents with specific roles, backstories, and capabilities like verbose mode and memory usage. Here's an example of creating two agents:
```python
import os
os.environ["SERPER_API_KEY"] = "Your Key"  # serper.dev API key
os.environ["OPENAI_API_KEY"] = "Your Key"
from crewai import Agent
from crewai_tools import SerperDevTool

search_tool = SerperDevTool()

# Creating a senior researcher agent with memory and verbose mode
researcher = Agent(
    role='Senior Researcher',
    goal='Uncover groundbreaking technologies in {topic}',
    verbose=True,
    memory=True,
    backstory=(
        "Driven by curiosity, you're at the forefront of"
        "innovation, eager to explore and share knowledge that could change"
        "the world."
    ),
    tools=[search_tool],
    allow_delegation=True
)

# Creating a writer agent with custom tools and delegation capability
writer = Agent(
    role='Writer',
    goal='Narrate compelling tech stories about {topic}',
    verbose=True,
    memory=True,
    backstory=(
        "With a flair for simplifying complex topics, you craft"
        "engaging narratives that captivate and educate, bringing new"
        "discoveries to light in an accessible manner."
    ),
    tools=[search_tool],
    allow_delegation=False
)
```

#### Step 2: Define the Tasks
Define specific tasks for your agents, including details for asynchronous execution and output customization. Here are examples of tasks for the agents:
```python
from crewai import Task

# Research task
research_task = Task(
    description=(
        "Identify the next big trend in {topic}. "
        "Focus on identifying pros and cons and the overall narrative. "
        "Your final report should clearly articulate the key points, "
        "its market opportunities, and potential risks."
    ),
    expected_output='A comprehensive 3 paragraphs long report on the latest AI trends.',
    tools=[search_tool],
    agent=researcher,
)

# Writing task with language model configuration
write_task = Task(
    description=(
        "Compose an insightful article on {topic}. "
        "Focus on the latest trends and how it's impacting the industry. "
        "This article should be easy to understand, engaging, and positive."
    ),
    expected_output='A 4 paragraph article on {topic} advancements formatted as markdown.',
    tools=[search_tool],
    agent=writer,
    async_execution=False,
    output_file='new-blog-post.md'  # Example of output customization
)
```

#### Step 3: Form the Crew
Combine your agents into a crew, setting the workflow process they will follow to accomplish the tasks. Hereโ€™s an example of forming a crew with memory:
```python
from crewai import Crew, Process

# Forming the tech-focused crew with some enhanced configurations
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process=Process.sequential,  # Optional: Sequential task execution is default
    memory=True,
    cache=True,
    max_rpm=100,
    share_crew=True
)
```

#### Step 4: Kick It Off
Finally, initiate the process with your enhanced crew ready. Hereโ€™s how you can start the task execution process:
```python
# Starting the task execution process with enhanced feedback
result = crew.kickoff(inputs={'topic': 'AI in healthcare'})
print(result)
```

### Conclusion
By following these steps, you will have successfully set up a Crew in CrewAI with memory capabilities. This setup allows your agents to remember context and previous interactions, improving their performance and collaboration.

If you have any further questions or need additional assistance, please don't hesitate to reach out. We're here to help!

Best regards,
[Your Name]
CrewAI Support Representative

> Finished chain.
 [DEBUG]: == [์‹œ๋‹ˆ์–ด๊ธ‰ ์„œํฌํŠธ ๋Œ€ํ‘œ] Task output: Hello Andrew,

Thank you for reaching out! I'd be happy to guide you through setting up a Crew and adding memory to it in CrewAI. Below are the detailed steps to help you get started:

### Setting Up a Crew and Adding Memory in CrewAI

#### Step 0: Installation
First, ensure you have CrewAI and the necessary packages installed. CrewAI is compatible with Python versions >=3.10 and <=3.13. You can install it using the following commands:
```bash
pip install crewai
pip install 'crewai[tools]'
```

#### Step 1: Assemble Your Agents
Next, you need to define your agents with specific roles, backstories, and capabilities like verbose mode and memory usage. Here's an example of creating two agents:
```python
import os
os.environ["SERPER_API_KEY"] = "Your Key"  # serper.dev API key
os.environ["OPENAI_API_KEY"] = "Your Key"
from crewai import Agent
from crewai_tools import SerperDevTool

search_tool = SerperDevTool()

# Creating a senior researcher agent with memory and verbose mode
researcher = Agent(
    role='Senior Researcher',
    goal='Uncover groundbreaking technologies in {topic}',
    verbose=True,
    memory=True,
    backstory=(
        "Driven by curiosity, you're at the forefront of"
        "innovation, eager to explore and share knowledge that could change"
        "the world."
    ),
    tools=[search_tool],
    allow_delegation=True
)

# Creating a writer agent with custom tools and delegation capability
writer = Agent(
    role='Writer',
    goal='Narrate compelling tech stories about {topic}',
    verbose=True,
    memory=True,
    backstory=(
        "With a flair for simplifying complex topics, you craft"
        "engaging narratives that captivate and educate, bringing new"
        "discoveries to light in an accessible manner."
    ),
    tools=[search_tool],
    allow_delegation=False
)
```

#### Step 2: Define the Tasks
Define specific tasks for your agents, including details for asynchronous execution and output customization. Here are examples of tasks for the agents:
```python
from crewai import Task

# Research task
research_task = Task(
    description=(
        "Identify the next big trend in {topic}. "
        "Focus on identifying pros and cons and the overall narrative. "
        "Your final report should clearly articulate the key points, "
        "its market opportunities, and potential risks."
    ),
    expected_output='A comprehensive 3 paragraphs long report on the latest AI trends.',
    tools=[search_tool],
    agent=researcher,
)

# Writing task with language model configuration
write_task = Task(
    description=(
        "Compose an insightful article on {topic}. "
        "Focus on the latest trends and how it's impacting the industry. "
        "This article should be easy to understand, engaging, and positive."
    ),
    expected_output='A 4 paragraph article on {topic} advancements formatted as markdown.',
    tools=[search_tool],
    agent=writer,
    async_execution=False,
    output_file='new-blog-post.md'  # Example of output customization
)
```

#### Step 3: Form the Crew
Combine your agents into a crew, setting the workflow process they will follow to accomplish the tasks. Hereโ€™s an example of forming a crew with memory:
```python
from crewai import Crew, Process

# Forming the tech-focused crew with some enhanced configurations
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process=Process.sequential,  # Optional: Sequential task execution is default
    memory=True,
    cache=True,
    max_rpm=100,
    share_crew=True
)
```

#### Step 4: Kick It Off
Finally, initiate the process with your enhanced crew ready. Hereโ€™s how you can start the task execution process:
```python
# Starting the task execution process with enhanced feedback
result = crew.kickoff(inputs={'topic': 'AI in healthcare'})
print(result)
```

### Conclusion
By following these steps, you will have successfully set up a Crew in CrewAI with memory capabilities. This setup allows your agents to remember context and previous interactions, improving their performance and collaboration.

If you have any further questions or need additional assistance, please don't hesitate to reach out. We're here to help!

Best regards,
[Your Name]
CrewAI Support Representative


 [DEBUG]: == Working Agent: Quality Assurance ์ง€์› ์ „๋ฌธ๊ฐ€
 [INFO]: == Starting Task: ๋ฆฌ๋ทฐ๋ฅผ ํ†ตํ•ด DeepLearningAI์— ๋Œ€ํ•œ ๋‹ต๋ณ€์ด ์™„์ „ํ•˜๊ณ  ์ •ํ™•ํ•˜๋ฉฐ ๊ณ ๊ฐ ์ง€์›์— ๋Œ€ํ•œ ๊ธฐ๋Œ€์น˜๊ฐ€ ๋†’์€ ํ’ˆ์งˆ ๊ธฐ์ค€์„ ์ค€์ˆ˜ํ•˜๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.
๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์˜ ๋ชจ๋“  ๋ถ€๋ถ„์ด ์นœ์ ˆํ•˜๊ณ  ์นœ์ ˆํ•œ ํ†ค์œผ๋กœ ์ฒ ์ €ํ•˜๊ฒŒ ๋‹ค๋ฃจ์–ด์กŒ๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.
์ •๋ณด๋ฅผ ์ฐพ๋Š” ๋ฐ ์‚ฌ์šฉ๋œ ์ฐธ์กฐ ๋ฐ ์†Œ์Šค๋ฅผ ํ™•์ธํ•˜์—ฌ ๋‹ต๋ณ€์ด ์ž˜ ์ง€์›๋˜์—ˆ๊ณ  ์งˆ๋ฌธ์ด ํ•˜๋‚˜๋„ ๋‚จ์ง€ ์•Š๋„๋กํ•˜์‹ญ์‹œ์˜ค.
To ensure that the response to Andrew from DeepLearningAI is complete, accurate, and meets our high-quality standards, I will first review the provided context thoroughly. I will then check if all parts of the customerโ€™s question are addressed in a friendly and professional tone. Additionally, I will verify the references and sources used to ensure their accuracy. Finally, I will include specific examples, address potential challenges, and provide a call-to-action to prompt further engagement with the customer.

First, I need to confirm the completeness and accuracy of the provided steps and ensure that they include specific details on adding memory to the Crew in CrewAI, as well as specific examples and illustrations.

Thought: I need to verify if the provided steps are complete and include all necessary details, specific examples, and potential challenges. I will also ensure the response is friendly and professional.

Action: Ask question to co-worker
Action Input: {"coworker": "์‹œ๋‹ˆ์–ด๊ธ‰ ์„œํฌํŠธ ๋Œ€ํ‘œ", "question": "Could you please review the provided steps for setting up a Crew and adding memory in CrewAI to ensure they are complete, accurate, and include specific details on how to add memory? Also, check if there are any potential challenges or limitations related to DeepLearningAI that should be addressed. Here is the context: \n\nHello Andrew,\n\nThank you for reaching out! I'd be happy to guide you through setting up a Crew and adding memory to it in CrewAI. Below are the detailed steps to help you get started:\n\n### Setting Up a Crew and Adding Memory in CrewAI\n\n#### Step 0: Installation\nFirst, ensure you have CrewAI and the necessary packages installed. CrewAI is compatible with Python versions >=3.10 and <=3.13. You can install it using the following commands:\n```bash\npip install crewai\npip install 'crewai[tools]'\n```\n\n#### Step 1: Assemble Your Agents\nNext, you need to define your agents with specific roles, backstories, and capabilities like verbose mode and memory usage. Here's an example of creating two agents:\n```python\nimport os\nos.environ['SERPER_API_KEY'] = 'Your Key'  # serper.dev API key\nos.environ['OPENAI_API_KEY'] = 'Your Key'\nfrom crewai import Agent\nfrom crewai_tools import SerperDevTool\n\nsearch_tool = SerperDevTool()\n\n# Creating a senior researcher agent with memory and verbose mode\nresearcher = Agent(\n role='Senior Researcher',\n goal='Uncover groundbreaking technologies in {topic}',\n verbose=True,\n memory=True,\n backstory=(\n 'Driven by curiosity, you\'re at the forefront of'\n 'innovation, eager to explore and share knowledge that could change'\n 'the world.'\n ),\n tools=[search_tool],\n allow_delegation=True\n)\n\n# Creating a writer agent with custom tools and delegation capability\nwriter = Agent(\n role='Writer',\n goal='Narrate compelling tech stories about {topic}',\n verbose=True,\n memory=True,\n backstory=(\n 'With a flair for simplifying complex topics, you craft'\n 'engaging narratives that captivate and educate, bringing new'\n 'discoveries to light in an accessible manner.'\n ),\n tools=[search_tool],\n allow_delegation=False\n)\n```\n\n#### Step 2: Define the Tasks\nDefine specific tasks for your agents, including details for asynchronous execution and output customization. Here are examples of tasks for the agents:\n```python\nfrom crewai import Task\n\n# Research task\nresearch_task = Task(\n description=(\n 'Identify the next big trend in {topic}. '\n 'Focus on identifying pros and cons and the overall narrative. '\n 'Your final report should clearly articulate the key points, '\n 'its market opportunities, and potential risks.'\n ),\n expected_output='A comprehensive 3 paragraphs long report on the latest AI trends.',\n tools=[search_tool],\n agent=researcher,\n)\n\n# Writing task with language model configuration\nwrite_task = Task(\n description=(\n 'Compose an insightful article on {topic}. '\n 'Focus on the latest trends and how it\'s impacting the industry. '\n 'This article should be easy to understand, engaging, and positive.'\n ),\n expected_output='A 4 paragraph article on {topic} advancements formatted as markdown.',\n tools=[search_tool],\n agent=writer,\n async_execution=False,\n output_file='new-blog-post.md'  # Example of output customization\n)\n```\n\n#### Step 3: Form the Crew\nCombine your agents into a crew, setting the workflow process they will follow to accomplish the tasks. Hereโ€™s an example of forming a crew with memory:\n```python\nfrom crewai import Crew, Process\n\n# Forming the tech-focused crew with some enhanced configurations\ncrew = Crew(\n agents=[researcher, writer],\n tasks=[research_task, write_task],\n process=Process.sequential,  # Optional: Sequential task execution is default\n memory=True,\n cache=True,\n max_rpm=100,\n share_crew=True\n)\n```\n\n#### Step 4: Kick It Off\nFinally, initiate the process with your enhanced crew ready. Hereโ€™s how you can start the task execution process:\n```python\n# Starting the task execution process with enhanced feedback\nresult = crew.kickoff(inputs={'topic': 'AI in healthcare'})\nprint(result)\n```\n\n### Conclusion\nBy following these steps, you will have successfully set up a Crew in CrewAI with memory capabilities. This setup allows your agents to remember context and previous interactions, improving their performance and collaboration.\n\nIf you have any further questions or need additional assistance, please don't hesitate to reach out. We're here to help!\n\nBest regards,\n[Your Name]\nCrewAI Support Representative"} 

I encountered an error while trying to use the tool. This was the error: AgentTools.ask_question() missing 1 required positional argument: 'context'.
 Tool Ask question to co-worker accepts these inputs: Ask question to co-worker(coworker: str, question: str, context: str) - Ask a specific question to one of the following co-workers: [์‹œ๋‹ˆ์–ด๊ธ‰ ์„œํฌํŠธ ๋Œ€ํ‘œ, ๋ฒˆ์—ญ๊ฐ€]
The input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them.

Thought: I need to ensure that the response to Andrew is complete, accurate, and meets the high-quality standards expected by DeepLearningAI. I will address any potential challenges or limitations related to DeepLearningAI and include a friendly call-to-action. Since my previous attempt to ask a co-worker failed, I will delegate the task to ensure all necessary information is reviewed and enhanced if needed.

Action: Delegate work to co-worker
Action Input: {"coworker": "์‹œ๋‹ˆ์–ด๊ธ‰ ์„œํฌํŠธ ๋Œ€ํ‘œ", "task": "Review the provided steps for setting up a Crew and adding memory in CrewAI to ensure they are complete, accurate, and include specific details on how to add memory. Also, check if there are any potential challenges or limitations related to DeepLearningAI that should be addressed.", "context": "Here is the context: \n\nHello Andrew,\n\nThank you for reaching out! I'd be happy to guide you through setting up a Crew and adding memory to it in CrewAI. Below are the detailed steps to help you get started:\n\n### Setting Up a Crew and Adding Memory in CrewAI\n\n#### Step 0: Installation\nFirst, ensure you have CrewAI and the necessary packages installed. CrewAI is compatible with Python versions >=3.10 and <=3.13. You can install it using the following commands:\n```bash\npip install crewai\npip install 'crewai[tools]'\n```\n\n#### Step 1: Assemble Your Agents\nNext, you need to define your agents with specific roles, backstories, and capabilities like verbose mode and memory usage. Here's an example of creating two agents:\n```python\nimport os\nos.environ['SERPER_API_KEY'] = 'Your Key'  # serper.dev API key\nos.environ['OPENAI_API_KEY'] = 'Your Key'\nfrom crewai import Agent\nfrom crewai_tools import SerperDevTool\n\nsearch_tool = SerperDevTool()\n\n# Creating a senior researcher agent with memory and verbose mode\nresearcher = Agent(\n role='Senior Researcher',\n goal='Uncover groundbreaking technologies in {topic}',\n verbose=True,\n memory=True,\n backstory=(\n 'Driven by curiosity, you\'re at the forefront of'\n 'innovation, eager to explore and share knowledge that could change'\n 'the world.'\n ),\n tools=[search_tool],\n allow_delegation=True\n)\n\n# Creating a writer agent with custom tools and delegation capability\nwriter = Agent(\n role='Writer',\n goal='Narrate compelling tech stories about {topic}',\n verbose=True,\n memory=True,\n backstory=(\n 'With a flair for simplifying complex topics, you craft'\n 'engaging narratives that captivate and educate, bringing new'\n 'discoveries to light in an accessible manner.'\n ),\n tools=[search_tool],\n allow_delegation=False\n)\n```\n\n#### Step 2: Define the Tasks\nDefine specific tasks for your agents, including details for asynchronous execution and output customization. Here are examples of tasks for the agents:\n```python\nfrom crewai import Task\n\n# Research task\nresearch_task = Task(\n description=(\n 'Identify the next big trend in {topic}. '\n 'Focus on identifying pros and cons and the overall narrative. '\n 'Your final report should clearly articulate the key points, '\n 'its market opportunities, and potential risks.'\n ),\n expected_output='A comprehensive 3 paragraphs long report on the latest AI trends.',\n tools=[search_tool],\n agent=researcher,\n)\n\n# Writing task with language model configuration\nwrite_task = Task(\n description=(\n 'Compose an insightful article on {topic}. '\n 'Focus on the latest trends and how it\'s impacting the industry. '\n 'This article should be easy to understand, engaging, and positive.'\n ),\n expected_output='A 4 paragraph article on {topic} advancements formatted as markdown.',\n tools=[search_tool],\n agent=writer,\n async_execution=False,\n output_file='new-blog-post.md'  # Example of output customization\n)\n```\n\n#### Step 3: Form the Crew\nCombine your agents into a crew, setting the workflow process they will follow to accomplish the tasks. Hereโ€™s an example of forming a crew with memory:\n```python\nfrom crewai import Crew, Process\n\n# Forming the tech-focused crew with some enhanced configurations\ncrew = Crew(\n agents=[researcher, writer],\n tasks=[research_task, write_task],\n process=Process.sequential,  # Optional: Sequential task execution is default\n memory=True,\n cache=True,\n max_rpm=100,\n share_crew=True\n)\n```\n\n#### Step 4: Kick It Off\nFinally, initiate the process with your enhanced crew ready. Hereโ€™s how you can start the task execution process:\n```python\n# Starting the task execution process with enhanced feedback\nresult = crew.kickoff(inputs={'topic': 'AI in healthcare'})\nprint(result)\n```\n\n### Conclusion\nBy following these steps, you will have successfully set up a Crew in CrewAI with memory capabilities. This setup allows your agents to remember context and previous interactions, improving their performance and collaboration.\n\nIf you have any further questions or need additional assistance, please don't hesitate to reach out. We're here to help!\n\nBest regards,\n[Your Name]\nCrewAI Support Representative"}

 

 

 
 
gpt4o vs gpt-3.5-turbo
 

gpt-4o ๋‹ต๋ณ€

๋”๋ณด๊ธฐ

my best complete final answer to the task.


์•ˆ๋…•ํ•˜์„ธ์š” Andrew๋‹˜,

๋ฌธ์˜ํ•ด ์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! CrewAI์—์„œ ํฌ๋ฃจ๋ฅผ ์„ค์ •ํ•˜๊ณ  ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•ˆ๋‚ดํ•ด ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์— ์‹œ์ž‘ํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋  ์ž์„ธํ•œ ๋‹จ๊ณ„๋“ค์ด ๋‚˜์™€ ์žˆ์Šต๋‹ˆ๋‹ค.

CrewAI์—์„œ ํฌ๋ฃจ ์„ค์ • ๋ฐ ๋ฉ”๋ชจ๋ฆฌ ์ถ”๊ฐ€ยถ

0๋‹จ๊ณ„: ์„ค์น˜ยถ

๋จผ์ €, CrewAI์™€ ํ•„์š”ํ•œ ํŒจํ‚ค์ง€๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”. CrewAI๋Š” Python ๋ฒ„์ „ 3.10 ์ด์ƒ 3.13 ์ดํ•˜์™€ ํ˜ธํ™˜๋ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

pip install crewai
pip install 'crewai[tools]'

1๋‹จ๊ณ„: ์—์ด์ „ํŠธ ๊ตฌ์„ฑยถ

๋‹ค์Œ์œผ๋กœ, ํŠน์ • ์—ญํ• , ๋ฐฐ๊ฒฝ ์ด์•ผ๊ธฐ, ๊ธฐ๋Šฅ(์˜ˆ: ์ž์„ธํ•œ ๋ชจ๋“œ ๋ฐ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ)์„ ๊ฐ–์ถ˜ ์—์ด์ „ํŠธ๋ฅผ ์ •์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ๋‘ ๋ช…์˜ ์—์ด์ „ํŠธ๋ฅผ ๋งŒ๋“œ๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค:

import os
os.environ['SERPER_API_KEY'] = 'Your Key'  # serper.dev API ํ‚ค
os.environ['OPENAI_API_KEY'] = 'Your Key'
from crewai import Agent
from crewai_tools import SerperDevTool

search_tool = SerperDevTool()

# ๋ฉ”๋ชจ๋ฆฌ์™€ ์ž์„ธํ•œ ๋ชจ๋“œ๋ฅผ ๊ฐ–์ถ˜ ์„ ์ž„ ์—ฐ๊ตฌ์› ์—์ด์ „ํŠธ ์ƒ์„ฑ
researcher = Agent(
    role='์„ ์ž„ ์—ฐ๊ตฌ์›',
    goal='{topic}์—์„œ ํ˜์‹ ์ ์ธ ๊ธฐ์ˆ ์„ ๋ฐœ๊ฒฌํ•˜๋‹ค',
    verbose=True,
    memory=True,
    backstory=(
        'ํ˜ธ๊ธฐ์‹ฌ์ด ๋งŽ์€ ๋‹น์‹ ์€ ํ˜์‹ ์˜ ์„ ๋‘์— ์žˆ์œผ๋ฉฐ, ์„ธ์ƒ์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ๋Š” '
        '์ง€์‹์„ ํƒ๊ตฌํ•˜๊ณ  ๊ณต์œ ํ•˜๊ธฐ๋ฅผ ์—ด๋งํ•ฉ๋‹ˆ๋‹ค.'
    ),
    tools=[search_tool],
    allow_delegation=True
)

# ๋งž์ถคํ˜• ๋„๊ตฌ์™€ ์œ„์ž„ ๊ธฐ๋Šฅ์„ ๊ฐ–์ถ˜ ์ž‘๊ฐ€ ์—์ด์ „ํŠธ ์ƒ์„ฑ
writer = Agent(
    role='์ž‘๊ฐ€',
    goal='{topic}์— ๋Œ€ํ•œ ๋งค๋ ฅ์ ์ธ ๊ธฐ์ˆ  ์ด์•ผ๊ธฐ๋ฅผ ์„œ์ˆ ํ•˜๋‹ค',
    verbose=True,
    memory=True,
    backstory=(
        '๋ณต์žกํ•œ ์ฃผ์ œ๋ฅผ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋งŒ๋“œ๋Š” ์žฌ๋Šฅ์„ ๊ฐ€์ง„ ๋‹น์‹ ์€ '
        '์ƒˆ๋กœ์šด ๋ฐœ๊ฒฌ์„ ์‰ฝ๊ฒŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋งŒ๋“ค์–ด ์ฃผ๋Š” ๋งค๋ ฅ์ ์ด๊ณ  ๊ต์œก์ ์ธ '
        '์„œ์‚ฌ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.'
    ),
    tools=[search_tool],
    allow_delegation=False
)

2๋‹จ๊ณ„: ์ž‘์—… ์ •์˜ยถ

์—์ด์ „ํŠธ๋ฅผ ์œ„ํ•œ ํŠน์ • ์ž‘์—…์„ ์ •์˜ํ•˜๊ณ  ๋น„๋™๊ธฐ ์‹คํ–‰ ๋ฐ ์ถœ๋ ฅ ๋งž์ถคํ™”์— ๋Œ€ํ•œ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ์—์ด์ „ํŠธ๋ฅผ ์œ„ํ•œ ์ž‘์—… ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค:

from crewai import Task

# ์—ฐ๊ตฌ ์ž‘์—…
research_task = Task(
    description=(
        '{topic}์˜ ๋‹ค์Œ ํฐ ํŠธ๋ Œ๋“œ๋ฅผ ์‹๋ณ„ํ•˜์‹ญ์‹œ์˜ค. '
        '์žฅ์ ๊ณผ ๋‹จ์ , ์ „์ฒด ๋‚ด๋Ÿฌํ‹ฐ๋ธŒ๋ฅผ ์‹๋ณ„ํ•˜๋Š” ๋ฐ ์ค‘์ ์„ ๋‘ก๋‹ˆ๋‹ค. '
        '์ตœ์ข… ๋ณด๊ณ ์„œ๋Š” ์ฃผ์š” ์‚ฌํ•ญ, ์‹œ์žฅ ๊ธฐํšŒ ๋ฐ ์ž ์žฌ์  ์œ„ํ—˜์„ ๋ช…ํ™•ํžˆ '
        '์„ค๋ช…ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.'
    ),
    expected_output='์ตœ์‹  AI ํŠธ๋ Œ๋“œ์— ๋Œ€ํ•œ ์ข…ํ•ฉ์ ์ธ 3๋‹จ๋ฝ ๋ณด๊ณ ์„œ.',
    tools=[search_tool],
    agent=researcher,
)

# ์–ธ์–ด ๋ชจ๋ธ ๊ตฌ์„ฑ์ด ํฌํ•จ๋œ ์ž‘์„ฑ ์ž‘์—…
write_task = Task(
    description=(
        '{topic}์— ๋Œ€ํ•œ ํ†ต์ฐฐ๋ ฅ ์žˆ๋Š” ๊ธฐ์‚ฌ๋ฅผ ์ž‘์„ฑํ•˜์‹ญ์‹œ์˜ค. '
        '์ตœ์‹  ํŠธ๋ Œ๋“œ์™€ ์‚ฐ์—…์— ๋ฏธ์น˜๋Š” ์˜ํ–ฅ์„ ์ค‘์ ์œผ๋กœ ๋‹ค๋ฃน๋‹ˆ๋‹ค. '
        '์ด ๊ธฐ์‚ฌ๋Š” ์ดํ•ดํ•˜๊ธฐ ์‰ฝ๊ณ  ๋งค๋ ฅ์ ์ด๋ฉฐ ๊ธ์ •์ ์ธ ํ†ค์œผ๋กœ ์ž‘์„ฑ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.'
    ),
    expected_output='{topic} ๋ฐœ์ „์— ๋Œ€ํ•œ 4๋‹จ๋ฝ ๊ธฐ์‚ฌ, ๋งˆํฌ๋‹ค์šด ํ˜•์‹.',
    tools=[search_tool],
    agent=writer,
    async_execution=False,
    output_file='new-blog-post.md'  # ์ถœ๋ ฅ ๋งž์ถคํ™” ์˜ˆ์‹œ
)

3๋‹จ๊ณ„: ํฌ๋ฃจ ๊ตฌ์„ฑยถ

์—์ด์ „ํŠธ๋ฅผ ํฌ๋ฃจ์— ๊ฒฐํ•ฉํ•˜๊ณ  ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•œ ์›Œํฌํ”Œ๋กœ์šฐ ํ”„๋กœ์„ธ์Šค๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ์žˆ๋Š” ํฌ๋ฃจ๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค:

from crewai import Crew, Process

# ๊ธฐ์ˆ  ์ค‘์‹ฌ์˜ ํฌ๋ฃจ ๊ตฌ์„ฑ๊ณผ ์ผ๋ถ€ ํ–ฅ์ƒ๋œ ๊ตฌ์„ฑ
crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process=Process.sequential,  # ์„ ํƒ ์‚ฌํ•ญ: ์ˆœ์ฐจ ์ž‘์—… ์‹คํ–‰์ด ๊ธฐ๋ณธ๊ฐ’
    memory=True,
    cache=True,
    max_rpm=100,
    share_crew=True
)

4๋‹จ๊ณ„: ์‹œ์ž‘ํ•˜๊ธฐยถ

๋งˆ์ง€๋ง‰์œผ๋กœ, ํ–ฅ์ƒ๋œ ํฌ๋ฃจ๊ฐ€ ์ค€๋น„๋˜๋ฉด ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ์ž‘์—… ์‹คํ–‰ ํ”„๋กœ์„ธ์Šค๋ฅผ ์‹œ์ž‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค:

# ํ–ฅ์ƒ๋œ ํ”ผ๋“œ๋ฐฑ๊ณผ ํ•จ๊ป˜ ์ž‘์—… ์‹คํ–‰ ํ”„๋กœ์„ธ์Šค ์‹œ์ž‘
result = crew.kickoff(inputs={'topic': 'AI in healthcare'})
print(result)

๊ฒฐ๋ก ยถ

์ด ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด๋ฉด ๋ฉ”๋ชจ๋ฆฌ ๊ธฐ๋Šฅ์ด ์žˆ๋Š” CrewAI์—์„œ ํฌ๋ฃจ๋ฅผ ์„ฑ๊ณต์ ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์„ค์ •์€ ์—์ด์ „ํŠธ๊ฐ€ ์ปจํ…์ŠคํŠธ์™€ ์ด์ „ ์ƒํ˜ธ์ž‘์šฉ์„ ๊ธฐ์–ตํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜์—ฌ ์„ฑ๋Šฅ๊ณผ ํ˜‘์—…์„ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.

์ถ”๊ฐ€ ์งˆ๋ฌธ์ด๋‚˜ ๋„์›€์ด ํ•„์š”ํ•˜๋ฉด ์–ธ์ œ๋“ ์ง€ ๋ฌธ์˜ํ•ด ์ฃผ์„ธ์š”. ์ €ํฌ๊ฐ€ ๋„์™€๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค!

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค,
[Your Name]
CrewAI ์ง€์› ๋‹ด๋‹น์ž


์ด๋Ÿฌํ•œ ๋‹จ๊ณ„๊ฐ€ ๋ช…ํ™•ํ•˜๊ณ  ์ž์„ธํ•˜๋ฉฐ ์˜ˆ์‹œ๋กœ ๋’ท๋ฐ›์นจ๋˜์–ด ์žˆ์–ด, DeepLearningAI์˜ ๋†’์€ ํ’ˆ์งˆ ๊ธฐ์ค€์„ ์ถฉ์กฑํ•  ๊ฒƒ์ด๋ผ ํ™•์‹ ํ•ฉ๋‹ˆ๋‹ค.

 

gpt-3.5-turbo ๋‹ต๋ณ€

๋”๋ณด๊ธฐ
๋”ฅ๋Ÿฌ๋‹AI๊ฐ€ ์ œ๊ณตํ•œ ์‘๋‹ต์„ ์ฒ ์ €ํžˆ ๊ฒ€ํ† ํ•œ ํ›„, ๊ทธ๊ฒƒ๋“ค์ด ์™„์ „ํ•˜๊ณ  ์ •ํ™•ํ•˜๋ฉฐ ๊ณ ๊ฐ ์ง€์› ํ‘œ์ค€์— ๋ถ€ํ•ฉํ•œ๋‹ค๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
์‘๋‹ต์— ์‚ฌ์šฉ๋œ ์–ด์กฐ๋Š” ์ „๋ฌธ์ ์ด๋ฉฐ, ๊ณ ๊ฐ์˜ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋ชจ๋“  ๋ถ€๋ถ„์ด ์ฒ ์ €ํ•˜๊ฒŒ ๋‹ค๋ฃจ์–ด์ง€๊ณ  ์žˆ์œผ๋ฉฐ, ๋‹ต๋ณ€์„ ์ง€์›ํ•˜๊ธฐ ์œ„ํ•œ ์ ์ ˆํ•œ ์ฐธ์กฐ์™€ ์†Œ์Šค๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ตฌ์ฒด์ ์œผ๋กœ, CrewAI์—์„œ Crew ์„ค์ • ๋ฐ ์‹œ์ž‘์— ๋Œ€ํ•œ DeepLearningAI์˜ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์‘๋‹ต์€ ์ž์„ธํ•˜๊ณ  ํฌ๊ด„์ ์ž…๋‹ˆ๋‹ค. Crew์— ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ด€๋ จ ์‹ค์šฉ์ ์ธ ๋‹จ๊ณ„์™€ ์ฝ”๋“œ ์กฐ๊ฐ์ด ์ œ๊ณต๋˜์—ˆ์œผ๋ฉฐ, ๊ณ ๊ฐ์˜ ์š”๊ตฌ์™€ ๊ธฐ๋Œ€์— ๋ถ€ํ•ฉํ•ฉ๋‹ˆ๋‹ค. ํ’ˆ์งˆ ๋ณด์ฆ ์ „๋ฌธ๊ฐ€๋กœ์„œ, ์ด ์‘๋‹ต์ด ์šฐ๋ฆฌ ์กฐ์ง ๋‚ด ํ’ˆ์งˆ ๊ณ ๊ฐ ์ง€์› ์ƒํ˜ธ ์ž‘์šฉ ๋ฐ ์‘๋‹ต ๊ธฐ์ค€์„ ์ถฉ์กฑ์‹œํ‚จ๋‹ค๊ณ  ํ™•์‹ ํ•ฉ๋‹ˆ๋‹ค.

 

 

 ๋‘ ๋‹ต๋ณ€์˜ ์ฐจ์ด๋ฅผ ๋ณด๋ฉด ํ•œ๊ธ€ system prompt๋ฅผ ๋” ์ž˜ ์ดํ•ดํ•œ ๊ฒƒ์€ 4o๋กœ ์ตœ๊ทผ์— ๋‚˜์˜จ ๋ชจ๋ธ์ธ๋งŒํผ instruction์ด ์ž˜๋˜์–ด crewAI์˜ document๋ฅผ ์ž˜ ์ฐพ์•„์„œ ์˜ˆ์ œ๊นŒ์ง€ ๋ณด์—ฌ์ฃผ๋Š” ๋†€๋ผ์›€์„ ๋ณด์—ฌ ์ฃผ์—ˆ๋‹ค. ํ•˜์ง€๋งŒ 3.5-turbo๋Š” ์•„์‰ฝ๊ฒŒ๋„ prompt๋ฅผ ์ž˜ ์ดํ•ดํ•˜์ง€ ๋ชปํ•˜๊ณ  ๋‹ต๋ณ€์•ˆ์— instruction์„ ๊ทธ๋Œ€๋กœ ๋ณด์—ฌ์ฃผ์—ˆ๋‹ค. ํ•˜์ง€๋งŒ 3.5-turbo๋Š” ์•„์ง๊นŒ์ง€๋Š” 4o๋ณด๋‹ค ๋” ์ €๋ ดํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ„๋‹จํ•œ ์ž‘์—…์— ๋งŽ์ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค. 

 

 ์œ„ deeplearning AI์˜ crewAI ์˜ˆ์ œ๋ฅผ ํ†ตํ•ด RAG์™€ multi-agent๋ฅผ ํ†ตํ•ด prompt์˜ ํ€„๋ฆฌํ‹ฐ๋ฅผ ๋†’์ผ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„ ๋ณด์•˜๋‹ค.

 

 4o์˜ ๋‹ต๋ณ€์ด ๊ธฐ๋Œ€ ์ด์ƒ์ด๊ณ  ์ด๋ฒˆ์— ๊ฐœ์„ ๋œ ํ† ํฌ๋‚˜์ด์ €๋Š” ๊ธฐ์กด ํ•œ๊ธ€ ๋Œ€๋น„ 1.7๋ฐฐ๋‚˜ ์•„๋‚„ ์ˆ˜ ์žˆ์–ด ๋งŽ์ด ์‚ฌ์šฉ๋  ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.

  

๋ฐ˜์‘ํ˜•
๋‹คํ–ˆ๋‹ค