From 9018e2ab6a5dbf78774c35b874c6054e3ea383f3 Mon Sep 17 00:00:00 2001 From: Rip&Tear <84775494+theCyberTech@users.noreply.github.com> Date: Sun, 28 Jul 2024 22:55:09 +0800 Subject: [PATCH] Docs update (#1008) * Updated Docs: New Getting started section + content update / addition * fixed indentation issue * Minor updates to fix typos --------- Co-authored-by: theCyberTech --- .../Installing-CrewAI.md | 3 + ...t-a-New-CrewAI-Project-Template-Method.md} | 55 +++++++++++- .../how-to/Creating-a-Crew-and-kick-it-off.md | 84 ------------------- docs/index.md | 13 +++ 4 files changed, 68 insertions(+), 87 deletions(-) rename docs/{how-to => getting-started}/Installing-CrewAI.md (91%) rename docs/{how-to/Start-a-New-CrewAI-Project.md => getting-started/Start-a-New-CrewAI-Project-Template-Method.md} (65%) delete mode 100644 docs/how-to/Creating-a-Crew-and-kick-it-off.md diff --git a/docs/how-to/Installing-CrewAI.md b/docs/getting-started/Installing-CrewAI.md similarity index 91% rename from docs/how-to/Installing-CrewAI.md rename to docs/getting-started/Installing-CrewAI.md index 5a347df322..8bf58ee015 100644 --- a/docs/how-to/Installing-CrewAI.md +++ b/docs/getting-started/Installing-CrewAI.md @@ -18,4 +18,7 @@ pip install crewai # Install the main crewAI package and the tools package # that includes a series of helpful tools for your agents pip install 'crewai[tools]' + +# Alternatively, you can also use: +pip install crewai crewai-tools ``` \ No newline at end of file diff --git a/docs/how-to/Start-a-New-CrewAI-Project.md b/docs/getting-started/Start-a-New-CrewAI-Project-Template-Method.md similarity index 65% rename from docs/how-to/Start-a-New-CrewAI-Project.md rename to docs/getting-started/Start-a-New-CrewAI-Project-Template-Method.md index 9fb5cb63c2..0e6fcc4468 100644 --- a/docs/how-to/Start-a-New-CrewAI-Project.md +++ b/docs/getting-started/Start-a-New-CrewAI-Project-Template-Method.md @@ -1,5 +1,5 @@ --- -title: Starting a New CrewAI Project +title: Starting a New CrewAI Project - Using Template description: A comprehensive guide to starting a new CrewAI project, including the latest updates and project setup methods. --- @@ -7,13 +7,62 @@ description: A comprehensive guide to starting a new CrewAI project, including t Welcome to the ultimate guide for starting a new CrewAI project. This document will walk you through the steps to create, customize, and run your CrewAI project, ensuring you have everything you need to get started. +Beforre we start there are a couple of things to note: + +1. CrewAI is a Python package and requires Python >=3.10 and <=3.13 to run. +2. The preferred way of setting up CrewAI is using the `crewai create` command.This will create a new project folder and install a skeleton template for you to work on. + ## Prerequisites -We assume you have already installed CrewAI. If not, please refer to the [installation guide](https://docs.crewai.com/how-to/Installing-CrewAI/) to install CrewAI and its dependencies. +Before getting started with CrewAI, make sure that you have installed it via pip: + +```shell +$ pip install crewai crewi-tools +``` + +### Virtual Environemnts +It is highly recommended that you use virtual environments to ensure that your CrewAI project is isolated from other projects and dependencies. Virtual environments provide a clean, separate workspace for each project, preventing conflicts between different versions of packages and libraries. This isolation is crucial for maintaining consistency and reproducibility in your development process. You have multiple options for setting up virtual environments depending on your operating system and Python version: + +1. Use venv (Python's built-in virtual environment tool): + venv is included with Python 3.3 and later, making it a convenient choice for many developers. It's lightweight and easy to use, perfect for simple project setups. + + To set up virtual environments with venv, refer to the official [Python documentation](https://docs.python.org/3/tutorial/venv.html). + +2. Use Conda (A Python virtual environment manager): + Conda is an open-source package manager and environment management system for Python. It's widely used by data scientists, developers, and researchers to manage dependencies and environments in a reproducible way. + + To set up virtual environments with Conda, refer to the official [Conda documentation](https://docs.conda.io/projects/conda/en/stable/user-guide/getting-started.html). + +3. Use Poetry (A Python package manager and dependency management tool): + Poetry is an open-source Python package manager that simplifies the installation of packages and their dependencies. Poetry offers a convenient way to manage virtual environments and dependencies. + Poetry is CrewAI's prefered tool for package / dependancy management in CrewAI. + +### Code IDEs + +Most users of CrewAI a Code Editor / Integrated Development Environment (IDE) for building there Crews. You can use any code IDE of your choice. Seee below for some popular options for Code Editors / Integrated Development Environments (IDE): + +- [Visual Studio Code](https://code.visualstudio.com/) - Most popular +- [PyCharm](https://www.jetbrains.com/pycharm/) +- [Cursor AI](https://cursor.com) + +Pick one that suits your style and needs. ## Creating a New Project +In this example we will be using Venv as our virtual environment manager. + +To setup a virtual environment, run the following CLI command: + +```shell +$ python3 -m venv +``` + +Activate your virtual environment by running the following CLI command: + +```shell +$ source /bin/activate +``` -To create a new project, run the following CLI command: +Now, to create a new CrewAI project, run the following CLI command: ```shell $ crewai create diff --git a/docs/how-to/Creating-a-Crew-and-kick-it-off.md b/docs/how-to/Creating-a-Crew-and-kick-it-off.md deleted file mode 100644 index 7200d75d4f..0000000000 --- a/docs/how-to/Creating-a-Crew-and-kick-it-off.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: Assembling and Activating Your CrewAI Team -description: A comprehensive guide to creating a dynamic CrewAI team for your projects, with updated functionalities including verbose mode, memory capabilities, asynchronous execution, output customization, language model configuration, code execution, integration with third-party agents, and improved task management. ---- - -## 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, including code execution capabilities, integration with third-party agents, and advanced task management. - -## Step 0: Installation -Install CrewAI and any necessary packages for your project. CrewAI is compatible with Python >=3.10,<=3.13. - -```shell -pip install crewai -pip install 'crewai[tools]' -``` - -## Step 1: Assemble Your Agents -Define your agents with distinct roles, backstories, and enhanced capabilities. The Agent class now supports a wide range of attributes for fine-tuned control over agent behavior and interactions, including code execution and integration with third-party agents. - -```python -import os -from langchain.llms import OpenAI -from crewai import Agent -from crewai_tools import SerperDevTool, BrowserbaseLoadTool, EXASearchTool - -os.environ["OPENAI_API_KEY"] = "Your OpenAI Key" -os.environ["SERPER_API_KEY"] = "Your Serper Key" -os.environ["BROWSERBASE_API_KEY"] = "Your BrowserBase Key" -os.environ["BROWSERBASE_PROJECT_ID"] = "Your BrowserBase Project Id" - -search_tool = SerperDevTool() -browser_tool = BrowserbaseLoadTool() -exa_search_tool = EXASearchTool() - -# Creating a senior researcher agent with advanced configurations -researcher = Agent( - role='Senior Researcher', - goal='Uncover groundbreaking technologies in {topic}', - backstory=("Driven by curiosity, you're at the forefront of innovation, " - "eager to explore and share knowledge that could change the world."), - memory=True, - verbose=True, - allow_delegation=False, - tools=[search_tool, browser_tool], - allow_code_execution=False, # New attribute for enabling code execution - max_iter=15, # Maximum number of iterations for task execution - max_rpm=100, # Maximum requests per minute - max_execution_time=3600, # Maximum execution time in seconds - system_template="Your custom system template here", # Custom system template - prompt_template="Your custom prompt template here", # Custom prompt template - response_template="Your custom response template here", # Custom response template -) - -# Creating a writer agent with custom tools and specific configurations -writer = Agent( - role='Writer', - goal='Narrate compelling tech stories about {topic}', - backstory=("With a flair for simplifying complex topics, you craft engaging " - "narratives that captivate and educate, bringing new discoveries to light."), - verbose=True, - allow_delegation=False, - memory=True, - tools=[exa_search_tool], - function_calling_llm=OpenAI(model_name="gpt-3.5-turbo"), # Separate LLM for function calling -) - -# Setting a specific manager agent -manager = Agent( - role='Manager', - goal='Ensure the smooth operation and coordination of the team', - verbose=True, - backstory=( - "As a seasoned project manager, you excel in organizing " - "tasks, managing timelines, and ensuring the team stays on track." - ), - allow_code_execution=True, # Enable code execution for the manager -) -``` - -### New Agent Attributes and Features - -1. `allow_code_execution`: Enable or disable code execution capabilities for the agent (default is False). -2. `max_execution_time`: Set a maximum execution time (in seconds) for the agent to complete a task. -3. `function_calling_llm`: Specify a separate language model for function calling. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 77cdd9852c..003df16d0b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,6 +5,19 @@ Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
+

Core Concepts