AI?
Agentic AI, originally introduced by Andrew Ng as AI “partners” that autonomously , is a brand new concept emerged from the burst of Generative AI applications. The term has rapidly gained popularity since late July 2025, in accordance with its search volume in Google Trends.
Despite its recent appearance, the research article from BCG “How Agentic AI Is Transforming Enterprise Platforms” indicates that organizations have been actively adopting Agentic AI workflows to rework their core technology platforms and assist in marketing automation, customer services, workplace productivity etc, resulting in 20% to 30% faster workflow cycles.
From LLMs to Multi-Agent Systems
What distinguishes an Agentic AI system from traditional automation systems is its autonomy to plan actions and logic, so long as achieving a selected, predefined objective. In consequence, there’s less rigid orchestration or predetermined decision-making trajectories governing the Agent’s intermediate steps. ”Synergizing Reasoning and Acting in Language Models” is taken into account the foundational paper that formalizes the early-stage LLM Agent framework “ReAct”, consisting of three key elements — actions, thoughts and observations. Should you are concerned about more details of how ReAct works, please see my blog post “6 Common LLM Customization Strategies Briefly Explained“.
With the rapid growth of this field, it becomes evident that a single LLM Agent cannot meet up with the high demand of AI applications and integrations. Subsequently, Multi-Agent systems are developed to orchestrate Agent’s functionalities right into a dynamic workflow. While each agent instance is role-based, task-focused, emphasizing on achieving a single objective, a multi-agent system is multi-functional and more generalized in its capabilities. The LangChain article “Benchmarking Multi-Agent Architectures” has shown that when the number of data domains required in a task increases, the performance of a single-agent system deteriorates while a multi-agent system can achieve sustainable performance by reduce the quantity of noise feeding into each individual agent.
Construct a Easy Agentic AI System Using CrewAI
CrewAI is an open-source Python framework that permits developers to construct production-ready and collaborative AI agent teams to tackle complex tasks. In comparison with other popular Agent frameworks like LangChain and LlamaIndex, it focuses more on role-based multi-agent collaborations, while offering less flexibility for complex agentic architecture. Even though it is a comparatively younger framework, it’s gaining increasing attractions ranging from July 2025 as a result of the benefit of implementation.
Now that we’ve covered the core concepts of the CrewAI framework—Agent, Task, Tool, and Crew—let’s have a look at sample code to construct a minimal viable agentic system.
1. Install CrewAI and arrange environment variables using bash commands below, e.g. export OpenAI API key as an environment variable for accessing OpenAI GPT models.
pip install crewai
pip install 'crewai[tools]'
export OPENAI_API_KEY='your-key-here'
2. Create Tools from CrewAI’s built-in tool list, e.g. apply DirectoryReadTool() to access a directory, and FileReadTool() to read files stored within the directory.
from crewai_tools import DirectoryReadTool, FileReadTool
doc_tool = DirectoryReadTool(directory='./articles')
file_tool = FileReadTool()
3. Initiate an Agent by specifying its role, goal, and providing it with tools.
from crewai import Agent
researcher = Agent(
role="Researcher",
goal="Find information on any topic based on the provided files",
tools=[doc_tool, file_tool]
)
4. Create a Task by providing an outline and assign an agent to execute the duty.
from crewai import Task
research_task = Task(
description="Research the newest AI trends",
agent=researcher
)
5. Construct the Crew by combining your Agents and Tasks together. Start the workflow execution using kickoff().
from crewai import Crew
crew = Crew(
agents=[researcher],
tasks=[research_task]
)
result = crew.kickoff()
Develop an Agentic Social Media Marketing Crew
0. Project Objectives
Let’s expand on this easy CrewAI example by making a Social Media Marketing team through the step-by-step procedures below. This team will generate blog posts based on the user’s topic of interest and create tailored campaign messages for sharing on different social media platforms.

Blog Post

X(Twitter) MessageDiscover the Way forward for Agentic AI! Have you ever ever wondered how Agentic AI is about to redefine our interaction with technology by 2025? Understanding AI trends for 2025 just isn't only crucial for technology enthusiasts but essential for businesses across various sectors. #AgenticAI #AITrends
YouTube MessageExplore Groundbreaking Trends in Agentic AI! 🌟 Uncover how Agentic AI is transforming industries in ways you never imagined! By 2025, these revolutionary trends will reshape how we engage with technologies, particularly in banking and finance. Are you able to embrace the longer term? Do not forget to read our latest blog post and subscribe for more insights!
Substack MessageThe Changing Landscape of Agentic AI: What You Must Know In 2025, the evolving world of Agentic AI is about to reshape industries, particularly in finance and banking. This blog covers key trends similar to the transformational potential of agentic AI, recent regulatory frameworks, and significant technological advancements. How can businesses successfully integrate agentic AI while managing risks? What does the longer term of this technology mean for consumers? Join the dialogue in our latest post, and let's explore how these innovations will impact our future together!
1. Project Environment Setup
Follow the CrewAI’s QuickStart guide to setup the event environment. We use the next directory structure for this project.
├── README.md
├── pyproject.toml
├── requirements.txt
├── src
│ └── social_media_agent
│ ├── __init__.py
│ ├── crew.py
│ ├── primary.py
│ └── tools
│ ├── __init__.py
│ ├── browser_tools.py
│ └── keyword_tool.py
└── uv.lock
2. Develop Tools
The primary tool we add to the crew is WebsiteSearchToolwhich is a built-in tool implemented by CrewAI for conducting semantic searches throughout the content of internet sites.
We just need just a few lines of code to put in the crewai tools package and use the WebsiteSearchTool. This tool is accessible by the market researcher agent to search out latest market trends or industry news related to a given topic.
pip install 'crewai[tools]'
from crewai_tools import WebsiteSearchTool
web_search_tool = WebsiteSearchTool()
The screenshot below shows the output of web_search_tool when given the subject “YouTube videos”.

