By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
RPABOTS.WORLD
  • RPA & Bot Automation
  • Agentic AI & AI Automation
  • AI Agents & Frameworks
  • uipath tutorial
  • UiPath
  • AI Agent Governance
Subscribe
  • Agentic AI
    • AI Agents & Frameworks
    • Agent Memory & RAG
    • Multi-Agent Systems
    • UiPath Agentic Automation
  • RPA
    • Topics
      • UiPath
        • uipath tutorial
  • Tools & Platforms
    • AI Builder
    • Robot Framework
  • Use Cases
  • Learn
    • UiPath
      • uipath certification
      • uipath interview questions
Reading: A Beginner’s Guide to Agentic AI: Working with CrewAI
RPABOTS.WORLDRPABOTS.WORLD
Font ResizerAa
  • Agentic AI
  • RPA
  • Tools & Platforms
  • Use Cases
  • Learn
Search
  • Agentic AI
    • AI Agents & Frameworks
    • Agent Memory & RAG
    • Multi-Agent Systems
    • UiPath Agentic Automation
  • RPA
    • Topics
  • Tools & Platforms
    • AI Builder
    • Robot Framework
  • Use Cases
  • Learn
    • UiPath

Must Read

Databricks Agent Bricks: Enterprise AI Agent Platform Guide 2

Databricks Agent Bricks: Enterprise AI Agent Platform Guide

Tungsten Automation (Formerly Kofax): How the IDP Pioneer Is Betting on Agentic AI to Reinvent Enterprise Document Automation — Complete Guide for Agentic AI Architects (2026)

GitHub Universe 2026: Copilot Fusion, the Agent-First SDLC, and What It Means for Agentic AI Architects

Gartner Hype Cycle for Agentic AI 2026: The Complete Guide

Traversal AI: The $1B AI SRE Unicorn Reshaping How Enterprises Handle Production Incidents — Complete Guide for Agentic AI Architects (2026)

Follow US
RPABOTS.WORLD > Blog > Agentic AI & AI Automation > A Beginner’s Guide to Agentic AI: Working with CrewAI
Agentic AI & AI Automation

A Beginner’s Guide to Agentic AI: Working with CrewAI

Satish Prasad
By
Satish Prasad
3 weeks ago
Agentic AI & AI Automation
1 Comment
Share
13 Min Read
SHARE

Hey there, tech enthusiasts! 👋

Contents
  • ✨ What is CrewAI?
    • 👉 Key Features of CrewAI
  • 💪 Getting Started with CrewAI
    • Installation
  • Understanding Agents in CrewAI
  • Example: Defining an Agent
        • Content Writer Agent
        • Content Editor Agent
  • Understanding Task in CrewAI
  • Example: Defining an Task
        • Writing Task
        • Editing Task
  • 🔒 LLM Class in CrewAI
    • Key Features of the LLM Class
      • 1. Model Specification
      • 2. Provider Configuration
      • 3. Parameter Customization
    • Integrating LLMs with Agents
    • Configuring LLMs via Environment Variables
  • Crew Class in CrewAI
    • Key Components of the Crew Class
      • 1. Agents
      • 2. Tasks
      • 3. Process Flow
      • 4. Verbose Mode
  • Example : Orchestrating the Crew
    • How It Works
    • Why This Example?
  • ! Important
    • Key Features
    • Setup
  • Join Me on This Journey!

I’m super excited to kick off my 50-day learning journey into Agentic AI, and I’m starting today with CrewAI—a powerful open-source Python framework designed to orchestrate role-playing, autonomous AI agents that collaborate to tackle complex tasks. 🤖

If you’re curious about Agentic Automation and want to make a career shift from RPA to Agentic AI, this is the perfect time to join me! Let’s dive into the world of AI-driven collaboration and automation together. 🌟


✨ What is CrewAI?

CrewAI is an open-source framework that allows you to create and manage autonomous AI agents that work together to solve complex problems. By assigning specific roles, goals, and tools to each agent, CrewAI enables seamless collaboration, making it a game-changer for automation and AI-driven workflows.

Here’s what makes CrewAI stand out:

A Beginner’s Guide to Agentic AI: Working with CrewAI 3

👉 Key Features of CrewAI

  • Role-Based Architecture: Each agent is assigned a distinct role and goal, ensuring specialized task execution.
  • Agent Orchestration: Multiple agents work cohesively towards common objectives.
  • Tool Integration: Agents can use external tools to extend their capabilities.
  • Scalability: Whether you’re working on a small project or a complex system, CrewAI adapts to your needs.
  • Production-Grade Architecture: Support for both high-level abstractions and low-level customization, with robust error handling and state management.
  • Model Flexibility: Integrate with both OpenAI and open-source models, providing versatility in deployment.
  • Event-Driven Flows: Build complex, real-world workflows with precise control over execution paths, state management, and conditional logic.

