개요

에이전트가 Notion을 통해 페이지, 데이터베이스, 콘텐츠를 관리할 수 있도록 지원합니다. 페이지 생성 및 업데이트, 콘텐츠 블록 관리, 지식 베이스 구성, AI 기반 자동화를 통해 문서화 작업 흐름을 효율화할 수 있습니다.

필수 조건

Notion 통합을 사용하기 전에 다음을 확인하세요:

Notion 연동 설정

1. Notion 계정 연결하기

  1. CrewAI Enterprise Integrations로 이동합니다.
  2. 인증 통합(Auhtentication Integrations) 섹션에서 Notion을(를) 찾습니다.
  3. Connect를 클릭하고 OAuth 플로우를 완료합니다.
  4. 페이지 및 데이터베이스 관리를 위한 필요한 권한을 부여합니다.
  5. Account Settings에서 Enterprise Token을 복사합니다.

2. 필수 패키지 설치

uv add crewai-tools

사용 가능한 액션

사용 예시

기본 Notion Agent 설정

from crewai import Agent, Task, Crew
from crewai_tools import CrewaiEnterpriseTools

# Get enterprise tools (Notion tools will be included)
enterprise_tools = CrewaiEnterpriseTools(
    enterprise_token="your_enterprise_token"
)

# Create an agent with Notion capabilities
notion_agent = Agent(
    role="Documentation Manager",
    goal="Manage documentation and knowledge base in Notion efficiently",
    backstory="An AI assistant specialized in content management and documentation.",
    tools=[enterprise_tools]
)

# Task to create a meeting notes page
create_notes_task = Task(
    description="Create a new meeting notes page in the team database with today's date and agenda items",
    agent=notion_agent,
    expected_output="Meeting notes page created successfully with structured content"
)

# Run the task
crew = Crew(
    agents=[notion_agent],
    tasks=[create_notes_task]
)

crew.kickoff()

특정 Notion 도구 필터링

from crewai_tools import CrewaiEnterpriseTools

# Get only specific Notion tools
enterprise_tools = CrewaiEnterpriseTools(
    enterprise_token="your_enterprise_token",
    actions_list=["notion_create_page", "notion_update_block", "notion_search_pages"]
)

content_manager = Agent(
    role="Content Manager",
    goal="Create and manage content pages efficiently",
    backstory="An AI assistant that focuses on content creation and management.",
    tools=enterprise_tools
)

# Task to manage content workflow
content_workflow = Task(
    description="Create a new project documentation page and add structured content blocks for requirements and specifications",
    agent=content_manager,
    expected_output="Project documentation created with organized content sections"
)

crew = Crew(
    agents=[content_manager],
    tasks=[content_workflow]
)

crew.kickoff()

지식 베이스 관리

from crewai import Agent, Task, Crew
from crewai_tools import CrewaiEnterpriseTools

enterprise_tools = CrewaiEnterpriseTools(
    enterprise_token="your_enterprise_token"
)

knowledge_curator = Agent(
    role="Knowledge Curator",
    goal="Curate and organize knowledge base content in Notion",
    backstory="An experienced knowledge manager who organizes and maintains comprehensive documentation.",
    tools=[enterprise_tools]
)

# Task to curate knowledge base
curation_task = Task(
    description="""
    1. 새로운 제품 기능과 관련된 기존 문서 페이지를 검색합니다.
    2. 적절한 구조로 포괄적인 기능 문서 페이지를 생성합니다.
    3. 코드 예제, 이미지 및 관련 리소스에 대한 링크를 추가합니다.
    4. 기존 페이지를 업데이트하여 새 문서에 대한 교차 참조를 추가합니다.
    """,
    agent=knowledge_curator,
    expected_output="Feature documentation created and integrated with existing knowledge base"
)

crew = Crew(
    agents=[knowledge_curator],
    tasks=[curation_task]
)

crew.kickoff()

콘텐츠 구조 및 구성

from crewai import Agent, Task, Crew
from crewai_tools import CrewaiEnterpriseTools

enterprise_tools = CrewaiEnterpriseTools(
    enterprise_token="your_enterprise_token"
)

content_organizer = Agent(
    role="Content Organizer",
    goal="Organize and structure content blocks for optimal readability",
    backstory="An AI assistant that specializes in content structure and user experience.",
    tools=[enterprise_tools]
)

