Codecondo

Building AI Agents with CrewAI: A Beginner’s Guide for Interns

Building AI Agents with CrewAI

Building AI Agents with CrewAI

INTRODUCTION

A few weeks into my internship, my manager asked me to “automate the weekly research report.” I opened ChatGPT, wrote a giant prompt, and hoped for the best. The output was messy — half research, half opinion, zero structure. That’s when a senior engineer told me: “You don’t need a bigger prompt. You need a team.”

That one sentence is the whole idea behind Building AI Agents with CrewAI. Instead of asking one agent to do everything, you build a small team of specialized AI agents — a researcher, a writer, a reviewer — and let them work together like a real crew. Each agent has one job, and CrewAI orchestrates how tasks are executed and how information flows between agents based on the workflow you define.

This guide is written for beginners and young interns who are just starting out. There’s no heavy jargon here, just simple language, diagrams, and code snippets you can copy, run, and actually use in your day-to-day work. By the end, you’ll understand exactly what goes into Building AI Agents with CrewAI, and you’ll have a working crew of your own. At Code Condo, we believe the best way to learn is by building practical projects you can use in real-world scenarios. By the end, you’ll understand exactly what goes into Building AI Agents with CrewAI, and you’ll have a working crew of your own.

What Is CrewAI?

CrewAI is an open-source Python framework used for Building AI Agents with CrewAI-style multi-agent systems — teams of AI agents that collaborate to complete a task, instead of one AI model trying to do everything alone.

Think of it like a small company:

Each of these is an agent with its own role, goal, and backstory. The backstory provides additional context that helps guide how the agent approaches its work. CrewAI coordinates task execution and passes outputs between agents according to the workflow you define.

Why Learn Building AI Agents with CrewAI as an Intern?

If you’re a young intern working with AI tools, learning Building AI Agents with CrewAI is one of the most practical skills you can pick up right now. Here’s why it matters:

Core Concepts Before You Start Building AI Agents with CrewAI

Before writing any code, it helps to understand the four building blocks CrewAI is built around.

AGENT   → A worker with a role, a goal, and a backstory (e.g. "Researcher")
TASK    → A specific job assigned to an agent (e.g. "Find 5 recent AI trends")
TOOL    → A capability an agent can use (e.g. web search, file reader)
CREW    → The team of agents + tasks, executed together in a process

Here’s a simple diagram of how these pieces connect when you are Building AI Agents with CrewAI:

                +-------------------------------------------+
                |                   CREW                    |
                |   (the team that runs the whole process)   |
                +-------------------------------------------+
                       |                        |
              +--------v-------+       +--------v-------+
              |   AGENT 1      |       |   AGENT 2      |
              |  Researcher    |       |  Writer        |
              |  role + goal   |       |  role + goal   |
              |  + tools       |       |                |
              +--------+-------+       +--------+-------+
                       |                        |
              +--------v-------+       +--------v-------+
              |   TASK 1       |------>|   TASK 2       |
              | "Research the  |       | "Write a report|
              |   topic"       |       |  from research"|
              +----------------+       +----------------+
                       |                        |
                       +----------> OUTPUT ------+
                          (final report.md)

In plain words: the Crew is the container. Inside it, Agents do the thinking, Tasks describe what needs to be done, and Tools give agents extra powers, like searching the web. If you enjoy learning through practical examples, Code Condo offers more beginner-friendly guides on AI, Python, and automation.  This four-part pattern is the heart of Building AI Agents with CrewAI, and once it clicks, everything else is just configuration.

Agents

An agent is defined by three things:

Tasks

A task is the actual work item you hand to an agent. It has a description and an “expected output” — a short note on what a good result looks like.

Process

CrewAI supports two main ways agents can work together:

For your first attempt at Building AI Agents with CrewAI, always start with the sequential process. It’s predictable and easy to debug.

Prerequisites for Building AI Agents with CrewAI

You don’t need much to get started:

Check your Python version first:

python3 --version

Step-by-Step Guide: Building AI Agents with CrewAI

Let’s go step by step. This is the exact workflow you’ll use every time you’re Building AI Agents with CrewAI for a new use case at work.

Step 1: Install CrewAI

CrewAI recommends using uv, a fast Python package manager, instead of plain pip.

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# then install the CrewAI CLI
uv tool install crewai

# verify
uv tool list

If you’d rather stick with pip while learning, that works too:

pip install crewai crewai-tools

Step 2: Scaffold Your First Crew

CrewAI ships with a CLI that generates a ready-made project folder for you — this is the fastest way to start Building AI Agents with CrewAI without setting up files by hand.

crewai create crew intern_report_crew
cd intern_report_crew

You’ll get a folder structure like this:

intern_report_crew/
├── .env                     # API keys go here
├── src/
│   └── intern_report_crew/
│       ├── config/
│       │   ├── agents.yaml   # define your agents
│       │   └── tasks.yaml    # define your tasks
│       ├── crew.py           # wires agents + tasks together
│       └── main.py           # runs the crew

Step 3: Add Your API Key

Open the .env file and add your key:

MODEL=openai/gpt-4o-mini
OPENAI_API_KEY=your_api_key_here

Never commit this file to GitHub — the CLI already adds it to .gitignore for you.

Step 4: Define Your Agents (agents.yaml)

This is where the “team” in Building AI Agents with CrewAI actually comes to life. Keep each role narrow and specific — that’s the single biggest factor in getting good results.

