What’s new in CrewAI v0.41.0

CrewAI, the framework for orchestrating collaborative AI agents, has released a significant update. This new version introduces a suite of features designed to streamline the creation and management of AI agent teams capable of tackling complex tasks.

The latest release brings several noteworthy improvements to the framework. Users can now benefit from enhanced data safety, more sophisticated planning capabilities, and a new replay feature that allows for selective re-execution of AI workflows. These additions, along with various under-the-hood enhancements, make CrewAI more robust and user-friendly than ever before.

Remember the CrewAI documentation is the ultimate source of information, head over there to get more details. You can read the release notes on Github v0.41.0

Key Features Highlight

Type Safe output

CrewAI has improved its output handling with the new CrewOutput class and TaskOutput class. This enhancement provides users with more structured and accessible results from their AI crew executions.

Key features of the new CrewOutput:

  • Multiple output formats: raw strings, JSON, and Pydantic models
  • Access to individual task outputs
  • Token usage summary for performance insights

Users can now easily retrieve crew results in their preferred format:

result = crew.kickoff()
crew_output = crew.output

print(crew_output.raw)  # Raw string output
print(crew_output.json_dict)  # JSON format
print(crew_output.pydantic)  # Pydantic model
print(crew_output.tasks_output)  # Individual task results
print(crew_output.token_usage)  # Performance metrics

This update streamlines data handling and analysis, making it easier for developers to integrate CrewAI outputs into their workflows and applications.

Key features of TaskOutput:

  • Multiple output formats: raw strings, JSON, and Pydantic models
  • Task description and auto-generated summary
  • Information on the executing agent
  • Configurable output format

Users can now easily retrieve task-specific results:

result = crew.kickoff()
task_output = task.output

print(task_output.description)  # Task description
print(task_output.summary)      # Auto-generated summary
print(task_output.raw)          # Raw output
print(task_output.json_dict)    # JSON format (if configured)
print(task_output.pydantic)     # Pydantic model (if configured)

This update provides greater granularity in accessing and analyzing individual task results, enhancing debugging capabilities and allowing for more detailed insights into the AI workflow.

New planning feature for crews

CrewAI introduces a new planning feature in this release, enhancing AI task execution. This addition allows crews to strategize before acting, leading to more efficient problem-solving. An AgentPlanner now creates a step-by-step strategy for each crew iteration. This plan is integrated into task descriptions, providing agents with a clear roadmap.

With planning enabled, users will see the AgentPlanner's strategic output guiding agents through complex tasks. This feature marks a significant advancement in CrewAI's ability to tackle multi-step problems effectively, bringing AI collaboration closer to human-like problem-solving approaches.

Users can enable this feature by adding planning=True when creating a Crew:

my_crew = Crew(
  agents=self.agents,
  tasks=self.tasks,
  process=Process.sequential,
  planning=True
)

Introduced Replay Feature

CrewAI now offers a Replay feature, allowing users to re-execute specific tasks from their latest crew kickoff. This addition enhances efficiency by enabling targeted task retries without needing to refetch data or rebuild context.

Users can access this feature through a new CLI command or programmatically. The CLI command crewai log-tasks-outputs displays task IDs from the latest kickoff, while crewai replay -t <task_id> initiates the replay from a specific task.

For programmatic use, developers can employ the replay_from_task method, specifying the task ID and optional input parameters. This feature is particularly useful for debugging, iterative development, or fine-tuning specific parts of a CrewAI workflow.

Note that Replay currently supports only the most recent crew run, requiring a successful crew.kickoff() execution beforehand.

Ability to reset memory

CrewAI introduces a powerful memory reset capability, giving users more control over their Agents' knowledge states. This feature allows for selective or complete memory clearing, enhancing flexibility in long-running or iterative AI tasks.

Users can now reset specific memory types using the crewai reset_memories command with various options:

  • Long-term memory (-l)
  • Short-term memory (-s)
  • Entities memory (-e)
  • Latest kickoff task outputs (-k)
  • All memories (-a)

This granular control enables users to fine-tune their agents' knowledge base, ensuring relevant information is maintained while outdated or unnecessary data is cleared. Whether it's refreshing an agent for a new task or troubleshooting complex workflows, the memory reset feature provides a valuable tool for managing AI agent cognition.

Added MultiON Tool

CrewAI now offers the MultiOnTool, a powerful addition to the crewai_tools package. This tool empowers AI agents to navigate and interact with the web using natural language instructions, leveraging the Multion API for seamless web browsing.

Key features:

  • Natural language web interaction
  • Flexible local or remote execution
  • Customizable action limits

Setup is straightforward:

  1. Install with pip install 'crewai[tools]'
  2. Install the MultiOn Browser Extension
  3. Enable API usage in the extension settings
from crewai_tools import MultiOnTool

multion_tool = MultiOnTool(api_key="YOUR_API_KEY")

browser_agent = Agent(
    role="Browser Agent",
    tools=[multion_tool],
    # Additional configurations
)

# Use in tasks requiring web interaction

Bug Fixes and Documentation

In addition to the new features, this release includes several important bug fixes and improvements:

  • Fixed issues with the Filecrawl and scraping tools, enhancing their reliability
  • Addressed various general bugs to improve overall system stability
  • Implemented telemetry fixes for better performance tracking
  • Corrected spelling errors throughout the codebase
  • Updated documentation to reflect all recent changes and improvements

These fixes and improvements demonstrate CrewAI's commitment to maintaining a robust, efficient, and user-friendly framework. Users can expect a smoother experience with enhanced tool reliability and system performance.

CrewAI's latest update empowers developers with a powerful suite of features to streamline complex agentic workflows. Improved data handling, a new planning feature, and the ability to reset agent memory provide greater control and efficiency. The addition of the MultiOnTool expands CrewAI's capabilities into web interaction, using natural language instructions. With these advancements and ongoing bug fixes, CrewAI solidifies its position as a leading framework for building and managing collaborative AI agent teams.

AI should drive results, not complexity. AgentemAI helps businesses build scalable, efficient, and secure AI solutions. See how we can help.