Skip to content

TanoueH/Fds-simulation-pipeline-

Repository files navigation

CrewAI Template

A production-ready template for building AI crews using CrewAI - the cutting-edge framework for orchestrating collaborative AI agents.

🌟 What Makes This Template Special

  • πŸ€– Multi-Agent Collaboration: Watch AI agents work together like a real team
  • πŸ”§ Production-Ready: Docker containerization, proper logging, and error handling
  • πŸ“Š Rich Reporting: Automatic report generation with structured outputs
  • πŸ› οΈ Extensible Tools: Easy-to-add custom tools for any domain
  • ⚑ Latest CrewAI: Always updated to the newest CrewAI version (0.134.0+)
  • 🎯 Real Examples: Working examples that demonstrate powerful AI workflows

πŸš€ Quick Start

  1. Clone and Setup:
git clone https://github.com/scotthavird/crewai-template
cd crewai-template
./setup.sh your_project_name
  1. Configure Environment:
cp .env.example .env
# Add your OpenAI API key to .env
  1. Launch Your AI Crew:
docker compose up --build

Watch your AI agents collaborate in real-time! 🎬

πŸ’‘ Use Case Examples

This template can be adapted for various exciting use cases:

πŸ”¬ Research & Analysis

  • Market Research: Agents gather data, analyze trends, create reports
  • Academic Research: Literature review, data analysis, paper writing
  • Competitive Intelligence: Monitor competitors, analyze strategies

πŸ“ˆ Business Intelligence

  • Financial Analysis: Data collection, trend analysis, investment recommendations
  • Product Development: Market research, feature analysis, roadmap planning
  • Risk Assessment: Data gathering, risk modeling, mitigation strategies

🎨 Content Creation

  • Blog Writing: Research topics, write articles, optimize for SEO
  • Social Media: Content planning, post creation, engagement analysis
  • Marketing Campaigns: Strategy development, content creation, performance tracking

πŸ”§ Technical Projects

  • Code Review: Analyze codebases, identify issues, suggest improvements
  • Documentation: Generate technical docs, API references, tutorials
  • System Analysis: Architecture review, performance optimization

πŸ—οΈ Project Structure

src/your_project_name/
β”œβ”€β”€ main.py                 # 🎯 Entry point & configuration
β”œβ”€β”€ crew.py                # πŸ€– Agent & crew definitions
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ agents.yaml        # πŸ‘₯ Agent personalities & roles
β”‚   └── tasks.yaml         # πŸ“‹ Task definitions & workflows
└── tools/
    β”œβ”€β”€ custom_tool.py     # πŸ› οΈ Your custom tools
    β”œβ”€β”€ web_scraper.py     # 🌐 Web scraping capabilities
    β”œβ”€β”€ data_analyzer.py   # πŸ“Š Data analysis tools
    └── file_manager.py    # πŸ“ File operations

🎭 Agent Personalities

Our template includes pre-configured agent archetypes:

  • πŸ” Senior Researcher: Deep analysis, fact-checking, comprehensive investigation
  • πŸ“Š Reporting Analyst: Data synthesis, clear communication, structured reporting
  • 🎨 Creative Writer: Engaging content, storytelling, audience adaptation
  • πŸ”§ Technical Expert: Code analysis, system design, best practices

πŸ› οΈ Built-in Tools

The template comes with powerful tools out of the box:

  • 🌐 Web Research Tool: Intelligent web scraping and data extraction
  • πŸ“Š Data Analysis Tool: Statistical analysis and visualization
  • πŸ“ File Management Tool: Read, write, and organize files
  • πŸ” Search Tool: Advanced search capabilities across multiple sources
  • πŸ“ˆ Reporting Tool: Generate professional reports in multiple formats

πŸš€ Advanced Features

πŸ”„ Workflow Orchestration

# Define complex multi-step workflows
workflow = Crew(
    agents=[researcher, analyst, writer],
    tasks=[research_task, analysis_task, writing_task],
    process=Process.sequential,  # or Process.hierarchical
    verbose=True
)

πŸ“Š Real-time Monitoring

  • Live agent status updates
  • Task progress tracking
  • Performance metrics
  • Error handling and recovery

🎯 Customizable Outputs

  • Markdown reports
  • JSON data exports
  • PDF generation
  • Interactive dashboards

πŸ”§ Configuration Examples

Quick Research Project

# agents.yaml
researcher:
  role: "AI Research Specialist"
  goal: "Discover cutting-edge developments in {topic}"
  backstory: "Expert in finding and analyzing the latest innovations"

Business Analysis Crew

# tasks.yaml
market_analysis:
  description: "Analyze market trends for {product}"
  expected_output: "Comprehensive market analysis with actionable insights"
  agent: market_analyst

🎬 Live Demo

Want to see it in action? Check out these example runs:

  1. Interactive Demo: docker compose run --rm crew python demo.py
  2. Business Analysis: docker compose run --rm crew python examples/business_analysis_example.py
  3. Default Research: docker compose up (OpenCV research)

πŸš€ Getting Started Examples

Example 1: Market Research

docker compose run --rm crew python -c "
from src.crewai_template.crew import CrewaiTemplate
crew = CrewaiTemplate().crew()
result = crew.kickoff(inputs={
    'topic': 'Electric Vehicle Market 2025',
    'industry': 'Automotive',
    'region': 'North America'
})
"

Example 2: Technical Analysis

docker compose run --rm crew python -c "
from src.crewai_template.crew import CrewaiTemplate
crew = CrewaiTemplate().crew()
result = crew.kickoff(inputs={
    'topic': 'Kubernetes Security Best Practices',
    'depth': 'comprehensive',
    'audience': 'DevOps Engineers'
})
"

Example 3: Content Strategy

docker compose run --rm crew python -c "
from src.crewai_template.crew import CrewaiTemplate
crew = CrewaiTemplate().crew()
result = crew.kickoff(inputs={
    'topic': 'AI in Healthcare',
    'format': 'blog series',
    'target_audience': 'healthcare professionals'
})
"

🎯 Development Commands

All development happens inside Docker containers:

# Interactive demo with menu
docker compose run --rm crew python demo.py

# Run specific examples
docker compose run --rm crew python examples/business_analysis_example.py

# Interactive Python shell
docker compose run --rm crew python

# Shell access for debugging
docker compose run --rm crew bash

# Check installed packages
docker compose run --rm crew pip list

# Run tests
docker compose run --rm crew python -m pytest

πŸ”§ Adding Dependencies

  1. Add to pyproject.toml:
dependencies = [
    "crewai[tools]>=0.134.0,<1.0.0",
    "requests>=2.31.0",
    "your-new-package>=1.0.0",
]
  1. Rebuild container:
docker compose build
  1. Test new dependency:
docker compose run --rm crew python -c "import your_new_package; print('Success!')"

🎯 Next Steps

  1. Customize Your Agents: Edit config/agents.yaml to define unique personalities
  2. Design Your Workflow: Modify config/tasks.yaml for your specific use case
  3. Add Custom Tools: Extend functionality in the tools/ directory
  4. Scale Your Crew: Add more agents for complex workflows
  5. Deploy to Production: Use the included Docker setup for deployment

🀝 Contributing

We love contributions! Whether it's:

  • πŸ› Bug fixes
  • ✨ New features
  • πŸ“š Documentation improvements
  • 🎯 New use case examples

πŸ“š Learn More


Ready to build the future with AI agents? πŸš€ Start your journey today!

About

Agents-AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published