Next, we’ll create a custom keyword_tool by inheriting from the BaseTool class and using the SerpApi (Google Trend API). As shown within the code below, this tool generates the highest searched, trending queries related to the input keyword. This tool is accessible by the marketing specialist agent to research trending keywords and refine the blog post for SEO. We’ll see an example of the keyword tool’s output in the following section.
import os
import json
from dotenv import load_dotenv
from crewai.tools import BaseTool
from serpapi.google_search import GoogleSearch
load_dotenv()
api_key = os.getenv('SERPAPI_API_KEY')
class KeywordTool(BaseTool):
name: str = "Trending Keyword Tool"
description: str = "Get search volume of related trending keywords."
def _run(self, keyword: str) -> str:
params = {
'engine': 'google_trends',
'q': keyword,
'data_type': 'RELATED_QUERIES',
'api_key': api_key
}
search = GoogleSearch(params)
try:
rising_kws = search.get_dict()['related_queries']['rising']
top_kws = search.get_dict()['related_queries']['top']
return f"""
Rising keywords: {rising_kws} n
Top keywords: {top_kws}
"""
except Exception as e:
return f"An unexpected error occurred: {str(e)}"
3. Define the Crew Class

Within the crew.py script, we define our social media crew team with three agents—, , —and assign tasks to every. We initialize the SocialMediaCrew() class using the @CrewBase decorator. The topic attribute passes the user’s input about their topic of interest, and llm , model_name attributes specify the default model used throughout the Crew workflow.
@CrewBase
class SocialMediaCrew():
def __init__(self, topic: str):
"""
Initialize the SocialMediaCrew with a selected topic.
Args:
topic (str): The primary topic or subject for social media content generation
"""
self.topic = topic
self.model_name = 'openai/gpt-4o'
self.llm = LLM(model=self.model_name,temperature=0)
4. Define Agents
CrewAI Agents depend on three essential parameters——to define their characteristics in addition to the context they’re operating in. Moreover, we offer Agents with relevant tools to facilitate their jobs and other parameters to regulate the resource consumption of the Agent calling and avoid unnecessary LLM token usage.
For instance, we define the “Marketing Specialist Agent” using the code below. Start with using @agent decorator. Define the role as “Marketing Specialist” and supply the access to keyword_tool we previously developed, in order that the marketing specialist can research the trending keywords to refine the blog contents for optimal Search engine marketing performance.
@CrewBase
class SocialMediaCrew():
def __init__(self, topic: str):
"""
Initialize the SocialMediaCrew with a selected topic.
Args:
topic (str): The primary topic or subject for social media content generation
"""
self.topic = topic
self.model_name = 'openai/gpt-4o'
self.llm = LLM(model=self.model_name,temperature=0)
Setting verbose to true allows us to utilize CrewAI’s traceability functionality to watch intermediate output throughout the Agent calling. The screenshots below show the thought strategy of “Marketing Specialist” Agent using thekeyword_tool to research “YouTube trends”, in addition to the Search engine marketing-optimized blog post based on the tool output.


