Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →CrewAI is an open-source Python framework for building teams of AI agents that work together on a job. You define agents (each with a role, goal, backstory, tools and model), tasks (what to do and what output is expected) and a crew that runs the tasks in order (sequential process) or under a manager agent (hierarchical process). For workflows that need tighter control, CrewAI Flows add event-driven steps and state. It is independent of LangChain and can use most LLM providers. Below is how each piece works, a runnable example, and when a multi-agent setup is worth it.
One LLM prompt that must research, analyse, write and check its own work tends to do each part less well. Giving each step to an agent with a narrow role and its own instructions makes the output easier to control and debug, in the same way a team divides work between a researcher, a writer and an editor. The trade-off is more model calls, so more cost and latency.
| Concept | What it is |
|---|---|
| Agent | An LLM with a role, goal and backstory that shape its behaviour, optional tools (search, file reading, your own functions) and a chosen llm |
| Task | A description, an expected_output, the agent responsible, and optional context (outputs of earlier tasks it should use) |
| Crew | A group of agents and tasks plus a process that decides how they run |
| Process | sequential: tasks run in order, each passing output forward. hierarchical: a manager agent plans, delegates and reviews |
| Flow | Event-driven orchestration with explicit state, used to combine crews with ordinary Python steps and branching |
| Memory and knowledge | Optional short- and long-term memory, and knowledge sources such as documents that agents can draw on |
Install with pip install crewai and set OPENAI_API_KEY (CrewAI also supports Anthropic, Google, local Ollama models and others through its LLM settings). This two-agent crew researches customer complaints and then writes product copy that addresses them.
from crewai import Agent, Task, Crew, Process
researcher = Agent(
role="Market Researcher",
goal="Identify the most common customer complaints about {product}",
backstory="You study product reviews and summarise patterns precisely.",
llm="gpt-4o-mini",
)
writer = Agent(
role="Product Copywriter",
goal="Write honest product copy that answers real customer concerns",
backstory="You write clear, specific copy with no exaggerated claims.",
llm="gpt-4o-mini",
)
research_task = Task(
description="List the five most common complaints buyers have about {product}.",
expected_output="A numbered list of five complaints, one line each.",
agent=researcher,
)
write_task = Task(
description="Write a 120-word product description for our {product} "
"that addresses the complaints found in the research.",
expected_output="One paragraph of about 120 words.",
agent=writer,
context=[research_task],
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
process=Process.sequential,
verbose=True,
)
result = crew.kickoff(inputs={"product": "budget wireless earbuds"})
print(result.raw)
The {product} placeholders are filled from inputs. With verbose=True you see each agent's work in the terminal; result.raw holds the final paragraph, whose wording changes from run to run. As written, the researcher uses only the model's general knowledge. To research live data, give it a tool, for example a web search tool from the crewai-tools package (which needs that search service's API key), or a custom tool that reads your own review database.
For anything larger than a script, the CLI scaffolds a project: crewai create crew review_insights. Agents and tasks then live in config/agents.yaml and config/tasks.yaml, and the Python code wires them together, so prompts can be edited without touching logic.
manager_llm or custom manager agent) that decides who does what and checks results. Use it when the steps depend on the request, accepting more calls and less predictability.| Framework | Approach |
|---|---|
| CrewAI | Role-based agents and tasks; quick to set up; Flows for structured orchestration |
| LangGraph | Agents as explicit graphs of nodes and edges with state; fine-grained control over each step |
| AutoGen (Microsoft) | Agents that collaborate through multi-agent conversations |
| Provider agent SDKs | Lighter frameworks from model providers, closely tied to their own APIs and tools |
expected_output for every task; vague tasks produce vague results.max_iter on agents and watch token usage; multi-agent loops can become expensive.The framework is open source and free to use. You pay for the LLM API calls your agents make, unless you run local models. CrewAI also sells a hosted enterprise platform.
No. CrewAI is built independently of LangChain, although it can use tools from other ecosystems.
Yes. You can point an agent's llm at a model served locally by Ollama, which avoids API costs for experiments.
To compare approaches, read LangGraph for agent workflows, multi-agent systems with LangChain and LangChain vs AutoGen. The broader idea is covered in multi-agent systems for real-world problems.