CrewAI: A Local Large Model AI Automation Collaboration Framework

CrewAI has recently become a popular repository on GitHub. It is a framework designed to provide automation settings for AI agents in role-playing. By facilitating cooperation between AI agents, CrewAI enables these agents to collaboratively solve complex problems.

One aspect that greatly attracts me about CrewAI is that it can run programs using both OpenAI’s API and local large models through Ollama.

CrewAI: A Local Large Model AI Automation Collaboration Framework

https://github.com/joaomdmoura/crewAI

CrewAI: A Local Large Model AI Automation Collaboration Framework

The main building blocks of CrewAI include agents, tasks, tools, and teams. Agents are dedicated team members with their own roles, backstories, goals, and memories; tasks are small, focused assignments that given agents should complete; tools are the devices used by agents to efficiently complete tasks; and teams are the container layers where agents, tasks, and processes meet to work together.

CrewAI: A Local Large Model AI Automation Collaboration Framework

CrewAI Core Features

1. Role-Customized Agents: Agents can be tailored according to different roles, goals, and tools.

2. Automatic Task Delegation: Agents can autonomously assign tasks and communicate with each other, effectively improving problem-solving efficiency.

3. Flexible Task Management: Tasks and tools can be customized as needed and flexibly assigned to different agents.

4. Process-Oriented: Currently, the system only supports sequential task execution, but more complex processes based on consensus and hierarchy are under development.

CrewAI Example Repository:

https://github.com/joaomdmoura/crewAI-examples

CrewAI: A Local Large Model AI Automation Collaboration Framework

This example demonstrates the functionality of CrewAI by creating an Instagram post.

CrewAI: A Local Large Model AI Automation Collaboration Framework

Author’s demonstration video

https://www.youtube.com/watch?v=lcD0nT8IVTg

The functionalities implemented by this program are as follows:

CrewAI: A Local Large Model AI Automation Collaboration Framework

The operation steps provided by the CrewAI author are very concise, during practical operation, I noticed the following points:

1. Before running, first install CrewAI library

pip install crewai

2. This project uses two very useful APIs, Browseless and Serper.

It is necessary to register for Browseless and Serper, both of which offer a certain amount of free credits.

https://www.browserless.io/
https://serper.dev/
Browseless is a tool for web searching. Its main features include obtaining results with metadata as part of a self-questioning search chain, searching for Google images, news, locations, etc.
Serper is a Google Search Engine Results Page API. It allows users to quickly access real-time Google search results, suitable for AI chatbots, SEO analysis, and other projects.
3. Poetry needs to be installed, documentation address:
https://python-poetry.org/docs/

Poetry is a dependency management and packaging tool for Python.

CrewAI: A Local Large Model AI Automation Collaboration Framework

The official recommendation for installing Poetry is to do so in a dedicated virtual environment, isolated from other parts of the system.

When installing Poetry using pipx install poetry, the system prompted me to first install pipx.

CrewAI: A Local Large Model AI Automation Collaboration Framework

After installing Poetry, when I ran the py program, the system prompted me that the “unstructured” package was missing, so I followed the operation below.

CrewAI: A Local Large Model AI Automation Collaboration Framework

Ultimately, I successfully ran the program using poetry run python /path/to/your/script.py.

Running the program through Poetry has its advantages; my computer’s base environment defaults to Python 3.9, but this project requires Python 3.10 or higher, and it automatically helps me upgrade in the virtual environment.

Today, a very popular AI hardware is Rabbit R1, I copied the Rabbit’s official website and some information to the terminal, letting CrewAI help me create an Instagram post.

CrewAI: A Local Large Model AI Automation Collaboration Framework

CrewAI: A Local Large Model AI Automation Collaboration Framework

In the example of CrewAI, OpenHermes 2.5 was used, while I used dolphin-mistral:7b-v2.6-fp16. After running for a few minutes, the program generated content of size 45k.

The generated result is in English, and I translated it into Chinese.

Here, I only extracted the final result content: the first three are AI-generated Instagram posts, and the last three options are the midjourney descriptions provided by AI.

CrewAI: A Local Large Model AI Automation Collaboration Framework

If GPT-4 were used, the generated results would definitely be much better.

After the program ran, in addition to the final result, it output a long intermediate content, which I asked GPT to help me interpret.

CrewAI: A Local Large Model AI Automation Collaboration Framework

Throughout the process, the Browseless backend showed 1 call, while Serper recorded 5 calls.

CrewAI: A Local Large Model AI Automation Collaboration Framework

This project includes the following key files.

CrewAI: A Local Large Model AI Automation Collaboration Framework

If we want to modify this program to write Xiaohongshu articles, what other strategies can we execute? Do we have to rewrite every time?

The author of CrewAI is a genius author, and he created a CrewAI Assistant GPT.

https://chat.openai.com/g/g-qqTuUWsBY-crewai-assistant

CrewAI: A Local Large Model AI Automation Collaboration Framework

We can ask this GPT the following questions:

Help me create a team for a use case
What are the advanced features of CrewAI?
How can I build a team myself?
Explain CrewAI to me

Some screenshots:

CrewAI: A Local Large Model AI Automation Collaboration Framework

The core advantage of CrewAI lies in its ability to achieve collaborative automation of AI agents through a role-playing framework, greatly enhancing the efficiency of solving complex problems; at the same time, its high flexibility and customization capabilities allow it to meet diverse business needs.
Moreover, CrewAI can liberate valuable time by automating repetitive tasks, allowing us to focus on more creative and strategic work, thus overall enhancing work productivity.
To summarize:
1. CrewAI is a framework for orchestrating automated AI agents, enabling multiple agents to work together to solve complex problems.
2. The article introduces the process of using CrewAI to automatically generate Instagram posts, including installing and configuring CrewAI, Browseless and Serper APIs, and the steps to run the program to generate posts.
3. During the running process, solutions were provided for some issues, such as the installation of pipx and Poetry, and the missing unstructured package.
4. What makes CrewAI unique is its ability to flexibly customize diverse role agents. These agents can independently assign tasks while supporting user-defined tasks and tool usage. Additionally, the CrewAI Assistant GPT can provide practical assistance.
5. This practice demonstrates CrewAI’s powerful capabilities in automated content generation and its flexible scalability, providing experiential reference for various content generation projects.

For more model content, please see here:

Practical test of using Ollama to converse with AI on Mac – model selection, installation, integration usage record, from Mixtral8x7b to Yi-34B-Chat

LM Studio – Simplifying the installation and use of open-source large models | OpenAI API text-to-speech local running program sharing

Ollama now supports the installation of the Phi-2 model released by Microsoft, with installation process

Ollama launches Nous Hermes 2 and Dolphin Phi 2.6 models and shares experience with Ollama Web UI

Mastering Microsoft’s Phi-2 model: from in-depth analysis to practical installation process

Leave a Comment