CrewAI’s modular architecture makes it ideal for scaling AI systems across various industries. Agents, tasks, and tools are reusable components that can be combined in various configurations to solve complex problems. Whether you’re automating workflows in finance, orchestrating research in academia, or managing customer queries in e-commerce, CrewAI provides a consistent, extensible framework.

💪 Getting Started with CrewAI

Installation

To get started, ensure you have Python (version 3.10 to 3.13) installed. Then, install CrewAI using pip:

pip install crewai

For additional tools, install with:

More Read

AI Agent FinOps: Token Economics Complete Guide (2026)
CUA: The Open-Source Computer-Use Agent Infrastructure That’s Replacing RPA Scripts — Complete Guide for Agentic AI Architects (2026)
Claude Sonnet 5 vs GPT-5.6 vs Grok 4.5 vs Muse Spark 1.1: The July 2026 Agentic AI Model Showdown
pip install 'crewai[tools]'

Understanding Agents in CrewAI

An agent in CrewAI is a fundamental component designed to perform specific tasks within a multi-agent system. Each agent has:

  1. Role: Defines the agent’s function (e.g., “Data Researcher”).
  2. Goal: Specifies the objective the agent aims to achieve.
  3. Backstory: Provides context to influence the agent’s behavior.
  4. Tools: Extends the agent’s capabilities (e.g., web search tools).
  5. Configuration: Agents can be configured using YAML files for modular setups.

Example: Defining an Agent

Content Writer Agent

This agent is responsible for generating high-quality content based on a given topic.

from crewai import Agent

content_writer = Agent(
    role="Content Writer",
    goal="Write engaging and informative blog posts on AI and technology trends.",
    backstory="A creative writer with a passion for technology and AI, known for crafting compelling narratives.",
    tools=[SerperDevTool()],  # Tool for web research
    verbose=True
)
Content Editor Agent

This agent reviews and refines the content generated by the Content Writer.

content_editor = Agent(
    role="Content Editor",
    goal="Review and polish blog posts to ensure clarity, accuracy, and engagement.",
    backstory="A meticulous editor with a sharp eye for detail and a knack for improving readability.",
    verbose=True
)

Agents can also be defined in a YAML configuration file (agents.yaml), which allows for a clear and organized structure:

Understanding Task in CrewAI

In CrewAI, the Task class is the backbone of defining and managing units of work that agents execute. Each task is designed to be modular, flexible, and highly configurable, ensuring that agents can perform their duties efficiently and effectively. Let’s break down the key attributes of the Task class and how they work together to create powerful workflows.

In CrewAI, a Task represents a unit of work executed by an agent, defined by key attributes:

  • Description: Explains the task’s purpose.
  • Expected Output: Defines the desired result.
  • Agent: Assigned to complete the task.
  • Tools: Optional resources for execution.
  • Async Execution: Specifies if the task runs asynchronously.
  • Context: Provides relevant data from other tasks.

Example: Defining an Task

Writing Task

This task instructs the Content Writer to create a blog post on a specific topic.

from crewai import Task

write_blog_task = Task(
    description="Write a 1000-word blog post on the impact of Agentic AI on the future of automation.",
    expected_output="A well-structured, engaging, and informative blog post in markdown format.",
    agent=content_writer,
    tools=[search_tool],  # Tool for research
    async_execution=False
)
Editing Task

This task instructs the Content Editor to review and refine the blog post.

edit_blog_task = Task(
    description="Review and edit the blog post written by the Content Writer to ensure it meets quality standards.",
    expected_output="A polished and error-free blog post ready for publication.",
    agent=content_editor,
    async_execution=False
)

Tasks can also be defined in a YAML configuration file (tasks.yaml), allowing for organized and modular setups:

🔒 LLM Class in CrewAI

The LLM class is pivotal for configuring the language models that agents use to process and generate text. It provides flexibility in connecting to various LLM providers, including OpenAI-compatible models and local models via Ollama.


Key Features of the LLM Class

1. Model Specification

You can define the model name, such as:

  • "gpt-4"
  • "gpt-3.5-turbo"
  • "ollama/llama3.1"

2. Provider Configuration

Set up connections to different LLM providers by specifying:

  • API Key: For authenticated access.
  • Base URL: For custom endpoints (e.g., OpenAI or local Ollama servers).

3. Parameter Customization

