This my personal diary of experiments with crewAI and agents. Please feel free to use it as you see fit. The example shows two AI agents working together to conduct research and analysis on healthcare topics.
- Multi-agent collaboration using CrewAI
- Integration with Perplexity AI's language model
- Research and analysis pipeline
- Structured output generation
- Python 3.8+
- Perplexity API key
- Install the required packages:
pip install -r requirements.txt
- All you need is an API key of the model hostel on an inference service. Pick the one you like and want to use for these experiments. Create a
.env
file in the root directory and add your Perplexity API key:
PERPLEXITY_API_KEY=your_api_key_here
crewai-experiments/
├── examples/
│ └── research_crew.py # Main example script
├── .env # Environment variables (not tracked in git)
├── .gitignore # Git ignore file
├── LICENSE # License file
├── README.md # This file
└── requirements.txt # Project dependencies
Run the example script:
python examples/research_crew.py
The script will:
- Create two AI agents: a Research Specialist and a Data Analyst
- The Research Specialist will gather information about AI in healthcare
- The Data Analyst will analyze the findings and provide recommendations
- Output a structured report with findings and insights
The example demonstrates the following concepts:
- Agent Creation: Defines specialized agents with specific roles and goals
researcher = Agent(
role='Research Specialist',
goal='Conduct thorough research on given topics',
backstory='Experienced research specialist with attention to detail'
)
- Task Definition: Creates tasks for agents to execute
research_task = Task(
description='Research AI developments in healthcare...',
agent=researcher
)
- Crew Assembly: Combines agents and tasks into a working crew
crew = Crew(
agents=[researcher, analyst],
tasks=[research_task, analysis_task]
)
The script generates a structured report containing:
- Research findings on AI in healthcare
- Analysis of key trends and patterns
- Future implications
- Recommendations for healthcare providers
This project is licensed under the MIT License - see the LICENSE file for details.
- CrewAI - Framework for orchestrating role-playing AI agents
- Perplexity AI - Language model provider