본문 바로가기
AI 활용/Working!!

CrewAI 웹 번역기

by 좋아좋아브라이언 2026. 2. 7.

서핑하다가 알게된 CrewAI... 바이브 코딩으로 어떤 구조로 돌아가는지 보고... 알아가보자

하루 하루가 알아야 할 것들이 많네..

CrewAI 웹 번역기 (Ollama 연동)

이 애플리케이션은 CrewAI 에이전트를 사용하여 웹사이트 콘텐츠(하위 디렉토리 포함)를 크롤링하고 한국어 마크다운 형식으로 번역해주는 Streamlit 기반 도구입니다.

주요 특징

  • 로컬 LLM 연동: OpenAI API 대신 로컬 Ollama 모델을 활용하여 보안과 효율성을 높였습니다.
    • gemma3:12b: 추론 및 계획용. 웹사이트 구조를 분석하고 데이터 추출 전략을 수립하는 '웹 크롤러' 에이전트가 사용합니다.
    • translategemma:latest: 번역 전용. 추출된 텍스트를 고품질 한국어로 번역하고 마크다운 형식을 유지하는 '번역가' 에이전트가 사용합니다.
  • 에이전트 협업: 각 역할에 최적화된 모델을 장착한 에이전트들이 순차적으로 작업을 수행합니다.
  • 실시간 진행률: 크롤링이 완료되면 즉시 원본 텍스트를 확인할 수 있는 실시간 상태 업데이트 기능을 지원합니다.
  • 한글 인터페이스: 모든 UI와 출력 결과가 한국어에 최적화되어 있습니다.

프로젝트 구조

  • app.py: Streamlit 프론트엔드 및 실시간 상태 표시 로직.
  • src/:
    • crew.py: CrewAI 에이전트 및 작업 오케스트레이션.
    • agents.py: 에이전트 정의 (Ollama 모델 설정 포함).
    • tasks.py: 크롤링 및 번역 작업 정의 (콜백 지원).
    • tools.py: custom_scrape_tool (웹 크로링 도구).
  • pyproject.toml: 프로젝트 설정 및 litellm, fastapi, apscheduler 등 의존성 관리.

작동 원리 (Architecture)

구성 요소 상세 설명

  • Crew (TranslationCrew): 애플리케이션의 오케스트레이터입니다. 에이전트와 태스크를 하나로 묶고, 작업이 순차적으로(Sequential) 진행되도록 관리합니다.
  • Agent (에이전트):
    • 웹 크롤러: 웹사이트를 탐색하고 데이터를 읽어오는 수집 전문가입니다 (gemma3:12b 사용).
    • 번역가: 수집된 데이터를 한국어 마크다운으로 변환하는 언어 전문가입니다 (translategemma 사용).
  • Task (작업):
    • Crawl Task: 특정 URL에서 텍스트를 추출하는 구체적인 작업 지시서입니다.
    • Translate Task: 크롤링된 텍스트를 한국어로 번역하는 작업 지시서입니다.
  • Tool (도구):
    • custom_scrape_tool: 웹 크롤러 에이전트가 실제로 웹사이트에 접속하여 HTML을 긁어오기 위해 사용하는 도구입니다.
graph TD
    UI[Streamlit UI] -- URL 입력 -- Core[TranslationCrew]

    subgraph "CrewAI Orchestration (Sequential Process)"
        Core -- 1. Task 할당 -- T1[Crawl Task]
        Core -- 2. Task 할당 -- T2[Translate Task]

        T1 -- 수행 -- A1["Agent: 웹 크롤러 (gemma3:12b)"]
        T2 -- 수행 -- A2["Agent: 번역가 (translategemma)"]

        A1 -- "도구 사용 (URL)" -- Tool[custom_scrape_tool]
        Tool -- 결과 반환 -- A1

        A1 -- "추출된 텍스트" -- T1
        T1 -- "컨텍스트 전달" -- T2

        A2 -- "한국어 번역 (Markdown)" -- T2
    end

    T2 -- "최종 결과 반환" -- UI
    A1 -- "중간 상태 업데이트 (Callback)" -- UI

 

실행 결과

 

 

실행로그

