Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • Nothing Phone (4a) Pro Review: A Close Second
    • Match Group CEO Spencer Rascoff says growing women’s share on Tinder is his “primary focus” to stem user declines; Sensor Tower says 75% of Tinder users are men (Kieran Smith/Financial Times)
    • Today’s NYT Connections Hints, Answers for April 20 #1044
    • AI Machine-Vision Earns Man Overboard Certification
    • Battery recycling startup Renewable Metals charges up on $12 million Series A
    • The Influencers Normalizing Not Having Sex
    • Sources say NSA is using Mythos Preview, and a source says it is also being used widely within the DoD, despite Anthropic’s designation as a supply chain risk (Axios)
    • Today’s NYT Wordle Hints, Answer and Help for April 20 #1766
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Monday, April 20
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»Artificial Intelligence»How to Build Your Own Agentic AI System Using CrewAI
    Artificial Intelligence

    How to Build Your Own Agentic AI System Using CrewAI

    Editor Times FeaturedBy Editor Times FeaturedNovember 9, 2025No Comments13 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    AI?

    Agentic AI, initially launched by Andrew Ng as AI “companions” that autonomously plan, execute, and full advanced duties, is a brand new idea emerged from the burst of Generative AI purposes. The time period has quickly gained recognition since late July 2025, in response to its search quantity in Google Developments.

    “Agentic AI” Google search quantity over the previous 12 months

    Regardless of its latest look, the analysis article from BCG “How Agentic AI Is Transforming Enterprise Platforms” signifies that organizations have been actively adopting Agentic AI workflows to remodel their core know-how platforms and help in advertising automation, buyer companies, office productiveness and so on, main to twenty% to 30% quicker workflow cycles.

    From LLMs to Multi-Agent Techniques

    What distinguishes an Agentic AI system from conventional automation programs is its autonomy to plan actions and logic, so long as reaching a selected, predefined goal. In consequence, there’s much less inflexible 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 parts — actions, ideas and observations. In case you are enthusiastic about extra particulars of how ReAct works, please see my weblog put up “6 Common LLM Customization Strategies Briefly Explained“.

    With the speedy development of this subject, it turns into evident {that a} single LLM Agent can’t meet up with the excessive demand of AI purposes and integrations. Subsequently, Multi-Agent programs are developed to orchestrate Agent’s functionalities right into a dynamic workflow. Whereas every agent occasion is role-based, task-focused, emphasizing on reaching a single goal, a multi-agent system is multi-functional and extra generalized in its capabilities. The LangChain article “Benchmarking Multi-Agent Architectures” has proven that when the variety of data domains required in a job will increase, the efficiency of a single-agent system deteriorates whereas a multi-agent system can obtain sustainable efficiency by scale back the quantity of noise feeding into every particular person agent.

    Construct a Easy Agentic AI System Utilizing CrewAI

    CrewAI is an open-source Python framework that enables builders to construct production-ready and collaborative AI agent groups to sort out advanced duties. In comparison with different fashionable Agent frameworks like LangChain and LlamaIndex, it focuses extra on role-based multi-agent collaborations, whereas providing much less flexibility for advanced agentic structure. Though it’s a comparatively youthful framework, it’s gaining rising sights ranging from July 2025 because of the ease of implementation.

    We are able to use the analogy of hiring a cross-functional venture group (or a Crew) when utilizing CrewAI framework to construct the Agentic system, the place every AI Agent within the Crew has a selected position able to finishing up a number of role-related Duties. Brokers are geared up with Instruments that facilitate them finishing the roles.

    Now that we’ve lined the core ideas of the CrewAI framework—Agent, Job, Instrument, and Crew—let’s take a look at pattern code to construct a minimal viable agentic system.

    1. Set up CrewAI and arrange atmosphere variables utilizing bash instructions beneath, e.g. export OpenAI API key as an atmosphere variable for accessing OpenAI GPT fashions.

    pip set up crewai
    pip set up 'crewai[tools]'
    export OPENAI_API_KEY='your-key-here'

    2. Create Instruments from CrewAI’s built-in tool list, e.g. apply DirectoryReadTool() to entry a listing, and FileReadTool() to learn information saved within the listing.

    from crewai_tools import DirectoryReadTool, FileReadTool
    
    doc_tool = DirectoryReadTool(listing='./articles')
    file_tool = FileReadTool()

    3. Provoke an Agent by specifying its position, purpose, and offering it with instruments.

    from crewai import Agent
    
    researcher = Agent(
        position="Researcher",
        purpose="Discover info on any subject primarily based on the supplied information",
        instruments=[doc_tool, file_tool]
    )

    4. Create a Job by offering an outline and assign an agent to execute the duty.

    from crewai import Job
    
    research_task = Job(
        description="Analysis the most recent AI tendencies",
        agent=researcher
    )

    5. Construct the Crew by combining your Brokers and Duties collectively. Begin the workflow execution utilizing kickoff().

    from crewai import Crew
    
    crew = Crew(
        brokers=[researcher],
        duties=[research_task]
    )
    
    outcome = crew.kickoff()

    Develop an Agentic Social Media Advertising and marketing Crew

    0. Venture Targets

    Let’s develop on this easy CrewAI instance by making a Social Media Advertising and marketing group by the step-by-step procedures beneath. This group will generate weblog posts primarily based on the person’s subject of curiosity and create tailor-made marketing campaign messages for sharing on completely different social media platforms.

    An instance output if we ask the crew in regards to the subject “Agentic AI”.

    Weblog Submit

    X(Twitter) Message
    Uncover the Way forward for Agentic AI! Have you ever ever questioned how Agentic AI is ready to redefine our interplay with know-how by 2025? Understanding AI tendencies for 2025 will not be solely essential for know-how lovers however important for companies throughout varied sectors. #AgenticAI #AITrends
    YouTube Message
    Discover Groundbreaking Developments in Agentic AI! 🌟 Uncover how Agentic AI is reworking industries in methods you by no means imagined! By 2025, these revolutionary tendencies will reshape how we interact with applied sciences, notably in banking and finance. Are you able to embrace the long run? Remember to learn our newest weblog put up and subscribe for extra insights!
    Substack Message
    The Altering Panorama of Agentic AI: What You Have to Know In 2025, the evolving world of Agentic AI is ready to reshape industries, notably in finance and banking. This weblog covers key tendencies such because the transformational potential of agentic AI, new regulatory frameworks, and vital technological developments. How can companies efficiently combine agentic AI whereas managing dangers? What does the way forward for this know-how imply for customers? Be a part of the dialogue in our newest put up, and let's discover how these improvements will influence our future collectively!

    1. Venture Setting Setup

    Comply with the CrewAI’s QuickStart information to setup the event atmosphere. We use the next listing construction for this venture.

    ├── README.md
    ├── pyproject.toml
    ├── necessities.txt
    ├── src
    │   └── social_media_agent
    │       ├── __init__.py
    │       ├── crew.py
    │       ├── principal.py
    │       └── instruments
    │           ├── __init__.py
    │           ├── browser_tools.py
    │           └── keyword_tool.py
    └── uv.lock

    2. Develop Instruments

    The primary software we add to the crew is WebsiteSearchToolwhich is a built-in software applied by CrewAI for conducting semantic searches throughout the content material of internet sites.

    We simply want just a few traces of code to put in the crewai instruments package deal and use the WebsiteSearchTool. This software is accessible by the market researcher agent to seek out newest market tendencies or trade information associated to a given subject.

    pip set up 'crewai[tools]'
    from crewai_tools import WebsiteSearchTool
    
    web_search_tool = WebsiteSearchTool()

    The screenshot beneath reveals the output of web_search_tool when given the subject “YouTube movies”.

    Agentic AI Tool Output Example

    Subsequent, we’ll create a customized keyword_tool by inheriting from the BaseTool class and utilizing the SerpApi (Google Trend API). As proven within the code beneath, this software generates the highest searched, trending queries associated to the enter key phrase. This software is accessible by the advertising specialist agent to research trending key phrases and refine the weblog put up for SEO. We are going to see an instance of the key phrase software’s output within the subsequent part.

    import os
    import json
    from dotenv import load_dotenv
    from crewai.instruments import BaseTool
    from serpapi.google_search import GoogleSearch
    
    load_dotenv()
    api_key = os.getenv('SERPAPI_API_KEY')
    
    class KeywordTool(BaseTool):
        identify: str = "Trending Key phrase Instrument"
        description: str = "Get search quantity of associated trending key phrases."
    
        def _run(self, key phrase: str) -> str:
            params = {
                'engine': 'google_trends',
                'q': key phrase,
                'data_type': 'RELATED_QUERIES',
                'api_key': api_key
            }
    
            search = GoogleSearch(params)
    
            attempt:
                rising_kws = search.get_dict()['related_queries']['rising']
                top_kws = search.get_dict()['related_queries']['top']
    
                return f"""
                        Rising key phrases: {rising_kws} n 
                        Prime key phrases: {top_kws}
                    """
            besides Exception as e:
    
                return f"An sudden error occurred: {str(e)}"
    

    3. Outline the Crew Class

    CrewAI Architecture

    Within the crew.py script, we outline our social media crew group with three brokers—market_researcher, content_creator, marketing_specialist—and assign duties to every. We initialize the SocialMediaCrew() class utilizing the @CrewBase decorator. The subject attribute passes the person’s enter about their subject of curiosity, and llm , model_name attributes specify the default mannequin used all through the Crew workflow.

    @CrewBase
    class SocialMediaCrew():
        def __init__(self, subject: str):
            """
            Initialize the SocialMediaCrew with a selected subject.
    
            Args:
                subject (str): The primary subject or topic for social media content material technology
            """
    
            self.subject = subject
            self.model_name = 'openai/gpt-4o'
            self.llm = LLM(mannequin=self.model_name,temperature=0)

    4. Outline Brokers

    CrewAI Brokers depend on three important parameters—position, purpose, and backstory—to outline their traits in addition to the context they’re working in. Moreover, we offer Brokers with related instruments to facilitate their jobs and different parameters to manage the useful resource consumption of the Agent calling and keep away from pointless LLM token utilization.

    For instance, we outline the “Advertising and marketing Specialist Agent” utilizing the code beneath. Begin with utilizing @agent decorator. Outline the position as “Advertising and marketing Specialist” and supply the entry to keyword_tool we beforehand developed, in order that the advertising specialist can analysis the trending key phrases to refine the weblog contents for optimum Website positioning efficiency.

    Go to our GitHub repository for the complete code of different Agent definitions.

    @CrewBase
    class SocialMediaCrew():
        def __init__(self, subject: str):
            """
            Initialize the SocialMediaCrew with a selected subject.
    
            Args:
                subject (str): The primary subject or topic for social media content material technology
            """
    
            self.subject = subject
            self.model_name = 'openai/gpt-4o'
            self.llm = LLM(mannequin=self.model_name,temperature=0)

    Setting verbose to true permits us to make the most of CrewAI’s traceability performance to look at intermediate output all through the Agent calling. The screenshots beneath present the thought strategy of “Advertising and marketing Specialist” Agent utilizing thekeyword_tool to analysis “YouTube tendencies”, in addition to the Website positioning-optimized weblog put up primarily based on the software output.

    Intermediate Output from Advertising and marketing Specialist

    Another strategy to outline Agent is to retailer the Agent context in a YAML file utilizing the format beneath, offering further flexibility of experiment and iterating on immediate engineering when needed.

    Instance agent.yaml

    marketing_specialist: 
      position: >
       "Advertising and marketing Specialist"
      purpose: >
       "Enhance the weblog put up to optimize for Search Engine Optimization utilizing the Key phrase Instrument and create personalized, channel-specific messages for social media distributions"
      backstory: >
        "A talented Advertising and marketing Specialist with experience in Website positioning and social media marketing campaign design"

    5. Outline Duties

    If an Agent is taken into account as the worker (“who”) specialised in a website (e.g. content material creation, analysis), embodied with a persona or traits, then Duties are the actions (“what”) that the worker performs with predefined aims and output expectations.

    In CrewAI, a Job is configured utilizing description, expected_output, and the non-obligatory parameter output_file saves the intermediate output as a file. Alternatively, it’s also really useful to make use of a standalone YAML file to supply a cleaner, maintainable technique to outline Duties. Within the code snippet beneath, we offer exact directions for the crew to hold out 4 duties and assign them to brokers with related skillsets. We additionally save the output of every job within the working folder for the benefit of evaluating completely different output variations.

    • analysis: analysis in the marketplace pattern of the given subject; assigned to the market researcher.
    • write: write an interesting weblog put up; assigned to the content material creator.
    • refine: refine weblog put up primarily based for optimum Website positioning efficiency; assigned to the advertising specialist.
    • distribute: generate platform-specific messages for distributing on every social media channel; assigned to the advertising specialist.
    @job
    def analysis(self) -> Job:
        return Job(
            description=f'Analysis the 2025 tendencies within the {self.subject} space and supply a abstract.',
            expected_output=f'A abstract of the highest 3 trending information in {self.subject} with a singular perspective on their significance.',
            agent=self.market_researcher()
        )
    
    @job
    def write(self) -> Job:
        return Job(
            description=f"Write an interesting weblog put up in regards to the {self.subject}, primarily based on the analysis analyst's abstract.",
            expected_output='A 4-paragraph weblog put up formatted in markdown with participating, informative, and accessible content material, avoiding advanced jargon.',
            agent=self.content_creator(),
            output_file=f'blog-posts/post-{self.model_name}-{timestamp}.md' 
        )
    
    @job
    def refine(self) -> Job:
        return Job(
            description="""
                Refine the given article draft to be extremely Website positioning optimized for trending key phrases. 
                Embrace the key phrases naturally all through the textual content (particularly in headings and early paragraphs)
                Make the content material simple for each search engines like google and customers to know.
                """,
            expected_output='A refined 4-paragraph weblog put up formatted in markdown with participating and Website positioning-optimized contents.',
            agent=self.marketing_specialist(),
            output_file=f'blog-posts/seo_post-{self.model_name}-{timestamp}.md' 
        )
    
    @job
    def distribute(self) -> Job: 
        return Job(
            description="""
                Generate three distinct variations of the unique weblog put up description, every tailor-made for a selected distribution channel:
                One model for X (previously Twitter) – concise, participating, and hashtag-optimized.
    
                One model for YouTube put up – appropriate for video viewers, consists of emotive cue and powerful call-to-action.
    
                One model for Substack – barely longer, informative, centered on publication subscribers.
    
                Every description should be optimized for the norms and expectations of the channel, making refined changes to language, size, and formatting.
                Output must be in markdown format, with every model separated by a transparent divider (---).
                Use a brief, impactful headline for every model to additional improve channel match.
            """,
            expected_output='3 variations of descriptions of the unique weblog put up 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 beneath reveals job execution particulars, together with standing, agent assignments, and power utilization.

    🚀 Crew: crew
    ├── 📋 Job: analysis (ID: 19968f28-0af7-4e9e-b91f-7a12f87659fe)
    │   Assigned to: Market Analysis Analyst
    │   Standing: ✅ Accomplished
    │   └── 🔧 Used Search in a selected web site (1)
    ├── 📋 Job: write (ID: 4a5de75f-682e-46eb-960f-43635caa7481)
    │   Assigned to: Content material Author
    │   Standing: ✅ Accomplished
    ├── 📋 Job: refine (ID: fc9fe4f8-7dbb-430d-a9fd-a7f32999b861)
    │   **Assigned to: Advertising and marketing Specialist**
    │   Standing: ✅ Accomplished
    │   └── 🔧 Used Trending Key phrase Instrument (1)
    └── 📋 Job: distribute (ID: ed69676a-a6f7-4253-9a2e-7f946bd12fa8)
        **Assigned to: Advertising and marketing Specialist**
        Standing: ✅ Accomplished
        └── 🔧 Used Trending Key phrase Instrument (2)
    ╭───────────────────────────────────────── Job Completion ──────────────────────────────────────────╮
    │                                                                                                    │
    │  Job Accomplished                                                                                    │
    │  Identify: distribute                                                                                  │
    │  Agent: Advertising and marketing Specialist                                                                       │
    │  Instrument Args:                                                                                        │
    │                                                                                                    │
    │                                                                                                    │
    ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯

    6. Kick Off the Crew

    As the ultimate step within the crew.py script, we orchestrate Duties, Brokers and Instruments collectively to outline the crew.

    @crew
    def crew(self) -> Crew:
        return Crew(
            brokers=self.brokers,
            duties=self.duties,
            verbose=True,
            planning=True,
        )

    In the principle.py, we instantiate a SocialMediaCrew() object and run the crew by accepting the person’s enter for his or her subject of curiosity.

    # principal.py
    from social_media_agent.crew import SocialMediaCrew
    
    def run():
        # Change along with your inputs, it would robotically interpolate any duties and brokers info
        inputs = {
            'subject': enter('Enter your  subject: '),
        }
        SocialMediaCrew(subject=inputs['topic']).crew().kickoff(inputs=inputs)

    Now let’s use “Agentic AI” for example and listed below are output information generated by our social media crew after sequentially executing the duties.

    Output from “write” Job

    Output from "write" Task

    Output from “refine” Job

    Output from “distribute” Job


    Take-Dwelling Message

    This tutorial demonstrates learn how to create an Agentic AI system utilizing CrewAI framework. By orchestrating specialised brokers with distinct roles and instruments, we implement a multi-agent group that’s able to producing optimized content material for various social media platforms.

    • Setting Setup: Initialize your growth atmosphere with needed dependencies and instruments for CrewAI growth
    • Develop Instruments: Develop the foundational software construction with built-in and customized software parts
    • Outline Brokers: Create specialised brokers with clearly outlined roles, objectives, and backstories. Equip them with related instruments to assist their position.
    • Create Duties: Create duties with clear descriptions and anticipated outputs. Assign Brokers for job execution.
    • Kick Off the Crew: Orchestrate Duties, Brokers and Instruments collectively as a Crew and execute the workflow.

    Extra Assets Like This



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    KV Cache Is Eating Your VRAM. Here’s How Google Fixed It With TurboQuant.

    April 19, 2026

    Proxy-Pointer RAG: Structure Meets Scale at 100% Accuracy with Smarter Retrieval

    April 19, 2026

    Dreaming in Cubes | Towards Data Science

    April 19, 2026

    AI Agents Need Their Own Desk, and Git Worktrees Give Them One

    April 18, 2026

    Your RAG System Retrieves the Right Data — But Still Produces Wrong Answers. Here’s Why (and How to Fix It).

    April 18, 2026

    Europe Warns of a Next-Gen Cyber Threat

    April 18, 2026

    Comments are closed.

    Editors Picks

    Nothing Phone (4a) Pro Review: A Close Second

    April 20, 2026

    Match Group CEO Spencer Rascoff says growing women’s share on Tinder is his “primary focus” to stem user declines; Sensor Tower says 75% of Tinder users are men (Kieran Smith/Financial Times)

    April 20, 2026

    Today’s NYT Connections Hints, Answers for April 20 #1044

    April 20, 2026

    AI Machine-Vision Earns Man Overboard Certification

    April 20, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    How Supercomputing Will Evolve, According to Jack Dongarra

    August 5, 2025

    Wynn Resorts sees net income drop in Q2, but revenue increases

    August 11, 2025

    New Jersey lawmaker seeks to ban fast-paced micro betting wagers

    July 29, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.