CrewAI - Your Own Team of Autonomous Agents



AI Summary

Summary: Crew AI Overview

  • Introduction to Crew AI
    • Open-source project for orchestrating autonomous AI agents.
    • Similar to Microsoft’s AutoGen but easier to use and production-oriented.
    • Trending on Product Hunt with over 4,000 GitHub stars.
  • How Crew AI Works
    • Role-based agent design with each agent as an LLM (Large Language Model) with specific tools and tasks.
    • Agents collaborate to complete tasks as a team.
    • Compatible with both open-source and proprietary LLMs.
  • Using Crew AI in Google Colab
    • Tutorial on setting up Crew AI in a Google Colab notebook for free.
    • Installation of necessary packages including Crew AI, DuckDuckGo search, and Langchain Google generative AI.
    • Importing OS package and setting up Gemini Pro LLM for the example.
  • Setting Up Agents and Tasks
    • Define agent roles, goals, and backstories.
    • Assign LLMs and tools to agents.
    • Create tasks for agents to perform.
    • Form a crew with agents and assign tasks for sequential execution.
  • Execution and Results
    • Crew AI uses Langchain for internal processing.
    • Agents consider whether to use tools and execute actions accordingly.
    • Example output includes a report and a blog post draft, with some inaccuracies noted.
  • Conclusion
    • Crew AI is under active development with potential for future enhancements.
    • Encourages feedback on autonomous AI agent frameworks.

Example Code Usage in Google Colab

# Install packages  
!pip install crew-ai duckduckgo-search lang-chain-google-generative-ai  
  
# Import packages  
import os  
from crew_ai import Agent, Task, Crew, Process  
  
# Define agents with roles, goals, and backstories  
researcher = Agent(role='Senior Research Analyst', goal='Uncover AI developments', backstory='...', tools=[search_tool], llm='Gemini Pro')  
writer = Agent(role='Writer', goal='Develop engaging blog post', backstory='...', tools=[], llm='Gemini Pro')  
  
# Define tasks  
task_analysis = Task(description='Analyze AI advancements in 2024', agent_role='Researcher')  
task_blog_post = Task(description='Write blog post on AI advancements', agent_role='Writer')  
  
# Create crew and assign tasks  
crew = Crew(agents=[researcher, writer], tasks=[task_analysis, task_blog_post])  
  
# Execute tasks  
crew.execute()  
  • Note: The above code is a simplified representation based on the provided text and does not include all details such as API keys or specific package functions.