[2026-02-08 20:43:17] Crew Start: 번역 프로세스 시작
[2026-02-08 20:43:28] [웹 크롤러] Action: ToolResult(result='Data from https://blog.crewai.com/lessons-from-2-billion-agentic-workflows:\nLessons From 2 Billion Agentic Workflows Home Docs Open Source Enterprise Sign in Subscribe Lessons From...
[2026-02-08 20:43:28] [웹 크롤러] Thinking: Thought: I need to start by scraping the main URL to get the initial content. Then, I'll need to analyze the structure to find immediate subdirectories and scrape their content as well. Finally, I'll combine all the scraped content into a single document.
[2026-02-08 20:43:49] [웹 크롤러] Action: ToolResult(result='Data from https://blog.crewai.com/lessons-from-2-billion-agentic-workflows#/portal/signin:\nLessons From 2 Billion Agentic Workflows Home Docs Open Source Enterprise Sign in Subscri...
[2026-02-08 20:43:49] [웹 크롤러] Thinking: Thought: I have scraped the main URL and several subdirectories. Now I need to combine the content into a single document and present it as the Final Answer.
[2026-02-08 20:45:27] [웹 크롤러] Thinking: Thought: I now know the final answer. I have extracted the content from the main URL and the subdirectories. Now I need to combine them into a single response.
[2026-02-08 20:45:27] Task Complete: 크롤링 완료
[2026-02-08 20:46:05] [번역가] Action: ## 20억 건의 에이전트 워크플로우를 통한 교훈...
[2026-02-08 20:46:06] Task Complete: 번역 완료
[2026-02-08 20:46:06] Crew End: 번역 프로세스 종료

 

Agent 로그

╭─── 🚀 Crew Execution Started ────╮

│ │

│ Crew Execution Started │

│ Name: │

│ crew │

│ ID: │

│ 75cd7350-8355-4028-b1ff-41572c │

│ 77e8d4 │

│ │

│ │

╰──────────────────────────────────╯

╭──────── 📋 Task Started ─────────╮

│ │

│ Task Started │

│ Name: Crawl the following URL: │

https://blog.crewai.com/lesson

│ s-from-2-billion-agentic-workf │

│ lows/. Extract the main │

│ content and content from up to │

│ 5 immediate subdirectories. │

│ Ensure that the text is clean │

│ and relevant. │

│ ID: │

│ 8e4f0fcc-1dc7-4953-851e-e46d02 │

│ aa515f │

│ │

│ │

╰──────────────────────────────────╯

╭──────── 🤖 Agent Started ────────╮

│ │

│ Agent: 웹 크롤러 │

│ │

│ Task: Crawl the following URL: │

https://blog.crewai.com/lesson

│ s-from-2-billion-agentic-workf │

│ lows/. Extract the main │

│ content and content from up to │

│ 5 immediate subdirectories. │

│ Ensure that the text is clean │

│ and relevant. │

│ │

╰──────────────────────────────────╯

╭─ 🔧 Tool Execution Started (#1) ─╮

│ │

│ Tool: custom_scrape_tool │

│ Args: {"url": │

│ "https://blog.crewai.com/lesso

│ ns-from-2-billion-agentic-work │

│ flows/"} │

│ │

│ │

╰──────────────────────────────────╯

DEBUG: Scrapping URL: https://blog.crewai.com/lessons-from-2-billion-agentic-workflows

DEBUG: Main page scraped, length: 9777

DEBUG: Found 2 sublinks

DEBUG: Scrapping sublink: https://blog.crewai.com/lessons-from-2-billion-agentic-workflows#/portal/signin

DEBUG: Scrapping sublink: https://blog.crewai.com/lessons-from-2-billion-agentic-workflows#/portal/signup

╭─ ✅ Tool Execution Completed (#1─╮

│ │

│ Tool Completed │

│ Tool: custom_scrape_tool │

│ Output: Data from │

https://blog.crewai.com/lesson

│ s-from-2-billion-agentic-workf │

│ lows: │

│ Lessons From 2 Billion Agentic │

│ Workflows Home Docs Open │

│ Source Enterprise Sign in │

│ Subscribe Lessons From 2 │

│ Billion Agentic Workflows Most │

│ teams get stuck between │

│ "working demo" and "production │

╭───── ✅ Agent Final Answer ──────╮

│ │

│ Agent: 웹 크롤러 │

│ │

│ Final Answer: │

│ Lessons From 2 Billion Agentic │

│ Workflows Home Docs Open │

│ Source Enterprise Sign in │

│ Subscribe Lessons From 2 │

│ Billion Agentic Workflows Most │

│ teams get stuck between │

│ "working demo" and "production │

│ system." After watching │

╭─────── 📋 Task Completion ───────╮

│ │

│ Task Completed │

│ Name: │

│ Crawl the following URL: │

https://blog.crewai.com/lesson

│ s-from-2-billion-agentic-workf │

│ lows/. Extract the main │

│ content and content from up to │

│ 5 immediate subdirectories. │

│ Ensure that the text is clean │

│ and relevant. │

│ Agent: │

│ 웹 크롤러 │

│ │

│ │

╰──────────────────────────────────╯

╭──────── 📋 Task Started ─────────╮

│ │

│ Task Started │

│ Name: Translate the extracted │

│ text into Korean. Format the │

│ output as a well-structured │

│ Markdown document. Ensure │

│ headings, lists, and code │

│ blocks are preserved. │

│ ID: │

│ e6bb05a9-f9cc-4b06-94c9-ba2a6e │

│ 04313d │

│ │

│ │

╰──────────────────────────────────╯

╭──────── 🤖 Agent Started ────────╮

│ │

│ Agent: 번역가 │

│ │

│ Task: Translate the extracted │

│ text into Korean. Format the │

│ output as a well-structured │

│ Markdown document. Ensure │

│ headings, lists, and code │

│ blocks are preserved. │

│ │

╰──────────────────────────────────╯

╭───── ✅ Agent Final Answer ──────╮

│ │

│ Agent: 번역가 │

│ │

│ Final Answer: │

│ ## 20억 건의 에이전트 │

│ 워크플로우에서 얻은 교훈: 홈 │

│ 문서 │

╭─────── 📋 Task Completion ───────╮

│ │

│ Task Completed │

│ Name: │

│ Translate the extracted text │

│ into Korean. Format the output │

│ as a well-structured Markdown │

│ document. Ensure headings, │

│ lists, and code blocks are │

│ preserved. │

│ Agent: │

│ 번역가 │

│ │

│ │

╰──────────────────────────────────╯

╭──────── Crew Completion ─────────╮

│ │

│ Crew Execution Completed │

│ Name: │

│ crew │

│ ID: │

│ 75cd7350-8355-4028-b1ff-41572c │

│ 77e8d4 │

│ Final Output: ## 20억 건의 │

│ 에이전트 워크플로우에서 얻은 │

│ 교훈: 홈 문서 │

│ │

'AI 활용 > Working!!' 카테고리의 다른 글

YouTube 요약 AI 서비스  (0) 2026.02.08