Fine-tune the model’s behavior using parameters like:

  • Temperature: Controls the randomness of the output.
  • Max Tokens: Limits the length of the generated response.
  • Top_p: Applies nucleus sampling to limit the token selection pool.

Example: Configuring an LLM

from crewai import LLM

openai_llm = LLM(
    model="gpt-4",
    api_key="your-openai-api-key",
    api_base="https://api.openai.com/v1"
)

Integrating LLMs with Agents

Agents in CrewAI can be assigned specific LLMs to perform their tasks. For example:

from crewai import Agent

researcher = Agent(
    role="Researcher",
    goal="Conduct in-depth research on AI developments.",
    llm=openai_llm  # Assigning the OpenAI LLM
)

Configuring LLMs via Environment Variables

Alternatively, you can configure LLMs using environment variables for dynamic and secure setups:

import os

os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
os.environ["OPENAI_API_BASE"] = "https://api.openai.com/v1"

Crew Class in CrewAI

The Crew class is the central component that orchestrates the collaboration of multiple agents and tasks. It manages the sequence and interaction of tasks, ensuring efficient and organized workflows.


Key Components of the Crew Class

1. Agents

A list of Agent instances that define the roles and responsibilities within the crew.

2. Tasks

A list of Task instances that outline the specific actions to be executed.

3. Process Flow

Determines the execution strategy of tasks, such as:

  • Sequential: Tasks are executed one after another.
  • Hierarchical: A manager agent coordinates the crew, delegating tasks and validating outcomes.

4. Verbose Mode

Enables detailed logging of the crew’s operations for monitoring and debugging.

Example : Orchestrating the Crew

Now, let’s create a Crew to manage these agents and tasks.

from crewai import Crew, Process

content_creation_crew = Crew(
    agents=[content_writer, content_editor],
    tasks=[write_blog_task, edit_blog_task],
    process=Process.sequential,  # Tasks will be executed one after another
    verbose=True
)

# Execute the crew
final_output = content_creation_crew.kickoff()
print(final_output)

The kickoff() method triggers the execution of tasks as per the defined process flow.

Additional Configurations:

  • Output Logging: Specify an output log file to record the crew’s execution details.
  • Token Usage Monitoring: Access the usage_metrics attribute post-execution to review language model usage metrics.
  • Memory Utilization: Implement memory mechanisms to enhance the crew’s performance over time.

For comprehensive details on configuring and utilizing the Crew class, refer to the CrewAI Documentation on Crews

How It Works

  1. The Content Writer researches and writes the blog post.
  2. The Content Editor reviews and polishes the blog post.
  3. The Crew ensures the tasks are executed in sequence, producing a high-quality, publication-ready blog post.

import os
from crewai import Agent, Task, Crew, Process
from crewai_tools import SerperDevTool,WebsiteSearchTool,DirectoryReadTool,FileReadTool

# Set up API keys
os.environ["SERPER_API_KEY"] = "" # serper.dev API key
os.environ["OPENAI_API_KEY"] = ""

# Instantiate tools
docs_tool = DirectoryReadTool(directory='./blog-posts')
file_tool = FileReadTool()
search_tool = SerperDevTool()
web_rag_tool = WebsiteSearchTool()


# Define your agents with roles and goals
content_writer = Agent(
    role="Content Writer",
    goal="Write engaging and informative blog posts on AI and technology trends.",
    backstory="A creative writer with a passion for technology and AI, known for crafting compelling narratives.",
    tools=[search_tool,web_rag_tool],  # Tool for web research
    verbose=True
)

content_editor = Agent(
    role="Content Editor",
    goal="Review and polish blog posts to ensure clarity, accuracy, and engagement.",
    backstory="A meticulous editor with a sharp eye for detail and a knack for improving readability.",
    tools=[docs_tool, file_tool],
    verbose=True
)


# Create tasks for your agents
write_blog_task = Task(
    description="Write a 1000-word blog post on the impact of Agentic AI on the future of automation.",
    expected_output="A well-structured, engaging, and informative blog post in markdown format.",
    agent=content_writer,
    tools=[search_tool],  # Tool for research
    async_execution=False
)

edit_blog_task = Task(
    description="Review and edit the blog post written by the Content Writer to ensure it meets quality standards.",
    expected_output="A polished and error-free blog post ready for publication.",
    agent=content_editor,
    async_execution=False
)

# Instantiate your crew with a sequential process
content_creation_crew = Crew(
    agents=[content_writer, content_editor],
    tasks=[write_blog_task, edit_blog_task],
    process=Process.sequential,  # Tasks will be executed one after another
    verbose=True
)

