π€ A sandbox for experimenting with CrewAI multi-agent AI systems that research topics and generate comprehensive reports π¬
This project provides a ready-to-use sandbox for exploring the CrewAI framework. It includes a sample crew implementation called latest_ai_development that demonstrates a two-agent research and reporting workflow:
- Researcher Agent - Discovers cutting-edge developments on any topic
- Reporting Analyst Agent - Transforms research into detailed, structured reports
- Decorator-based architecture - Clean
@agent,@task, and@crewdecorators for defining crews - YAML configuration - Externalized agent and task definitions for easy customization
- Template variables - Dynamic
{topic}interpolation across all configurations - Sequential processing - Tasks execute in order with output chaining
- Markdown output - Reports generated as formatted
report.mdfiles
# Clone and setup
git clone https://github.com/tsilva/sandbox-crewai.git
cd sandbox-crewai
conda env create -f environment.yml
conda activate crewai-sandbox
# Configure API key
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
# Run the crew
python main.py# Create the conda environment
conda env create -f environment.yml
# Activate it
conda activate crewai-sandboxCreate a .env file in the project root:
OPENAI_API_KEY=your-api-key-here# From project root
python main.pyThis runs the default topic "AI Agents". To research a different topic, edit main.py:
inputs = {
'topic': 'Your Topic Here'
}# Using the crew's CLI entry point
cd latest_ai_development
run_crew
# Train the crew
train <n_iterations> <filename>
# Test the crew
test <n_iterations> <openai_model_name>
# Replay a specific task
replay <task_id>sandbox-crewai/
βββ main.py # Main entry point
βββ environment.yml # Conda environment definition
βββ .env.example # Environment template
βββ latest_ai_development/
βββ src/latest_ai_development/
βββ crew.py # Crew definition with decorators
βββ main.py # CLI entry points
βββ config/
β βββ agents.yaml # Agent definitions
β βββ tasks.yaml # Task definitions
βββ tools/
βββ custom_tool.py # Custom tools (extensible)
graph LR
A[Input Topic] --> B[Researcher Agent]
B --> C[10 Bullet Points]
C --> D[Reporting Analyst]
D --> E[report.md]
Agents are defined in config/agents.yaml:
| Agent | Role | Output |
|---|---|---|
| Researcher | {topic} Senior Data Researcher |
10 bullet points of findings |
| Reporting Analyst | {topic} Reporting Analyst |
Full markdown report |
Tasks are defined in config/tasks.yaml:
| Task | Description | Agent |
|---|---|---|
| research_task | Conduct thorough research on {topic} |
Researcher |
| reporting_task | Expand findings into detailed report sections | Reporting Analyst |
- Add agent definition to
config/agents.yaml:
new_agent:
role: >
{topic} Expert Role
goal: >
Your agent's goal
backstory: >
Agent background story- Register in
crew.py:
@agent
def new_agent(self) -> Agent:
return Agent(
config=self.agents_config['new_agent'],
verbose=True
)- Add task definition to
config/tasks.yaml:
new_task:
description: >
Task description with {topic} variable
expected_output: >
What the task should produce
agent: new_agent- Register in
crew.py:
@task
def new_task(self) -> Task:
return Task(
config=self.tasks_config['new_task'],
)Create tools in tools/custom_tool.py and attach to agents:
from crewai.tools import tool
@tool
def my_custom_tool(input: str) -> str:
"""Tool description for the agent."""
return f"Processed: {input}"| Package | Purpose |
|---|---|
crewai |
Multi-agent orchestration framework |
crewai[tools] |
Built-in tools for agents |
crewai[embeddings] |
Embedding support |
python-dotenv |
Environment variable management |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is available under the MIT License.