CrewAI Examples

repository·main·Indexed 27 days ago

https://github.com/crewaiinc/crewai-examples

A collection of complete, end-to-end CrewAI applications demonstrating real-world orchestration of AI agents. Examples include a Game Builder Crew, Instagram Post AI Crew, Job Posting AI Crew, Landing Page Generator, Markdown Validator, Marketing Strategy AI Crew, and a Match Profile to Positions Crew.

Tokens
59.4K
Snippets
182
Records
327
Agent score
91%

What's inside crewai-examples

  1. Overview of CrewAI Features and Capabilities

    main

    CrewAI is an AI architecture designed to automate multi-agent workflows through a coordinated 'crew' of intelligent agents. Key capabilities include:

    • Role-Based Agent Design: Modular agents with specific roles and responsibilities.
    • Autonomous Inter-Agent Delegation: Agents can dynamically assign tasks to one another based on capability and workload.
    • Flexible Task Management: Supports both sequential and hierarchical execution patterns.
    • Asynchronous Task Execution: Agents can perform tasks independently and simultaneously to reduce bottlenecks.
    • Tool Integration: Connects with various external tools and software environments.
    • Human-in-the-loop: Supports human input and review at critical stages for quality control.
    • Real-Time Management: Provides dashboards to monitor agent performance and track progress.
  2. Understand CrewAI Core Concepts

    main

    CrewAI is an AI architecture that uses a 'crew' of multiple intelligent agents working together to accomplish complex goals. Key architectural features include:

    • Role-Based Agent Design: Specialized agents with specific roles and responsibilities.
    • Autonomous Inter-Agent Delegation: Agents can dynamically assign tasks to each other based on capabilities.
    • Flexible Task Management: Supports both sequential and hierarchical task execution.
    • Asynchronous Task Execution: Agents can perform tasks independently and simultaneously to reduce bottlenecks.
    • Tool Integration: Ability to integrate with various external tools and software environments.
    • Human Input Review: Allows for human intervention and output customization at critical stages.
    • Real-Time Management Dashboards: Provides monitoring of agent performance and progress.
  3. CrewAI Core Capabilities Overview

    main

    CrewAI is a multi-agent framework built on LangChain that provides the following core capabilities:

    • Agent Specialization and Role Assignment: Define specific roles for targeted task execution.
    • Dynamic Task Decomposition: Break complex tasks into smaller sub-tasks for appropriate agents.
    • Inter-Agent Communication: Enable agents to collaborate and communicate to achieve goals.
    • Integration with Third-Party Tools: Connect with external software and APIs (e.g., SQL databases, Groq, or news APIs).
  4. Understand CrewAI Crew Components

    main

    A CrewAI Crew is a team of AI agents working together to complete tasks. The core components are:

    • Agents: Autonomous AI entities with specific roles and expertise.
    • Tasks: Defined objectives that agents work to complete.
    • Tools: Functions and integrations agents can use.
    • Process: The execution logic, typically set to sequential or hierarchical.
  5. Use the Screenplay Writer Crew to generate scripts from text

    main

    The Screenplay Writer Crew is an example implementation using CrewAI that transforms unstructured text (such as newsgroup posts or email threads) into a formatted screenplay.

    Key capabilities demonstrated:

    • Text Analysis: Analyzing input text to extract themes and arguments.
    • Dialogue Creation: Generating character-driven dialogue based on the analyzed content.
    • Formatting: Converting the dialogue into a structured screenplay format.
    • Task Execution: Demonstrates running single tasks (like spam detection/scoring) and multi-agent crews.
  6. Understand CrewAI Flows orchestration

    main

    CrewAI Flows is an orchestration framework designed to manage complex, multi-crew workflows. It provides capabilities for:

    • Orchestrating multiple crews in sequence or parallel.
    • Managing state across different execution steps.
    • Implementing conditional logic and routing.
    • Creating human-in-the-loop workflows.
    • Building complex automation pipelines.
  7. Understand CrewAI Core Concepts and Features

    main

    CrewAI is an AI architecture that uses a 'crew' of multiple intelligent agents collaborating to achieve complex goals.

    Key Features:

    • Role-Based Agent Design: Specialized agents with specific roles and responsibilities.
    • Autonomous Inter-Agent Delegation: Agents can dynamically assign tasks to each other.
    • Flexible Task Management: Supports both sequential and hierarchical task execution.
    • Asynchronous Task Execution: Agents can perform tasks independently and simultaneously.
    • Tool Integration: Connects with various tools and software environments.
    • Human Input Review: Allows for human intervention and output customization.
    • Real-Time Management Dashboards: Monitor agent performance and track progress.
  8. Explore CrewAI example categories

    main

    The repository is organized into several functional categories to help you find specific implementation patterns:

    • Flows (/flows): Advanced orchestration using CrewAI Flows for complex workflows with state management (e.g., Content Creator Flow, Email Auto Responder Flow).
    • Crews (/crews): Standard multi-agent collaboration implementations (e.g., Game Builder Crew, Stock Analysis, Recruitment).
    • Integrations (/integrations): Examples of CrewAI working with external platforms like Azure OpenAI, NVIDIA models, or the LangGraph framework.
    • Notebooks (/Notebooks): Jupyter notebooks for interactive exploration.
  9. Understand the Lead Score Flow structure

    main

    The lead_score_flow follows a modular orchestration pattern consisting of these steps:

    1. Collect Lead Data: Loads data from leads.csv.
    2. Analyze Lead Data: Uses the LeadAnalysisCrew to process collected data.
    3. Score Leads: Uses the LeadScoringCrew to apply predefined scoring criteria.
    4. Save Lead Scores: Outputs the results to lead_scores.csv.
    5. Write and Save Emails: Generates email drafts for all leads, with a human-in-the-loop step for the top 3 candidates.
  10. Core concepts of CrewAI: Agents, Tasks, Tools, Processes, and Crews

    main

    CrewAI is built on five fundamental components:

    • Agents: Specialized building blocks designed for specific roles (e.g., data analysis, web searching). They support dynamic task decomposition and inter-agent collaboration.
    • Tasks: Specific activities or actions to be completed. Tasks are designed to be highly focused to reduce hallucinations.
    • Tools: Resources and utilities (e.g., web search, APIs, statistical software) that empower agents to execute tasks.
    • Processes: Structured, adaptive sequences of tasks that automate workflows from initiation to completion.
    • Crews: Groups of agents with complementary skills working together to complete complex tasks through role-playing and collaboration.
  11. Understand the Self Evaluation Loop Flow Pattern

    main

    This project implements an iterative self-evaluation pattern using two distinct Crews:

    1. ShakespeareanXPostCrew: Generates an initial output (e.g., a Shakespearean-style X post) based on a topic.
    2. XPostReviewCrew: Evaluates the output against specific criteria (e.g., character count, absence of emojis) and provides feedback.

    The Iterative Loop:

    • If the XPostReviewCrew finds the output invalid, the flow uses the feedback to re-run the ShakespeareanXPostCrew.
    • This loop continues until the post is valid or a maximum retry limit is reached.
    • Once validated (or the limit is hit), the result is finalized and saved (e.g., to report.md).
  12. Customize the Job Posting Crew configuration

    main

    You can tailor the behavior of the Job Posting Crew by modifying the following files:

    • Agent Definitions: Update src/job_posting/config/agents.yaml to change agent roles, goals, or backstories.
    • Task Definitions: Update src/job_posting/config/tasks.yaml to modify the specific tasks the agents perform.
    • Main Logic & Inputs: Modify src/job_posting/main.py to add or change the custom inputs passed to your agents and tasks.

    Project Structure Reference:

    • src/job_posting/main.py: Entry point and main script.
    • src/job_posting/crew.py: Orchestration logic where agents and tasks are combined.
    • src/job_posting/tools: Custom tool classes used by the agents.