# Execute the crew
final_output = content_creation_crew.kickoff()
print(final_output)

Why This Example?

  • Real-World Application: This workflow mimics real-world content creation processes.
  • Role Specialization: Each agent has a clear role and goal, ensuring efficiency.
  • Scalability: You can add more agents (e.g., a Graphic Designer for visuals) or tasks (e.g., SEO optimization) as needed.

! Important

The SerperDevTool is a powerful utility designed to perform semantic searches across the internet using the serper.dev API. It allows developers to fetch the most relevant search results based on a user-provided query, with options for customization such as localization, country-specific results, and more. Below is a comprehensive guide to help you get started with the tool, including installation, setup, and usage examples.


Key Features

  1. Semantic Search: Performs context-aware searches to return highly relevant results.
  2. Customization: Supports parameters like country, location, locale, and n_results for tailored searches.
  3. Easy Integration: Simple installation and setup process.
  4. Real-Time Results: Fetches up-to-date information from the internet.

Setup

  1. Obtain an API Key:
    • Register for a free account at serper.dev to acquire your API key.
  2. Configure Environment Variables:
    • Store your API key in an environment variable named SERPER_API_KEY.

Join Me on This Journey!

If you’re excited about Agentic AI and want to learn how to build such workflows, follow along with my 50-day journey! 🚀

  • Like this post if you found this breakdown helpful!
  • Share it with your network to spread the knowledge.
  • Follow me for daily updates and insights.
  • Comment below if you’d like to see more examples like this!

📌 Hashtags:
#AgenticAI #CrewAI #LLM #AIWorkflows #TaskOrchestration #AIJourney #RPAToAgentic #CareerShift #LearnAI #TechTransformation

📌 Additional Resources:

Let’s build the future of automation together! 💪🔥

TAGGED:crewai
Share This Article
Facebook Print
BySatish Prasad
Follow:
Satish Prasad An NIT Kurukshetra alumnus and Intelligent Automation Architect, Satish brings 15+ years of battle-tested experience deploying over 100 production bots across Investment Banking and Logistics. Today, he bridges the gap between Data Analytics and the frontier of Agentic AI, building autonomous agents that transform complex business logic into intelligent automation. Catch his latest insights on the evolution of tech vibes and digital autonomy.
Previous Article RPA Security 🔒UiPath AI Trust Layer: A New Era of Responsible AI-Powered Automation
Next Article Agentic AI Demystified: 8 Essential Types of Intelligent AI Agents Driving Automation
1 Comment 1 Comment
  • Pingback: Memory in AI Agents: Unlocking Contextual Intelligence with CrewAI and AutoGen -%sitename%

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You Might also Like

OpenClaw 2.0: The Open-Source Agent Platform Going Enterprise — A Complete Guide for Agentic AI Architects (2026)

OpenClaw 2.0 adds multiplayer sessions, enterprise security, and a rebuilt UI to the 250K-star open-source…

By
Satish Prasad
28 Min Read

EU AI Act Enforcement Goes Live: The Agentic AI Architect’s Compliance Playbook (2026)

EU AI Act enforcement activated August 2, 2026 — €15M fines, GPAI scrutiny, Article 50…

By
Satish Prasad
32 Min Read

Gartner’s Inaugural Magic Quadrant for Agentic Software QA Platforms: The Complete Guide for RPA and Automation Teams (2026)

Gartner's first Magic Quadrant for Agentic Software QA Platforms evaluates 12 vendors. UiPath, Tricentis, and…

By
Satish Prasad
29 Min Read

Microsoft Work IQ and the Work IQ MCP Server: The Complete Guide for Agentic AI Architects (2026)

Microsoft Work IQ and the Work IQ MCP Server: The Complete Guide for Agentic AI…

By
Satish Prasad
29 Min Read

Salesforce Agentforce 2026: Multi-Agent Orchestration Deep Dive

Salesforce Agentforce hits $800M ARR with multi-agent orchestration GA, Atlas 3.0, A2A/MCP support, and U.S.…

By
Satish Prasad
28 Min Read
AWS Dogwood & AgentCore Temporal Policies: The Agentic AI Architect's Guide (2026) 5

AWS Dogwood & AgentCore Temporal Policies: The Agentic AI Architect’s Guide (2026)

AWS Dogwood extends Cedar with temporal logic to govern AI agent tool-call sequences.

By
Satish Prasad
29 Min Read
RPABOTS.WORLDRPABOTS.WORLD
Follow US
  • About RPABOTS.WORLD
  • Write For Us
  • Contact-us
  • Privacy Policy
  • Cookie Policy
  • Disclosure