FAQs
Frequently asked questions about CrewAI Enterprise
In the hierarchical process, a manager agent is automatically created and coordinates the workflow, delegating tasks and validating outcomes for streamlined and effective execution. The manager agent utilizes tools to facilitate task delegation and execution by agents under the manager’s guidance. The manager LLM is crucial for the hierarchical process and must be set up correctly for proper function.
The most up-to-date documentation for CrewAI is available on our official documentation website; https://docs.crewai.com/
Hierarchical Process:
Tasks are delegated and executed based on a structured chain of command.
A manager language model (manager_llm
) must be specified for the manager agent.
Manager agent oversees task execution, planning, delegation, and validation.
Tasks are not pre-assigned; the manager allocates tasks to agents based on their capabilities.
Sequential Process:
Tasks are executed one after another, ensuring tasks are completed in an orderly progression. Output of one task serves as context for the next. Task execution follows the predefined order in the task list.
Which Process is Better Suited for Complex Projects?
The hierarchical process is better suited for complex projects because it allows for:
- Dynamic task allocation and delegation: Manager agent can assign tasks based on agent capabilities, allowing for efficient resource utilization.
- Structured validation and oversight: Manager agent reviews task outputs and ensures task completion, increasing reliability and accuracy.
- Complex task management: Assigning tools at the agent level allows for precise control over tool availability, facilitating the execution of intricate tasks.
- Adaptive Learning: Crews become more efficient over time, adapting to new information and refining their approach to tasks.
- Enhanced Personalization: Memory enables agents to remember user preferences and historical interactions, leading to personalized experiences.
- Improved Problem Solving: Access to a rich memory store aids agents in making more informed decisions, drawing on past learnings and contextual insights.
Setting a maximum RPM limit for an agent prevents the agent from making too many requests to external services, which can help to avoid rate limits and improve performance.
It allows agents to request additional information or clarification when necessary. This feature is crucial in complex decision-making processes or when agents require more details to complete a task effectively.
To integrate human input into agent execution, set the human_input
flag in the task definition. When enabled, the agent prompts the user for input before delivering its final answer.
This input can provide extra context, clarify ambiguities, or validate the agent’s output.
CrewAI provides a range of advanced customization options to tailor and enhance agent behavior and capabilities:
-
Language Model Customization: Agents can be customized with specific language models (
llm
) and function-calling language models (function_calling_llm
), offering advanced control over their processing and decision-making abilities. -
Performance and Debugging Settings: Adjust an agent’s performance and monitor its operations for efficient task execution.
-
Verbose Mode: Enables detailed logging of an agent’s actions, useful for debugging and optimization.
-
RPM Limit: Sets the maximum number of requests per minute (
max_rpm
). -
Maximum Iterations for Task Execution: The
max_iter
attribute allows users to define the maximum number of iterations an agent can perform for a single task, preventing infinite loops or excessively long executions. -
Delegation and Autonomy: Control an agent’s ability to delegate or ask questions, tailoring its autonomy and collaborative dynamics within the CrewAI framework. By default, the
allow_delegation
attribute is set to True, enabling agents to seek assistance or delegate tasks as needed. This default behavior promotes collaborative problem-solving and efficiency within the CrewAI ecosystem. If needed, delegation can be disabled to suit specific operational requirements. -
Human Input in Agent Execution: Human input is critical in several agent execution scenarios, allowing agents to request additional information or clarification when necessary. This feature is especially useful in complex decision-making processes or when agents require more details to complete a task effectively.
Human input is particularly useful in agent execution when:
- Agents require additional information or clarification: When agents encounter ambiguity or incomplete data, human input can provide the necessary context to complete the task effectively.
- Agents need to make complex or sensitive decisions: Human input can assist agents in ethical or nuanced decision-making, ensuring responsible and informed outcomes.
- Oversight and validation of agent output: Human input can help validate the results generated by agents, ensuring accuracy and preventing any misinterpretation or errors.
- Customizing agent behavior: Human input can provide feedback on agent responses, allowing users to refine the agent’s behavior and responses over time.
- Identifying and resolving errors or limitations: Human input can help identify and address any errors or limitations in the agent’s capabilities, enabling continuous improvement and optimization.
The different types of memory available in CrewAI are:
short-term memory
long-term memory
entity memory
contextual memory
Learn more about the different types of memory here:
To use Output Pydantic in a task, you need to define the expected output of the task as a Pydantic model. Here’s an example:
Define a Pydantic model
First, you need to define a Pydantic model. For instance, let’s create a simple model for a user:
from pydantic import BaseModel
class User(BaseModel):
name: str
age: int
Then, when creating a task, specify the expected output as this Pydantic model:
from crewai import Task, Crew, Agent
# Import the User model
from my_models import User
# Create a task with Output Pydantic
task = Task(
description="Create a user with the provided name and age",
expected_output=User, # This is the Pydantic model
agent=agent,
tools=[tool1, tool2]
)
In your agent, make sure to set the output_pydantic attribute to the Pydantic model you're using:
from crewai import Agent
# Import the User model
from my_models import User
# Create an agent with Output Pydantic
agent = Agent(
role='User Creator',
goal='Create users',
backstory='I am skilled in creating user accounts',
tools=[tool1, tool2],
output_pydantic=User
)
When executing the crew, the output of the task will be a User object:
from crewai import Crew
# Create a crew with the agent and task
crew = Crew(agents=[agent], tasks=[task])
# Kick off the crew
result = crew.kickoff()
# The output of the task will be a User object
print(result.tasks[0].output)
Here’s a tutorial on how to consistently get structured outputs from your agents:
You can create custom tools by subclassing the BaseTool
class provided by CrewAI or by using the tool decorator. Subclassing involves defining a new class that inherits from BaseTool
, specifying the name, description, and the _run
method for operational logic. The tool decorator allows you to create a Tool
object directly with the required attributes and a functional logic.
Click here for more details:
This guide explains how to start a crew directly from Slack using the CrewAI integration.
Prerequisites:
- CrewAI integration installed and connected to your Slack workspace
- At least one crew configured in CrewAI
Steps:
Ensure the CrewAI Slack integration is set up
In the CrewAI dashboard, navigate to the Integrations section.
Verify that Slack is listed and is connected.
Open your Slack channel
- Navigate to the channel where you want to kickoff the crew.
- Type the slash command “/kickoff” to initiate the crew kickoff process.
- You should see a “Kickoff crew” appear as you type:
- Press Enter or select the “Kickoff crew” option. A dialog box titled “Kickoff an AI Crew” will appear.
Select the crew you want to start
- In the dropdown menu labeled “Select of the crews online:”, choose the crew you want to start.
- In the example below, “prep-for-meeting” is selected:
- If your crew requires any inputs, click the “Add Inputs” button to provide them.
The “Add Inputs” button is shown in the example above but is not yet clicked.
Click Kickoff and wait for the crew to complete
- Once you’ve selected the crew and added any necessary inputs, click “Kickoff” to start the crew.
- The crew will start executing and you will see the results in the Slack channel.
-
Make sure you have the necessary permissions to use the
/kickoff
command in your Slack workspace. -
If you don’t see your desired crew in the dropdown, ensure it’s properly configured and online in CrewAI.
Click on the ellipsis (three dots on the right of your deployed crew) and select the export option and save the file locally. We will be using CrewLead.jsx
for our example.
To run this React component locally, you’ll need to set up a React development environment and integrate this component into a React project. Here’s a step-by-step guide to get you started:
Install Node.js
- Download and install Node.js from the official website: https://nodejs.org/
- Choose the LTS (Long Term Support) version for stability.
Create a new React project
-
Open Command Prompt or PowerShell
-
Navigate to the directory where you want to create your project
-
Run the following command to create a new React project:
npx create-react-app my-crew-app
-
Change into the project directory:
cd my-crew-app
Install necessary dependencies
npm install react-dom
Create the CrewLead component
- Move the downloaded file
CrewLead.jsx
into thesrc
folder of your project,
Modify your `App.js` to use the `CrewLead` component
- Open
src/App.js
- Replace its contents with something like this:
import React from 'react';
import CrewLead from './CrewLead';
function App() {
return (
<div className="App">
<CrewLead baseUrl="YOUR_API_BASE_URL" bearerToken="YOUR_BEARER_TOKEN" />
</div>
);
}
export default App;
- Replace
YOUR_API_BASE_URL
andYOUR_BEARER_TOKEN
with the actual values for your API.
Start the development server
-
In your project directory, run:
npm start
-
This will start the development server, and your default web browser should open automatically to http://localhost:3000, where you’ll see your React app running.
You can then customise the CrewLead.jsx
to add color, title etc
As an administrator of a CrewAI Enterprise account, you can easily invite new team members to join your organization. This article will guide you through the process step-by-step.
Access the Settings Page
- Log in to your CrewAI Enterprise account
- Look for the gear icon (⚙️) in the top right corner of the dashboard
- Click on the gear icon to access the Settings page:
Navigate to the Members Section
- On the Settings page, you’ll see a
General configuration
header - Below this, find and click on the
Members
tab
Invite New Members
- In the Members section, you’ll see a list of current members (including yourself)
- At the bottom of the list, locate the
Email
input field - Enter the email address of the person you want to invite
- Click the
Invite
button next to the email field
Repeat as Needed
- You can repeat this process to invite multiple team members
- Each invited member will receive an email invitation to join your organization
Important Notes
- Only users with administrative privileges can invite new members
- Ensure you have the correct email addresses for your team members
- Invited members will need to accept the invitation to join your organization
- You may want to inform your team members to check their email (including spam folders) for the invitation
By following these steps, you can easily expand your team and collaborate more effectively within your CrewAI Enterprise organization.
CrewAI Enterprise allows you to automate your workflow using webhooks. This article will guide you through the process of setting up and using webhooks to kickoff your crew execution, with a focus on integration with ActivePieces, a workflow automation platform similar to Zapier and Make.com. We will be setting up webhooks in the CrewAI Enterprise UI.
Accessing the Kickoff Interface
- Navigate to the CrewAI Enterprise dashboard
- Look for the
/kickoff
section, which is used to start the crew execution
Configuring the JSON Content
In the JSON Content section, you’ll need to provide the following information:
- inputs: A JSON object containing:
company
: The name of the company (e.g., “tesla”)product_name
: The name of the product (e.g., “crewai”)form_response
: The type of response (e.g., “financial”)icp_description
: A brief description of the Ideal Customer Profileproduct_description
: A short description of the producttaskWebhookUrl
,stepWebhookUrl
,crewWebhookUrl
: URLs for various webhook endpoints (ActivePieces, Zapier, Make.com or another compatible platform)
Integrating with ActivePieces
In this example we will be using ActivePieces. You can use other platforms such as Zapier and Make.com
To integrate with ActivePieces:
-
Set up a new flow in ActivePieces
-
Add a trigger (e.g.,
Every Day
schedule) -
Add an HTTP action step
-
Set the action to
Send HTTP request
-
Use
POST
as the method -
Set the URL to your CrewAI Enterprise kickoff endpoint
-
Add necessary headers (e.g.,
Bearer Token
) -
In the body, include the JSON content as configured in step 2
-
The crew will then kickoff at the pre-defined time.
-
Setting Up the Webhook
-
Create a new flow in ActivePieces and name it
-
Add a webhook step as the trigger:
-
Select
Catch Webhook
as the trigger type -
This will generate a unique URL that will receive HTTP requests and trigger your flow
-
Configure the email to use crew webhook body text
-
Generated output
-
stepWebhookUrl
- Callback that will be executed upon each agent inner thought{ "action": "**Preliminary Research Report on the Financial Industry for crewai Enterprise Solution**\n1. Industry Overview and Trends\nThe financial industry in ....\nConclusion:\nThe financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.", "task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0" }
-
taskWebhookUrl
- Callback that will be executed upon the end of each task{ "description": "Using the information gathered from the lead's data, conduct preliminary research on the lead's industry, company background, and potential use cases for crewai. Focus on finding relevant data that can aid in scoring the lead and planning a strategy to pitch them crewai.The financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.", "task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0" }
-
crewWebhookUrl
- Callback that will be executed upon the end of the crew execution{ "task_id": "97eba64f-958c-40a0-b61c-625fe635a3c0", "result": { "lead_score": "Customer service enhancement, and compliance are particularly relevant.", "talking_points": [ "Highlight how crewai's AI solutions can transform customer service with automated, personalized experiences and 24/7 support, improving both customer satisfaction and operational efficiency.", "Discuss crewai's potential to help the institution achieve its sustainability goals through better data analysis and decision-making, contributing to responsible investing and green initiatives.", "Emphasize crewai's ability to enhance compliance with evolving regulations through efficient data processing and reporting, reducing the risk of non-compliance penalties.", "Stress the adaptability of crewai to support both extensive multinational operations and smaller, targeted projects, ensuring the solution grows with the institution's needs." ] } }
Navigate to the CrewAI custom GPT
Click here https://chatgpt.com/g/g-qqTuUWsBY-crewai-assistant to access the CrewAI custom GPT
Describe your project idea
For example:
Suggest some agents and tasks to retrieve LinkedIn profile details for a given person and a domain.
The GPT will provide you with a list of suggested agents and tasks
Here’s an example of the response you will get:
Create the project structure in your terminal by entering:
crewai create crew linkedin-profile
This will create a new crew called linkedin-profile
in the current directory.
Follow the full instructions in the https://docs.crewai.com/quickstart to create a crew.
Ask the GPT to convert the agents and tasks to YAML format.
Here’s an example of the final output you will have to save in the agents.yaml
and tasks.yaml
files:
- Now replace the
agents.yaml
andtasks.yaml
with the above code - Ask GPT to create the custom LinkedIn Tool
- Ask the GPT to put everything together into the
crew.py
file - You will now have a fully working crew.
CrewAI supports integration with OpenAI’s DALL-E, allowing your AI agents to generate images as part of their tasks. This guide will walk you through how to set up and use the DALL-E tool in your CrewAI projects.
Prerequisites
- crewAI installed (latest version)
- OpenAI API key with access to DALL-E
Setting Up the DALL-E Tool To use the DALL-E tool in your CrewAI project, follow these steps:
Import the DALL-E tool
from crewai_tools import DallETool
Add the DALL-E tool to your agent configuration
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher'],
tools=[SerperDevTool(), DallETool()], # Add DallETool to the list of tools
allow_delegation=False,
verbose=True
)
Using the DALL-E Tool
Once you’ve added the DALL-E tool to your agent, it can generate images based on text prompts. The tool will return a URL to the generated image, which can be used in the agent’s output or passed to other agents for further processing.
Example usage within a task:
role: >
LinkedIn Profile Senior Data Researcher
goal: >
Uncover detailed LinkedIn profiles based on provided name {name} and domain {domain}
Generate a Dall-e image based on domain {domain}
backstory: >
You're a seasoned researcher with a knack for uncovering the most relevant LinkedIn profiles.
Known for your ability to navigate LinkedIn efficiently, you excel at gathering and presenting
professional information clearly and concisely.
The agent with the DALL-E tool will be able to generate the image and provide a URL in its response. You can then download the image.
Best Practices
- Be specific in your image generation prompts to get the best results.
- Remember that image generation can take some time, so factor this into your task planning.
- Always comply with OpenAI’s usage policies when generating images.
Troubleshooting
- Ensure your OpenAI API key has access to DALL-E.
- Check that you’re using the latest version of crewAI and crewai-tools.
- Verify that the DALL-E tool is correctly added to the agent’s tool list.
This guide explains how to use annotations to properly reference agents, tasks, and other components in the crew.py
file.
Introduction
Annotations in the framework are used to decorate classes and methods, providing metadata and functionality to various components of your crew. These annotations help in organizing and structuring your code, making it more readable and maintainable.
Available Annotations
The CrewAI framework provides the following annotations:
@CrewBase
: Used to decorate the main crew class.@agent
: Decorates methods that define and return Agent objects.@task
: Decorates methods that define and return Task objects.@crew
: Decorates the method that creates and returns the Crew object.@llm
: Decorates methods that initialize and return Language Model objects.@tool
: Decorates methods that initialize and return Tool objects.@callback
: (Not shown in the example, but available) Used for defining callback methods.@output_json
: (Not shown in the example, but available) Used for methods that output JSON data.@output_pydantic
: (Not shown in the example, but available) Used for methods that output Pydantic models.@cache_handler
: (Not shown in the example, but available) Used for defining cache handling methods.
Usage Examples
Let’s go through examples of how to use these annotations based on the provided LinkedinProfileCrew class:
1. Crew Base Class
@CrewBase
class LinkedinProfileCrew():
"""LinkedinProfile crew"""
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
The @CrewBase
annotation is used to decorate the main crew class.
This class typically contains configurations and methods for creating agents, tasks, and the crew itself.
2. Tool Definition
@tool
def myLinkedInProfileTool(self):
return LinkedInProfileTool()
The @tool
annotation is used to decorate methods that return tool objects. These tools can be used by agents to perform specific tasks.
3. LLM Definition
@llm
def groq_llm(self):
api_key = os.getenv('api_key')
return ChatGroq(api_key=api_key, temperature=0, model_name="mixtral-8x7b-32768")
The @llm
annotation is used to decorate methods that initialize and return Language Model objects. These LLMs are used by agents for natural language processing tasks.
4. Agent Definition
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher']
)
The @agent
annotation is used to decorate methods that define and return Agent objects.
5. Task Definition
@task
def research_task(self) -> Task:
return Task(
config=self.tasks_config['research_linkedin_task'],
agent=self.researcher()
)
The @task
annotation is used to decorate methods that define and return Task objects. These methods specify the task configuration and the agent responsible for the task.
6. Crew Creation
@crew
def crew(self) -> Crew:
"""Creates the LinkedinProfile crew"""
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True
)
The @crew
annotation is used to decorate the method that creates and returns the Crew
object. This method assembles all the components (agents and tasks) into a functional crew.
YAML Configuration
The agent configurations are typically stored in a YAML file. Here’s an example of how the agents.yaml
file might look for the researcher agent:
researcher:
role: >
LinkedIn Profile Senior Data Researcher
goal: >
Uncover detailed LinkedIn profiles based on provided name {name} and domain {domain}
Generate a Dall-E image based on domain {domain}
backstory: >
You're a seasoned researcher with a knack for uncovering the most relevant LinkedIn profiles.
Known for your ability to navigate LinkedIn efficiently, you excel at gathering and presenting
professional information clearly and concisely.
allow_delegation: False
verbose: True
llm: groq_llm
tools:
- myLinkedInProfileTool
- mySerperDevTool
- myDallETool
This YAML configuration corresponds to the researcher agent defined in the LinkedinProfileCrew
class. The configuration specifies the agent’s role, goal, backstory, and other properties such as the LLM and tools it uses.
Note how the llm
and tools
in the YAML file correspond to the methods decorated with @llm
and @tool
in the Python class. This connection allows for a flexible and modular design where you can easily update agent configurations without changing the core code.
Best Practices
- Consistent Naming: Use clear and consistent naming conventions for your methods. For example, agent methods could be named after their roles (e.g., researcher, reporting_analyst).
- Environment Variables: Use environment variables for sensitive information like API keys.
- Flexibility: Design your crew to be flexible by allowing easy addition or removal of agents and tasks.
- YAML-Code Correspondence: Ensure that the names and structures in your YAML files correspond correctly to the decorated methods in your Python code.
By following these guidelines and properly using annotations, you can create well-structured and maintainable crews using the CrewAI framework.
This guide will walk you through the process of integrating CrewAI Enterprise with Zapier, allowing you to automate workflows between CrewAI Enterprise and other applications.
Prerequisites
- A CrewAI Enterprise account
- A Zapier account
- A Slack account (for this specific integration)
Step-by-Step Guide
Set Up the Slack Trigger
- In Zapier, create a new Zap.
Choose Slack as your trigger app.
- Select
New Pushed Message
as the Trigger Event. - Connect your Slack account if you haven’t already.
Configure the CrewAI Enterprise Action
- Add a new action step to your Zap.
- Choose CrewAI+ as your action app and Kickoff as the Action Event
Connect your CrewAI Enterprise account.
- Connect your CrewAI Enterprise account.
- Select the appropriate Crew for your workflow.
- Configure the inputs for the Crew using the data from the Slack message.
Format the CrewAI Enterprise Output
- Add another action step to format the text output from CrewAI Enterprise.
- Use Zapier’s formatting tools to convert the Markdown output to HTML.
Send the Output via Email
- Add a final action step to send the formatted output via email.
- Choose your preferred email service (e.g., Gmail, Outlook).
- Configure the email details, including recipient, subject, and body.
- Insert the formatted CrewAI Enterprise output into the email body.
Kick Off the crew from Slack
- Enter the text in your Slack channel
- Select the 3 ellipsis button and then chose Push to Zapier
Select the crew and then Push to Kick Off
Tips for Success
- Ensure that your CrewAI Enterprise inputs are correctly mapped from the Slack message.
- Test your Zap thoroughly before turning it on to catch any potential issues.
- Consider adding error handling steps to manage potential failures in the workflow.
By following these steps, you’ll have successfully integrated CrewAI Enterprise with Zapier, allowing for automated workflows triggered by Slack messages and resulting in email notifications with CrewAI Enterprise output.
This guide provides a step-by-step process to integrate CrewAI Enterprise with HubSpot, enabling you to initiate crews directly from HubSpot Workflows.
Prerequisites
- A CrewAI Enterprise account
- A HubSpot account with the HubSpot Workflows feature
Step-by-Step Guide
Connect your HubSpot account with CrewAI Enterprise
- Log in to your
CrewAI Enterprise account > Integrations
- Select
HubSpot
from the list of available integrations - Choose the HubSpot account you want to integrate with CrewAI Enterprise
- Follow the on-screen prompts to authorize CrewAI Enterprise access to your HubSpot account
- A confirmation message will appear once HubSpot is successfully linked with CrewAI Enterprise
Create a HubSpot Workflow
- Log in to your
HubSpot account > Automations > Workflows > New workflow
- Select the workflow type that fits your needs (e.g., Start from scratch)
- In the workflow builder, click the Plus (+) icon to add a new action.
- Choose
Integrated apps > CrewAI > Kickoff a Crew
. - Select the Crew you want to initiate.
- Click
Save
to add the action to your workflow
Use Crew results with other actions
- After the Kickoff a Crew step, click the Plus (+) icon to add a new action.
- For example, to send an internal email notification, choose
Communications > Send internal email notification
- In the Body field, click
Insert data
, selectView properties or action outputs from > Action outputs > Crew Result
to include Crew data in the email - Configure any additional actions as needed
- Review your workflow steps to ensure everything is set up correctly
- Activate the workflow
For more detailed information on available actions and customization options, refer to the HubSpot Workflows Documentation.
- In Azure, go to
Azure AI Services > select your deployment > open Azure OpenAI Studio
. - On the left menu, click
Deployments
. If you don’t have one, create a deployment with your desired model. - Once created, select your deployment and locate the
Target URI
andKey
on the right side of the page. Keep this page open, as you’ll need this information. - In another tab, open
CrewAI Enterprise > LLM Connections
. Name your LLM Connection, select Azure as the provider, and choose the same model you selected in Azure. - On the same page, add environment variables from step 3:
- One named
AZURE_DEPLOYMENT_TARGET_URL
(using the Target URI). The URL should look like this: https://your-deployment.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-08-01-preview - Another named
AZURE_API_KEY
(using the Key).
- One named
- Click
Add Connection
to save your LLM Connection. - In
CrewAI Enterprise > Settings > Defaults > Crew Studio LLM Settings
, set the new LLM Connection and model as defaults. - Ensure network access settings:
- In Azure, go to
Azure OpenAI > select your deployment
. - Navigate to
Resource Management > Networking
. - Ensure that
Allow access from all networks
is enabled. If this setting is restricted, CrewAI may be blocked from accessing your Azure OpenAI endpoint.
- In Azure, go to
You’re all set! Crew Studio will now use your Azure OpenAI connection.
Human-in-the-Loop (HITL) Instructions HITL is a powerful approach that combines artificial intelligence with human expertise to enhance decision-making and improve task outcomes. Follow these steps to implement HITL within CrewAI:
Configure Your Task
Set up your task with human input enabled:
Provide Webhook URL
When kicking off your crew, include a webhook URL for human input:
Receive Webhook Notification
Once the crew completes the task requiring human input, you’ll receive a webhook notification containing:
- Execution ID
- Task ID
- Task output
Review Task Output
The system will pause in the Pending Human Input
state. Review the task output carefully.
Submit Human Feedback
Call the resume endpoint of your crew with the following information:
Feedback Impact on Task Execution: It’s crucial to exercise care when providing feedback, as the entire feedback content will be incorporated as additional context for further task executions.
This means:
- All information in your feedback becomes part of the task’s context.
- Irrelevant details may negatively influence it.
- Concise, relevant feedback helps maintain task focus and efficiency.
- Always review your feedback carefully before submission to ensure it contains only pertinent information that will positively guide the task’s execution.
Handle Negative Feedback
If you provide negative feedback:
- The crew will retry the task with added context from your feedback.
- You’ll receive another webhook notification for further review.
- Repeat steps 4-6 until satisfied.
Execution Continuation
When you submit positive feedback, the execution will proceed to the next steps.
Salesforce Demo
Salesforce is a leading customer relationship management (CRM) platform that helps businesses streamline their sales, service, and marketing operations.
The max_rpm
attribute sets the maximum number of requests per minute the crew can perform to avoid rate limits and will override individual agents’ max_rpm
settings if you set it.
Was this page helpful?