# Task to organize content structure
organization_task = Task(
    description="""
    1. Get content from existing project pages
    2. Analyze the structure and identify improvement opportunities
    3. Update content blocks to use proper headings, tables, and formatting
    4. Add table of contents and improve navigation between related pages
    5. Create templates for future documentation consistency
    """,
    agent=content_organizer,
    expected_output="Content reorganized with improved structure and navigation"
)

crew = Crew(
    agents=[content_organizer],
    tasks=[organization_task]
)

crew.kickoff()

자동화된 문서화 워크플로우

from crewai import Agent, Task, Crew
from crewai_tools import CrewaiEnterpriseTools

enterprise_tools = CrewaiEnterpriseTools(
    enterprise_token="your_enterprise_token"
)

doc_automator = Agent(
    role="Documentation Automator",
    goal="Automate documentation workflows and maintenance",
    backstory="An AI assistant that automates repetitive documentation tasks.",
    tools=[enterprise_tools]
)

# Complex documentation automation task
automation_task = Task(
    description="""
    1. 최근 30일 이내에 업데이트되지 않은 페이지 검색
    2. 오래된 콘텐츠 블록 검토 및 업데이트
    3. 일관된 포맷으로 주간 팀 업데이트 페이지 생성
    4. 프로젝트 페이지에 상태 표시기 및 진행 상황 추적 추가
    5. 월간 문서 헬스 리포트 생성
    6. 완료된 프로젝트 페이지를 아카이브 섹션에 정리 및 보관
    """,
    agent=doc_automator,
    expected_output="업데이트된 콘텐츠, 주간 리포트, 정리된 아카이브로 문서화 자동화 완료"
)

crew = Crew(
    agents=[doc_automator],
    tasks=[automation_task]
)

crew.kickoff()

문제 해결

일반적인 문제

권한 오류
  • Notion 계정이 대상 워크스페이스에 대한 편집 권한이 있는지 확인하세요
  • OAuth 연결에 Notion API에 필요한 범위가 포함되어 있는지 확인하세요
  • 페이지와 데이터베이스가 인증된 통합에 공유되어 있는지 확인하세요
잘못된 페이지 및 블록 ID
  • 페이지 ID 및 블록 ID가 올바른 UUID 형식인지 다시 확인하세요
  • 참조되는 페이지와 블록이 존재하고 접근 가능한지 확인하세요
  • 새 페이지를 생성할 때 상위 페이지 또는 데이터베이스 ID가 유효한지 검증하세요
속성 스키마 문제
  • 데이터베이스에 페이지를 생성할 때 페이지 속성이 데이터베이스 스키마와 일치하는지 확인하세요
  • 대상 데이터베이스에 대해 속성 이름과 타입이 올바른지 확인하세요
  • 페이지를 생성하거나 업데이트할 때 필수 속성이 포함되어 있는지 확인하세요
콘텐츠 블록 구조
  • 블록 콘텐츠가 Notion의 리치 텍스트 형식 사양을 따르는지 확인하세요
  • 중첩된 블록 구조가 올바르게 포맷되어 있는지 확인하세요
  • 미디어 URL이 접근 가능하며 올바른 형식인지 확인하세요
검색 및 필터 문제
  • 검색 쿼리가 올바르게 포맷되어 있고 비어 있지 않은지 확인하세요
  • 필터 공식에서 유효한 필드명을 사용하세요: query, filter.value, direction, page_size
  • 복잡한 필터 조건을 만들기 전에 간단한 검색을 테스트하세요
상위-하위 관계
  • 하위 페이지를 생성하기 전에 상위 페이지 또는 데이터베이스가 존재하는지 확인하세요
  • 상위 컨테이너에 대한 적절한 권한이 있는지 확인하세요
  • 데이터베이스 스키마가 설정하려는 속성을 허용하는지 확인하세요
리치 텍스트 및 미디어 콘텐츠
  • 외부 이미지, PDF, 북마크의 URL이 접근 가능한지 확인하세요
  • 리치 텍스트 포매팅이 Notion의 API 사양을 따르는지 확인하세요
  • 코드 블록의 언어 타입이 Notion에서 지원되는지 확인하세요
아카이브 및 삭제 작업
  • 아카이브(복구 가능)와 삭제(영구적)의 차이를 이해하세요
  • 대상 콘텐츠를 아카이브 또는 삭제할 수 있는 권한이 있는지 확인하세요
  • 여러 페이지 또는 블록에 영향을 줄 수 있는 대량 작업은 신중히 진행하세요

도움 받기

도움이 필요하신가요?

Notion 연동 설정 또는 문제 해결에 대해 지원팀에 문의해 주세요.