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.
https://github.com/joaomdmoura/crewAI
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 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
This example demonstrates the functionality of CrewAI by creating an Instagram post.
Author’s demonstration video
https://www.youtube.com/watch?v=lcD0nT8IVTg
The functionalities implemented by this program are as follows:
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/
https://python-poetry.org/docs/
Poetry is a dependency management and packaging tool for Python.
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.
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.
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.
In the example of CrewAI, OpenHermes 2.5 was used, while I used
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.
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.
Throughout the process, the Browseless backend showed 1 call, while Serper recorded 5 calls.
This project includes the following key files.
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
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:
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