researcher:
  role: "{topic} Research Analyst"
  goal: "Find the most useful and current information about {topic}"
  backstory: >
    You are a detail-oriented analyst who double-checks facts
    and never makes up information you can't verify.

writer:
  role: "{topic} Content Writer"
  goal: "Turn research notes into a clear, simple summary"
  backstory: >
    You write for beginners. You avoid jargon and explain
    things the way you'd explain them to a new intern.

Step 5: Define Your Tasks (tasks.yaml)

research_task:
  description: >
    Research {topic} and collect 5 key points, each with a
    short explanation. Focus on information from this year.
  expected_output: "A bullet list of 5 well-explained points about {topic}"
  agent: researcher

writing_task:
  description: >
    Using the research notes, write a short 300-word summary
    of {topic} that a beginner could easily understand.
  expected_output: "A clear, beginner-friendly summary in markdown"
  agent: writer
  output_file: report.md

Step 6: Give an Agent a Tool

Many real-world workflows require agents to use tools instead of relying only on the model’s built-in knowledge. Depending on your use case, these tools may provide web search, database access, API integrations, file handling, or other capabilities. Here’s how to give an agent web search capabilities in crew.py:

from crewai_tools import SerperDevTool
from crewai import Agent

@agent
def researcher(self) -> Agent:
    return Agent(
        config=self.agents_config['researcher'],
        tools=[SerperDevTool()],   # gives the agent web search
        verbose=True
    )

Step 7: Run Your Crew

# main.py
inputs = {
    "topic": "AI Agents in customer support"
}

IternReportCrew().crew().kickoff(inputs=inputs)

Then run it from the terminal:

crewai run

Watch your terminal — you’ll literally see the researcher agent gather information, hand it off, and the writer agent turn it into a final report.md file. That’s the full loop of Building AI Agents with CrewAI, start to finish.

A Practical Example You Can Reuse at Work

Here’s a simplified end-to-end script (without YAML files) that shows the same idea. Interns often start here before moving to the full project structure, since it’s easier to see the whole picture of Building AI Agents with CrewAI in one file.

from crewai import Agent, Task, Crew, Process

researcher = Agent(
    role="Research Analyst",
    goal="Find accurate, recent information on the given topic",
    backstory="You verify facts carefully and cite where information came from.",
    verbose=True
)

writer = Agent(
    role="Content Writer",
    goal="Summarize research into a short, clear report",
    backstory="You write in plain, simple English for beginners.",
    verbose=True
)

research_task = Task(
    description="Research the latest trends in {topic}",
    expected_output="5 bullet points with short explanations",
    agent=researcher
)

writing_task = Task(
    description="Write a 250-word summary using the research above",
    expected_output="A beginner-friendly summary",
    agent=writer,
    context=[research_task]
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, writing_task],
    process=Process.sequential
)

result = crew.kickoff(inputs={"topic": "AI agents for interns"})
print(result)

This small pattern — one agent researches, one agent writes — is reusable everywhere. Swap the topic, swap the roles, and you have a new automation. This reusability is exactly why so many teams are investing in Building AI Agents with CrewAI instead of writing one-off scripts.

Common Mistakes Beginners Make While Building AI Agents with CrewAI

Avoiding these mistakes is often what separates a shaky first attempt at Building AI Agents with CrewAI from a crew that actually works reliably.

CrewAI vs Other Agent Frameworks

Framework Best For Learning Curve
CrewAI Role-based teams of agents (research, writing, review) Easy — great for beginners
LangGraph Complex, graph-based agent workflows with branching logic Moderate to steep
AutoGen Conversational multi-agent chats Moderate
Plain prompting One-off simple tasks Easiest, but least reliable

If you’re new to multi-agent systems, Building AI Agents with CrewAI is generally the gentlest starting point because its structure (Agent → Task → Crew) maps closely to how real teams already work.

Pro Tips for Interns Building AI Agents with CrewAI

Frequently Asked Questions

Is CrewAI free to use? Yes, the core CrewAI framework is open-source and free. You only pay for the LLM API calls (like OpenAI or Anthropic usage) that your agents make.

Do I need to know machine learning to start Building AI Agents with CrewAI? No. Basic Python is enough. CrewAI handles the agent orchestration logic for you — you focus on defining roles, goals, and tasks.

What’s the difference between an agent and a task in CrewAI? An agent is the “who” — a worker with a role and goal. A task is the “what” — a specific job assigned to that agent, with an expected output.

Can CrewAI agents use the internet? Yes, by attaching tools like SerperDevTool for web search, agents can retrieve current information instead of relying only on the model’s training data.

How many agents should a beginner start with? Two is a good starting point — for example, one researcher and one writer. This keeps the crew easy to debug while you’re still Building AI Agents with CrewAI.

Final Thoughts

Building AI Agents with CrewAI isn’t about writing longer prompts — it’s about designing a small, focused team where each agent does one job well. Start with two agents, keep tasks specific, run it, read the output, and adjust. That loop — build, run, tweak — is how every intern actually gets good at Building AI Agents with CrewAI.

Once you’re comfortable with this basic sequential crew, the natural next step is exploring hierarchical processes, custom tools, and CrewAI Flows for more advanced automation. Whatever you automate next, the core habit of Building AI Agents with CrewAI — narrow roles, clear tasks, sequential first — will carry over.

READ MORE  : Explore more hands-on AI, Python, and developer tutorials on Eduonix.

Exit mobile version