Title: CrewAI in Python: Coordinating Teams of AI Agents – Real Python
Open Graph Title: CrewAI in Python: Coordinating Teams of AI Agents – Real Python
Description: Learn how to use CrewAI to build teams of AI agents in Python, define roles and tools, and coordinate multi-agent workflows that solve complex tasks.
Open Graph Description: Learn how to use CrewAI to build teams of AI agents in Python, define roles and tools, and coordinate multi-agent workflows that solve complex tasks.
Mail addresses
?subject=Python article for you&body=CrewAI in Python: Coordinating Teams of AI Agents on Real Python
https://realpython.com/crewai-python/
Opengraph URL: https://realpython.com/crewai-python/
X: @realpython
Domain: realpython.com
{
"@context": "http://schema.org",
"@type": "Article",
"headline": "CrewAI in Python: Coordinating Teams of AI Agents",
"image": {
"@type": "ImageObject",
"url": "https://files.realpython.com/media/Coordinating-Teams-of-AI-Agents-with-CrewAI-in-Python_Watermarked.d44efee0c44f.jpg",
"width": 1920,
"height": 1080
},
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://realpython.com/crewai-python/",
"lastReviewed": "2026-09-25",
"author": {
"@type": "Person",
"name": "Farah Abdou",
"image": "https://realpython.com/cdn-cgi/image/width=400,height=400,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/1759509032163.0fd74c80815d.jpg",
"url": "https://realpython.com/team/fabdou/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
},
"reviewedBy": [
{
"@type": "Person",
"name": "Aldren Santos",
"image": "https://realpython.com/cdn-cgi/image/width=500,height=500,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/Aldren_Santos_Real_Python.6b0861d8b841.png",
"url": "https://realpython.com/team/asantos/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
},
{
"@type": "Person",
"name": "Brenda Weleschuk",
"image": "https://realpython.com/cdn-cgi/image/width=320,height=320,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/IMG_3324_1.50b309355fc1.jpg",
"url": "https://realpython.com/team/bweleschuk/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
},
{
"@type": "Person",
"name": "Bartosz Zaczy\u0144ski",
"image": "https://realpython.com/cdn-cgi/image/width=1694,height=1694,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/coders_lab_2109368.259b1599fbee.jpg",
"url": "https://realpython.com/team/bzaczynski/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
},
{
"@type": "Person",
"name": "Martin Breuss",
"image": "https://realpython.com/cdn-cgi/image/width=456,height=456,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/martin_breuss_python_square.efb2b07faf9f.jpg",
"url": "https://realpython.com/team/mbreuss/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
},
{
"@type": "Person",
"name": "Philipp Acsany",
"image": "https://realpython.com/cdn-cgi/image/width=1920,height=1920,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/pacsany.19bcf16f5a00.jpg",
"url": "https://realpython.com/team/pacsany/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
}
]
},
"datePublished": "2026-07-29T14:00:00+00:00",
"dateModified": "2026-09-25T05:01:41.203388+00:00",
"publisher": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": {
"@type": "ImageObject",
"url": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png",
"width": 512,
"height": 512
},
"description": "Real Python is a leading provider of online Python education and one of the largest language-specific online communities for software developers. It publishes high-quality learning resources, such as tutorials, books, and courses to an audience of millions of developers, data scientists, and machine learning engineers each month.",
"slogan": "Become a Python Expert",
"email": "info@realpython.com",
"sameAs": [
"https://github.com/realpython",
"https://www.youtube.com/realpython",
"https://twitter.com/realpython",
"https://x.com/realpython",
"https://www.linkedin.com/company/realpython-com/",
"https://www.facebook.com/learnrealpython",
"https://www.instagram.com/realpython",
"https://www.tiktok.com/@realpython.com"
]
},
"author": {
"@type": "Person",
"name": "Farah Abdou",
"image": "https://realpython.com/cdn-cgi/image/width=400,height=400,fit=crop,gravity=auto,format=auto/https://files.realpython.com/media/1759509032163.0fd74c80815d.jpg",
"url": "https://realpython.com/team/fabdou/",
"affiliation": {
"@type": "Organization",
"@id": "https://realpython.com/#organization",
"name": "Real Python",
"url": "https://realpython.com",
"logo": "https://realpython.com/static/real-python-logo-square-512.157ae6bf64ed.png"
}
},
"description": "Learn how to use CrewAI to build teams of AI agents in Python, define roles and tools, and coordinate multi-agent workflows that solve complex tasks.",
"hasPart": {
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Can I use CrewAI with non-Gemini models?",
"acceptedAnswer": {
"@type": "Answer",
"text": "\u003cp\u003eYes, including OpenAI, Anthropic\u0026rsquo;s Claude, Mistral, Groq, AWS Bedrock, and Ollama for local models. Set the \u003ccode\u003ellm\u003c/code\u003e parameter on any agent. For example, use \u003ccode\u003ellm=LLM(model=\"gpt-4.1-mini\")\u003c/code\u003e for OpenAI or \u003ccode\u003ellm=LLM(model=\"ollama/llama3.1\")\u003c/code\u003e for a local Ollama model. You\u0026rsquo;ll need the appropriate API key set as an environment variable for cloud providers.\u003c/p\u003e"
}
},
{
"@type": "Question",
"name": "How much do multi-agent crew runs cost?",
"acceptedAnswer": {
"@type": "Answer",
"text": "\u003cp\u003eCost depends on the number of agents, tasks, and which LLM you use. Each agent makes separate API calls, so a three-agent crew costs roughly three times what a single-agent call would cost. The Gemini free tier provides generous limits for experimentation.\u003c/p\u003e\n\u003cp\u003eAfter running \u003ccode\u003ecrew.kickoff()\u003c/code\u003e, check \u003ccode\u003ecrew.usage_metrics\u003c/code\u003e to see exact token counts. You can reduce costs by using a cheaper model for tool-calling operations via the \u003ccode\u003efunction_calling_llm\u003c/code\u003e agent parameter.\u003c/p\u003e"
}
},
{
"@type": "Question",
"name": "How is CrewAI different from LangChain?",
"acceptedAnswer": {
"@type": "Answer",
"text": "\u003cp\u003eCrewAI is a standalone multi-agent orchestration framework built entirely from scratch, independent of \u003ca href=\"https://realpython.com/build-llm-rag-chatbot-with-langchain/\"\u003eLangChain\u003c/a\u003e. LangChain is a general-purpose framework for building LLM applications with chains, retrieval, memory, and more. If you need to use existing LangChain tools with CrewAI, you can wrap them manually using \u003ccode\u003eBaseTool\u003c/code\u003e from \u003ccode\u003ecrewai.tools\u003c/code\u003e. Many developers use both frameworks for different purposes in the same project.\u003c/p\u003e"
}
},
{
"@type": "Question",
"name": "Can agents in a crew run in parallel?",
"acceptedAnswer": {
"@type": "Answer",
"text": "\u003cp\u003eCrewAI doesn\u0026rsquo;t have a \u003ccode\u003eProcess.parallel\u003c/code\u003e option, but you can achieve parallel execution by setting \u003ccode\u003easync_execution=True\u003c/code\u003e on individual tasks. Tasks marked for async execution run concurrently, and downstream tasks that list them in their \u003ccode\u003econtext\u003c/code\u003e parameter will wait for all of them to complete before starting.\u003c/p\u003e"
}
},
{
"@type": "Question",
"name": "When should I use hierarchical team coordination?",
"acceptedAnswer": {
"@type": "Answer",
"text": "\u003cp\u003eUse \u003ccode\u003eProcess.hierarchical\u003c/code\u003e when you want a manager agent to dynamically delegate tasks to the most appropriate team member rather than following a fixed order. This is useful for complex workflows where task assignment depends on intermediate results. You\u0026rsquo;ll need to provide either a \u003ccode\u003emanager_llm\u003c/code\u003e or a custom \u003ccode\u003emanager_agent\u003c/code\u003e when using this mode.\u003c/p\u003e"
}
},
{
"@type": "Question",
"name": "How do agents in a crew communicate with each other?",
"acceptedAnswer": {
"@type": "Answer",
"text": "\u003cp\u003eAgents communicate through task outputs rather than direct conversation. In a sequential process, the output of each task automatically flows as context to the next task. You can also explicitly define dependencies using the \u003ccode\u003econtext\u003c/code\u003e parameter on a \u003ccode\u003eTask\u003c/code\u003e. This task-based approach provides predictable data flow but doesn\u0026rsquo;t support the back-and-forth exchanges you\u0026rsquo;d find in AG2 or similar conversational frameworks.\u003c/p\u003e"
}
}
]
}
}
| author | Real Python |
| theme-color | #18354c |
| color-scheme | light dark |
| twitter:card | summary_large_image |
| twitter:image | https://files.realpython.com/media/Coordinating-Teams-of-AI-Agents-with-CrewAI-in-Python_Watermarked.d44efee0c44f.jpg |
| og:image | https://files.realpython.com/media/Coordinating-Teams-of-AI-Agents-with-CrewAI-in-Python_Watermarked.d44efee0c44f.jpg |
| twitter:creator | @realpython |
| og:type | article |
| og:site_name | Real Python |
| apple-mobile-web-app-title | Real Python |
Links:
Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover
Robots: max-image-preview:large