By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
RPABOTS.WORLD
  • RPA & Bot Automation
  • AI Agents & Frameworks
  • Agentic AI & AI Automation
  • uipath tutorial
  • MCP
  • UiPath
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

The $97.9 Billion AI Workflow Automation Market: What Every Agentic AI Architect Needs to Know 2

The $97.9 Billion AI Workflow Automation Market: What Every Agentic AI Architect Needs to Know

OpenAI GPT-6.1 Terra: The Complete Guide for Agentic AI Architects — Computer Use, Pricing, and What It Means for RPA (2026) 4

OpenAI GPT-6.1 Terra: The Complete Guide for Agentic AI Architects — Computer Use, Pricing, and What It Means for RPA (2026)

Top 115+ AWS Bedrock AgentCore Interview Questions & Answers (2026)

Top 110+ LangGraph Interview Questions and Answers (2026) 6

Top 110+ LangGraph Interview Questions and Answers (2026)

Top 100+ Google ADK Interview Questions and Answers for 2026 8

Top 100+ Google ADK Interview Questions and Answers for 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
24 hours 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 9

👉 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

Salesforce Agentforce Job-Ready Agents and Long-Horizon Runtime: The 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
SAP Joule Studio 2.0 and the Autonomous Enterprise: The Complete Guide for Agentic AI Architects (2026)
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

DeepSeek Harness: The Open-Source Agent Runtime Where Everything Is a Plugin — The Complete Guide for Agentic AI Architects (2026)

DeepSeek Harness hit 218K GitHub stars in 4 weeks. Architecture deep dive: Cordis plugins, session…

By
Satish Prasad
27 Min Read

Salesforce Agentforce Job-Ready Agents: The Complete Guide for Agentic AI Architects (2026)

Salesforce launches 7 named Agentforce agents with a long-horizon runtime, AI Skills, and multi-agent orchestration.…

By
Satish Prasad
25 Min Read

OpenAI DevDay 2026: Dots, GPT-6.1 Sol, and the Agents API — The Complete Guide for Agentic AI Architects

OpenAI DevDay 2026 unpacked: Dots always-on agents, GPT-6.1 Sol benchmarks and pricing, Agents API orchestration…

By
Satish Prasad
32 Min Read
robot pointing on a wall

Microsoft Copilot Autopilot: The Always-On Enterprise AI Agent Guide for Agentic AI Architects

Microsoft Copilot Autopilot is a persistent AI agent with its own identity and memory.

By
Satish Prasad
24 Min Read
Bedrock Agents Classic Sunset: Migration Guide to AgentCore (2026) 11

Bedrock Agents Classic Sunset: Migration Guide to AgentCore (2026)

AWS sunsets Bedrock Agents Classic on July 30, 2026. Complete migration guide to AgentCore with…

By
Satish Prasad
28 Min Read

Harness Autonomous Worker Agents: The Complete Guide to Agentic DevOps for RPA and Automation Architects (2026)

Harness Worker Agents turn every CI/CD step into a governed AI agent. Architecture, marketplace, governance,…

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