An alternate approach to define Agent is to store the Agent context in a YAML file using the format below, providing additional flexibility of experiment and iterating on prompt engineering when vital.
marketing_specialist:
role: >
"Marketing Specialist"
goal: >
"Improve the blog post to optimize for Search Engine Optimization using the Keyword Tool and create customized, channel-specific messages for social media distributions"
backstory: >
"A talented Marketing Specialist with expertise in Search engine marketing and social media campaign design"
5. Define Tasks
If an Agent is taken into account as the worker (“who”) specialised in a site (e.g. content creation, research), embodied with a persona or characteristics, then Tasks are the actions (“what”) that the worker performs with predefined objectives and output expectations.
In CrewAI, a Task is configured using description, expected_output, and the optional parameter output_file saves the intermediate output as a file. Alternatively, additionally it is really helpful to make use of a standalone YAML file to supply a cleaner, maintainable option to define Tasks. Within the code snippet below, we offer precise instructions for the crew to perform 4 tasks and assign them to agents with relevant skillsets. We also save the output of every task within the working folder for the benefit of comparing different output versions.
research: research in the marketplace trend of the given topic; assigned to the market researcher.write: write a fascinating blog post; assigned to the content creator.refine: refine blog post based for optimal Search engine marketing performance; assigned to the marketing specialist.distribute: generate platform-specific messages for distributing on each social media channel; assigned to the marketing specialist.
@task
def research(self) -> Task:
return Task(
description=f'Research the 2025 trends within the {self.topic} area and supply a summary.',
expected_output=f'A summary of the highest 3 trending news in {self.topic} with a novel perspective on their significance.',
agent=self.market_researcher()
)
@task
def write(self) -> Task:
return Task(
description=f"Write a fascinating blog post concerning the {self.topic}, based on the research analyst's summary.",
expected_output='A 4-paragraph blog post formatted in markdown with engaging, informative, and accessible content, avoiding complex jargon.',
agent=self.content_creator(),
output_file=f'blog-posts/post-{self.model_name}-{timestamp}.md'
)
@task
def refine(self) -> Task:
return Task(
description="""
Refine the given article draft to be highly Search engine marketing optimized for trending keywords.
Include the keywords naturally throughout the text (especially in headings and early paragraphs)
Make the content easy for each search engines like google and yahoo and users to grasp.
""",
expected_output='A refined 4-paragraph blog post formatted in markdown with engaging and Search engine marketing-optimized contents.',
agent=self.marketing_specialist(),
output_file=f'blog-posts/seo_post-{self.model_name}-{timestamp}.md'
)
@task
def distribute(self) -> Task:
return Task(
description="""
Generate three distinct versions of the unique blog post description, each tailored for a selected distribution channel:
One version for X (formerly Twitter) – concise, engaging, and hashtag-optimized.
One version for YouTube post – suitable for video audience, includes emotive cue and robust call-to-action.
One version for Substack – barely longer, informative, focused on newsletter subscribers.
Each description have to be optimized for the norms and expectations of the channel, making subtle adjustments to language, length, and formatting.
Output ought to be in markdown format, with each version separated by a transparent divider (---).
Use a brief, impactful headline for every version to further increase channel fit.
""",
expected_output='3 versions of descriptions of the unique blog post optimized for distribution channel, formatted in markdown, separated by dividers.',
agent=self.marketing_specialist(),
output_file=f'blog-posts/social_media_post-{self.model_name}-{timestamp}.md'
)
The CrewAI output log below shows task execution details, including status, agent assignments, and power usage.
🚀 Crew: crew
├── 📋 Task: research (ID: 19968f28-0af7-4e9e-b91f-7a12f87659fe)
│ Assigned to: Market Research Analyst
│ Status: ✅ Accomplished
│ └── 🔧 Used Search in a selected website (1)
├── 📋 Task: write (ID: 4a5de75f-682e-46eb-960f-43635caa7481)
│ Assigned to: Content Author
│ Status: ✅ Accomplished
├── 📋 Task: refine (ID: fc9fe4f8-7dbb-430d-a9fd-a7f32999b861)
│ **Assigned to: Marketing Specialist**
│ Status: ✅ Accomplished
│ └── 🔧 Used Trending Keyword Tool (1)
└── 📋 Task: distribute (ID: ed69676a-a6f7-4253-9a2e-7f946bd12fa8)
**Assigned to: Marketing Specialist**
Status: ✅ Accomplished
└── 🔧 Used Trending Keyword Tool (2)
╭───────────────────────────────────────── Task Completion ──────────────────────────────────────────╮
│ │
│ Task Accomplished │
│ Name: distribute │
│ Agent: Marketing Specialist │
│ Tool Args: │
│ │
│ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯
6. Kick Off the Crew
As the ultimate step within the crew.py script, we orchestrate Tasks, Agents and Tools together to define the crew.
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
verbose=True,
planning=True,
)
Within the primary.py, we instantiate a SocialMediaCrew() object and run the crew by accepting the user’s input for his or her topic of interest.
# primary.py
from social_media_agent.crew import SocialMediaCrew
def run():
# Replace together with your inputs, it can robotically interpolate any tasks and agents information
inputs = {
'topic': input('Enter your interested topic: '),
}
SocialMediaCrew(topic=inputs['topic']).crew().kickoff(inputs=inputs)
Now let’s use “Agentic AI” for instance and listed below are output files generated by our social media crew after sequentially executing the tasks.



Take-Home Message
This tutorial demonstrates methods to create an Agentic AI system using CrewAI framework. By orchestrating specialized agents with distinct roles and tools, we implement a multi-agent team that’s able to generating optimized content for various social media platforms.
- Environment Setup: Initialize your development environment with vital dependencies and tools for CrewAI development
- Develop Tools: Develop the foundational tool structure with built-in and custom tool components
- Define Agents: Create specialized agents with clearly defined roles, goals, and backstories. Equip them with relevant tools to support their role.
- Create Tasks: Create tasks with clear descriptions and expected outputs. Assign Agents for task execution.
- Kick Off the Crew: Orchestrate Tasks, Agents and Tools together as a Crew and execute the workflow.
