How to make AI assistants do your work [with CrewAI]

How to make AI assistants do your work [with CrewAI]

Download my latest 1000+ book on Machine Learning

Artificial Intelligence has become such a beautiful part of our lives. It is simplifying tasks and providing solutions to complex problems. In the AI domain, large language models play an important role, but understanding how they work and what their capabilities are, is essential for effective use. In this article, I’ll explore how AI, specifically LLMs, processes information and how we can leverage them for more advanced tasks, by using so-called AI Agents in tandem (sometimes referred to as swarm intelligence), with the open-source framework of CrewAI.


What is CrewAI

CrewAI offers a platform to assemble teams of AI agents, each specializing in different roles. These agents can collaborate to solve problems or carry out tasks. Essentially, it allows you to create and manage a group of AI assistants that work together to achieve a common goal, much like a crew on a ship or a team of workers on a project.

Here are some key things to know about CrewAI:

  • It has a focus on collaboration: Unlike many AI frameworks that focus on individual agents, CrewAI is designed for agents to work together seamlessly, sharing information and tasks to achieve better results. This “collaborative intelligence” allows CrewAI to tackle complex problems that would be difficult or impossible for a single agent.
  • It employs role-playing agents: Each agent in a CrewAI team can have a specific role, such as data engineer, marketer, or customer service representative. This allows you to tailor the team to the specific needs of your project.
  • It is simple and flexible: CrewAI is designed to be easy to use, even for people who are not familiar with AI. It is also very flexible, so you can customize it to fit your specific needs. For example, each agent can employ different LLMs that fit their different roles and requirements.

What are some common use cases for crewAI?

  • Building a smart assistant platform: You could use crewAI to create a team of agents that can handle different tasks, such as booking appointments, making travel arrangements, and answering questions.
  • Creating an automated customer service system: You could use crewAI to create a team of agents that can handle customer inquiries, resolve issues, and provide support.
  • Developing a multi-agent research team: You could use crewAI to create a team of agents that can work together on research projects, such as analyzing data, generating hypotheses, and testing ideas.

So, overall, crewAI is a powerful tool that can be used to create intelligent and collaborative AI systems. If you are looking for a way to leverage the power of AI to solve complex problems, crewAI is worth checking out.

The crewAI workflow process

A typical crewAI workflow process consists of the following setup.

  • Agents — This is where you define the capabilities of your crewAI workflow in terms of who does what, i.e what agents you have and the general roles and skills your agents should possess.
  • Tasks — Here you define the specific goals you want your agents to accomplish.
  • Process — This is where you define which of your agents and tasks crewAI is to use to fulfil the overall aim of your crewAI objective.
  • Run — This is where you literally kickoff the running of your agents and tasks. Assuming the run is successful, it will return the result that crewAI comes up with to solve its stated goal.


Let’s work on a practical example of setting up three agents to analyze and refine a startup concept.

Setting up AI agents for startup analysis

1. Marketer agent:

  • Role: Market research expert
  • Goal: Analyze potential demand for products and provide guidance on reaching a wide target audience.
  • Backstory: Equipped to understand market trends and consumer behavior.

2. Technologist agent:

  • Role: Technical analysis expert
  • Goal: Provide analysis and suggestions for product development.
  • Backstory: Well-versed in technological advancements and product innovation.

3. Business development agent:

  • Role: Business consultant
  • Goal: Synthesize reports from other agents and create a comprehensive business plan.
  • Backstory: Expert in formulating strategic business plans.

Defining tasks and collaboration

Tasks should be specific and results-oriented. For our startup example:

  1. Marketer’s task: Analyze demand and suggest audience targeting strategies.
  2. Technologist’s task: Provide analysis and suggestions for product development.
  3. Business development’s task: Create a detailed business plan based on inputs from other agents.

With tasks defined, we can instantiate the crew, specifying how agents collaborate sequentially to achieve the end result.

Enhancing agent intelligence with real-world data

Making AI agents smarter involves giving them access to real-world, real-time data. Crew AI offers built-in tools for this purpose. By integrating tools like text-to-speech or Google search, agents can gather more accurate and up-to-date information, enhancing their problem-solving abilities.

The pitfalls of paying high API fees: going local

While using Crew AI is powerful, it comes with costs. To avoid hefty API fees and maintain privacy, running models locally is a viable solution. Experimenting with 13 open-source models revealed varied results, with some models struggling to understand tasks. Notably, the “regular llama 13 billion parameters” model surprisingly incorporated data from a subreddit, showcasing potential for local models.

The journey with local models

Testing various local models highlighted significant differences in performance. Models like “llama 2 Series” and “Falcon” with fewer parameters struggled, while “open chat” and “mistro” showed promise. Surprisingly, a non-fine-tuned “llama 13 billion parameters” model demonstrated an understanding of the task, though not perfectly.

Takeaways and moving forward

1. Optimizing AI agents:

  • Experiment with tree of thought prompting for more thoughtful responses.
  • Leverage built-in tools to provide agents with real-world data.

2. Cost-efficiency and privacy:

  • Consider running models locally to avoid high API fees.
  • Explore various local models to find the best fit for your tasks.

3. Continuous improvement:

  • Stay updated on advancements in AI models and tools.
  • Experiment with different prompts and models for better outcomes.

OK, that’s all for me for now. In the next article, I will show you how I coded the different agents in CrewAI using Python. Hopefully, you found this article useful. If you did, please connect with me on LinkedIn, or our newsletter: TechTonic Shifts. From there, you can see my other published stories and subscribe to get notified when I post new content.

Signing off - Marco


Other stuff you might be interested in



要查看或添加评论,请登录

社区洞察

其他会员也浏览了