3 个 AI Agent 协作研究:搜索员抓信息、分析员综合、撰稿人写报告。

适用场景

Research teams, content creators, and analysts who need comprehensive research reports on any topic.

前提条件

Python 3.10+, CrewAI installed, OpenAI API key, optional search API key (SerperDev)

工作流图

用 CrewAI 搭建多 Agent 研究团队

Install CrewAI
Define the Researcher Agent
Define the Analyst Agent
Define the Writer Agent
Run the Crew

分步指南

  1. 1

    Install CrewAI

    pip install crewai. Create a new project. Define your agents in a crew.py file. CrewAI uses a simple YAML or Python config for agent definition.

  2. 2

    Define the Researcher Agent

    Create an agent with role: Researcher, goal: Find comprehensive information about the topic, backstory: Expert researcher with 10 years experience. Assign it a search tool (SerperDev, Google, or DuckDuckGo).

  3. 3

    Define the Analyst Agent

    Role: Analyst, goal: Synthesize research findings and identify key insights and gaps, backstory: Data analyst who excels at finding patterns. This agent receives the Researcher output and processes it.

  4. 4

    Define the Writer Agent

    Role: Writer, goal: Produce a clear, well-structured report from the analysis, backstory: Professional writer with expertise in making complex topics accessible. This agent receives the Analyst output.

  5. 5

    Run the Crew

    crew.kickoff(inputs={topic: your topic}). The agents execute in order: Researcher searches, Analyst processes, Writer formats. Review the final output and iterate on agent definitions for better results.

标签

#crewai#multi-agent#research#collaboration