{"id":115797,"date":"2025-02-28T19:34:06","date_gmt":"2025-02-28T19:34:06","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/concurrent-query-resolution-system-using-crewai\/"},"modified":"2025-02-28T19:34:06","modified_gmt":"2025-02-28T19:34:06","slug":"concurrent-query-resolution-system-using-crewai","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=115797","title":{"rendered":"Concurrent Query Resolution System Using CrewAI"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>In the era of <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2021\/09\/introduction-to-artificial-intelligence-for-beginners\/\" target=\"_blank\" rel=\"noreferrer noopener\">artificial intelligence,<\/a> businesses are constantly seeking innovative ways to enhance customer support services. One such approach is leveraging AI agents that work collaboratively to resolve customer queries efficiently. This article explores the implementation of a Concurrent Query Resolution System using CrewAI, OpenAI\u2019s GPT models, and Google Gemini. This system employs multiple specialized agents that operate in parallel to handle customer queries seamlessly, reducing response time and improving accuracy. <\/p>\n<h4 class=\"wp-block-heading\" id=\"h-learning-objectives\">Learning Objectives<\/h4>\n<ul class=\"wp-block-list\">\n<li>Understand how AI agents can efficiently handle customer queries by automating responses and summarizing key information.<\/li>\n<li>Learn how CrewAI enables multi-agent collaboration to improve customer support workflows.<\/li>\n<li>Explore different types of AI agents, such as query resolvers and summarizers, and their roles in customer service automation.<\/li>\n<li>Implement concurrent query processing using <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2021\/05\/introduction-to-python-programming-beginners-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a>\u2019s asyncio to enhance response efficiency.<\/li>\n<li>Optimize customer support systems by integrating AI-driven automation for improved accuracy and scalability. <\/li>\n<\/ul>\n<p><em><strong>This article was published as a part of the\u00a0<\/strong><\/em><a href=\"https:\/\/www.analyticsvidhya.com\/datahack\/blogathon\" target=\"_blank\" rel=\"noreferrer noopener\"><em><strong>Data Science Blogathon.<\/strong><\/em><\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-how-ai-agents-work-together\">How AI Agents Work Together?<\/h2>\n<p>The Concurrent Query Resolution System uses a multi-agent framework, assigning each agent a specific role. The system utilizes CrewAI, a framework that enables AI agents to collaborate effectively. <\/p>\n<p>The primary components of the system include:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Query Resolution Agent: <\/strong>Responsible for understanding customer queries and providing accurate responses.<\/li>\n<li><strong>Summary Agent: <\/strong>Summarizes the resolution process for quick review and future reference.<\/li>\n<li><strong>LLMs (<a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/03\/an-introduction-to-large-language-models-llms\/\" target=\"_blank\" rel=\"noreferrer noopener\">Large Language Models<\/a>): <\/strong>Includes models like GPT-4o and Gemini, each with different configurations to balance speed and accuracy.<\/li>\n<li><strong>Task Management: <\/strong>Assigning tasks dynamically to agents to ensure concurrent query processing.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-implementation-of-concurrent-query-resolution-system\">Implementation of Concurrent Query Resolution System <\/h2>\n<p>To transform the AI agent framework from concept to reality, a structured implementation approach is essential. Below, we outline the key steps involved in setting up and integrating AI agents for effective query resolution.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-1-setting-the-api-key\">Step 1: Setting the API Key<\/h3>\n<p>The OpenAI API key is stored as an environment variable using the <code>os<\/code> module. This allows the system to authenticate API requests securely without hardcoding sensitive credentials. <\/p>\n<pre class=\"wp-block-code\"><code>import os \n\n# Set the API key as an environment variable\nos.environ[\"OPENAI_API_KEY\"] = \"\"<\/code><\/pre>\n<p>The system uses the <code>os<\/code> module to interact with the operating system.<\/p>\n<p>The system sets the OPENAI_API_KEY as an environment variable, allowing it to authenticate requests to OpenAI\u2019s API.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-2-importing-required-libraries\">Step 2: Importing Required Libraries<\/h3>\n<p>Necessary libraries are imported, including <code>asyncio<\/code> for handling asynchronous operations and <code>crewai<\/code> components like <code>Agent<\/code>, <code>Crew<\/code>, <code>Task<\/code>, and <code>LLM<\/code>. These are essential for defining and managing AI agents.<\/p>\n<pre class=\"wp-block-code\"><code>import asyncio\nfrom crewai import Agent, Crew, Task, LLM, Process\nimport google.generativeai as genai<\/code><\/pre>\n<ul class=\"wp-block-list\">\n<li><strong>asyncio: <\/strong>Python\u2019s built-in module for asynchronous programming, enabling concurrent execution.<\/li>\n<li><strong>Agent: <\/strong>Represents an AI worker with specific responsibilities.<\/li>\n<li><strong>Crew:<\/strong> Manages multiple agents and their interactions.<\/li>\n<li><strong>Task: <\/strong>Defines what each agent is supposed to do.<\/li>\n<li><strong>LLM: <\/strong>Specifies the large language model used.<\/li>\n<li><strong>Process:<\/strong> It defines how tasks execute, whether sequentially or in parallel.<\/li>\n<li><strong>google.generativeai: <\/strong>Library for working with Google\u2019s generative AI models (not used in this snippet, but likely included for future expansion).<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-step-3-initializing-llms\">Step 3: Initializing LLMs<\/h3>\n<p>Three different LLM instances (<code>GPT-4o<\/code> and <code>GPT-4<\/code>) are initialized with varying temperature settings. The temperature controls response creativity, ensuring a balance between accuracy and flexibility in AI-generated answers.<\/p>\n<pre class=\"wp-block-code\"><code># Initialize the LLM with Gemini\nllm_1 = LLM(\n    model=\"gpt-4o\",\n    temperature=0.7)\nllm_2 = LLM(\n    model=\"gpt-4\",\n    temperature=0.2)\nllm_3 = LLM(\n    model=\"gpt-4o\",\n    temperature=0.3)<\/code><\/pre>\n<p>The system creates three LLM instances, each with a different configuration.<\/p>\n<p>Parameters:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>model: <\/strong>Specifies which OpenAI model to use (gpt-4o or gpt-4).<\/li>\n<li><strong>temperature: <\/strong>Controls randomness in responses (0 = deterministic, 1 = more creative).<\/li>\n<\/ul>\n<p>These different models and temperatures help balance accuracy and creativity<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-4-defining-ai-agents\">Step 4: Defining AI Agents<\/h3>\n<p>Each agent has a specific role and predefined goals. Two AI agents are created:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Query Resolver<\/strong>: Handles customer inquiries and provides detailed responses.<\/li>\n<li><strong>Summary Generator<\/strong>: Summarizes the resolutions for quick reference.<br \/>Each agent has a defined role, goal, and backstory to guide its interactions.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-query-resolution-agent\">Query Resolution Agent<\/h4>\n<pre class=\"wp-block-code\"><code>query_resolution_agent = Agent(\n    llm=llm_1,\n    role=\"Query Resolver\",\n    backstory=\"An AI agent that resolves customer queries efficiently and professionally.\",\n    goal=\"Resolve customer queries accurately and provide helpful solutions.\",\n    verbose=True\n)<\/code><\/pre>\n<p>Let\u2019s see what\u2019s happening in this code block<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Agent Creation: <\/strong>The query_resolution_agent is an AI-powered assistant responsible for resolving customer queries.<\/li>\n<li><strong>Model Selection:<\/strong> It uses llm_1, configured as GPT-4o with a temperature of 0.7. <span style=\"color: initial;\">This balance allows for creative yet accurate responses.<\/span><\/li>\n<li><strong>Role: <\/strong>The system designates the agent as a Query Resolver.<\/li>\n<li><strong>Backstory: <\/strong>The developers program the agent to act as a professional customer service assistant, ensuring efficient and professional responses.<\/li>\n<li><strong>Goal:<\/strong> To provide accurate solutions to user queries.<\/li>\n<li><strong>Verbose Mode: <\/strong>verbose=True ensures detailed logs, helping developers debug and track its performance.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-summary-agent\">Summary Agent<\/h4>\n<pre class=\"wp-block-code\"><code>summary_agent = Agent(\n    llm=llm_2,\n    role=\"Summary Generator\",\n    backstory=\"An AI agent that summarizes the resolution of customer queries.\",\n    goal=\"Provide a concise summary of the query resolution process.\",\n    verbose=True\n)<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-what-happens-here\">What Happens Here?<\/h4>\n<ul class=\"wp-block-list\">\n<li><strong>Agent Creation: <\/strong>The summary_agent is designed to summarize query resolutions.<\/li>\n<li><strong>Model Selection:<\/strong> Uses llm_2 (GPT-4) with a temperature of 0.2, making its responses more deterministic and precise.<\/li>\n<li><strong>Role: <\/strong>This agent acts as a Summary Generator.<\/li>\n<li><strong>Backstory: <\/strong>It summarizes query resolutions concisely for quick reference.<\/li>\n<li><strong>Goal: <\/strong>It provides a clear and concise summary of how customer queries were resolved.<\/li>\n<li><strong>Verbose Mode:<\/strong> verbose=True ensures that debugging information is available if needed.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-step-5-defining-tasks\">Step 5: Defining Tasks<\/h3>\n<p>The system dynamically assigns tasks to ensure parallel query processing.<\/p>\n<p>This section defines tasks assigned to AI agents in the Concurrent Query Resolution System.<\/p>\n<pre class=\"wp-block-code\"><code>resolution_task = Task(\n    description=\"Resolve the customer query: {query}.\",\n    expected_output=\"A detailed resolution for the customer query.\",\n    agent=query_resolution_agent\n)\n\nsummary_task = Task(\n    description=\"Summarize the resolution of the customer query: {query}.\",\n    expected_output=\"A concise summary of the query resolution.\",\n    agent=summary_agent\n)<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-what-happens-here-0\">What Happens Here?<\/h4>\n<p><strong>Defining Tasks:<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>resolution_task: This task instructs the Query Resolver Agent to analyze and resolve customer queries.<\/li>\n<li>summary_task: This task instructs the Summary Agent to generate a brief summary of the resolution process.<\/li>\n<\/ul>\n<p><strong>Dynamic Query Handling:<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>The system replaces <code>{query}<\/code> with an actual customer query when executing the task.<\/li>\n<li>This allows the system to handle any customer query dynamically.<\/li>\n<\/ul>\n<p><strong>Expected Output:<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>The resolution_task expects a detailed response to the query.<\/li>\n<li>The summary_task generates a concise summary of the query resolution.<\/li>\n<\/ul>\n<p><strong>Agent Assignment:<\/strong><\/p>\n<ul class=\"wp-block-list\">\n<li>The query_resolution_agent is assigned to handle resolution tasks.<\/li>\n<li>The summary_agent is assigned to handle summarization tasks.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-why-this-matters\">Why This Matters<\/h4>\n<ul class=\"wp-block-list\">\n<li><strong>Task Specialization: <\/strong>Each AI agent has a specific job, ensuring efficiency and clarity.<\/li>\n<li><strong>Scalability:<\/strong> You can add more tasks and agents to handle different types of customer support interactions.<\/li>\n<li><strong>Parallel Processing: <\/strong>Tasks can be executed concurrently, reducing customer wait times.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-step-6-executing-a-query-with-ai-agents\">Step 6: Executing a Query with AI Agents<\/h3>\n<p>An asynchronous function is created to process a query. The <code>Crew<\/code> class organizes agents and tasks, executing them sequentially to ensure proper query resolution and summarization.<\/p>\n<pre class=\"wp-block-code\"><code>async def execute_query(query: str):\n    crew = Crew(\n        agents=[query_resolution_agent, summary_agent],\n        tasks=[resolution_task, summary_task],\n        process=Process.sequential,\n        verbose=True\n    )\n    result = await crew.kickoff_async(inputs={\"query\": query})\n    return result\n<\/code><\/pre>\n<p>This function defines an asynchronous process to execute a query. It creates a Crew instance, which includes:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>agents:<\/strong> The AI agents involved in the process (Query Resolver and Summary Generator).<\/li>\n<li><strong>tasks: <\/strong>Tasks assigned to the agents (query resolution and summarization).<\/li>\n<li><strong>process=Process.sequential:<\/strong> Ensures tasks are executed in sequence.<\/li>\n<li><strong>verbose=True:<\/strong> Enables detailed logging for better tracking.<\/li>\n<\/ul>\n<p>The function uses await to execute the AI agents asynchronously and returns the result.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-7-handling-multiple-queries-concurrently\">Step 7: Handling Multiple Queries Concurrently<\/h3>\n<p>Using <code>asyncio.gather()<\/code>, multiple queries can be processed simultaneously. This reduces response time by allowing AI agents to handle different customer issues in parallel.<\/p>\n<pre class=\"wp-block-code\"><code>async def handle_two_queries(query_1: str, query_2: str):\n    # Run both queries concurrently\n    results = await asyncio.gather(\n        execute_query(query_1),\n        execute_query(query_2)\n    )\n    return results<\/code><\/pre>\n<p>This function executes two queries concurrently. asyncio.gather() processes both queries simultaneously, significantly reducing response time. The function returns the results of both queries once execution is complete<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-8-defining-example-queries\">Step 8: Defining Example Queries<\/h3>\n<p>Developers define sample queries to test the system, covering common customer support issues like login failures and payment processing errors.<\/p>\n<pre class=\"wp-block-code\"><code>query_1 = \"I am unable to log in to my account. It says 'Invalid credentials', but I am sure I am using the correct username and password.\"\nquery_2 = \"The payment gateway is not working. Also, a weird error message is displayed. My card has been charged, but the transaction is not going through.\"<\/code><\/pre>\n<p>These are sample queries to test the system.<\/p>\n<p>Query 1 deals with login issues, while Query 2 relates to payment gateway errors.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-9-setting-up-the-event-loop\">Step 9: Setting Up the Event Loop<\/h3>\n<p>The system initializes an event loop to handle asynchronous operations. If it doesn\u2019t find an existing loop, it creates a new one to manage AI task execution.<\/p>\n<pre class=\"wp-block-code\"><code>try:\n    loop = asyncio.get_event_loop()\nexcept RuntimeError:\n    loop = asyncio.new_event_loop()\n    asyncio.set_event_loop(loop)<\/code><\/pre>\n<p>This section ensures that an event loop is available for running asynchronous tasks.<\/p>\n<p>If the system detects no event loop (RuntimeError occurs), it creates a new one and sets it as the active loop.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-10-handling-event-loops-in-jupyter-notebook-google-colab\">Step 10: Handling Event Loops in Jupyter Notebook\/Google Colab<\/h3>\n<p>Since Jupyter and Colab have pre-existing event loops, <code>nest_asyncio.apply()<\/code> is used to prevent conflicts, ensuring smooth execution of asynchronous queries.<\/p>\n<pre class=\"wp-block-code\"><code># Check if the event loop is already running\nif loop.is_running():\n    # If the loop is running, use `nest_asyncio` to allow re-entrant event loops\n    import nest_asyncio\n    nest_asyncio.apply()<\/code><\/pre>\n<p>Jupyter Notebooks and Google Colab have pre-existing event loops, which can cause errors when running async functions.<\/p>\n<p>nest_asyncio.apply() allows nested event loops, resolving compatibility issues.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-11-executing-queries-and-printing-results\">Step 11: Executing Queries and Printing Results<\/h3>\n<p>The event loop runs <code>handle_two_queries()<\/code> to process queries concurrently. The system prints the final AI-generated responses, displaying query resolutions and summaries.<\/p>\n<pre class=\"wp-block-code\"><code># Run the async function\nresults = loop.run_until_complete(handle_two_queries(query_1, query_2))\n\n# Print the results\nfor i, result in enumerate(results):\n    print(f\"Result for Query {i+1}:\")\n    print(result)\n    print(\"\\n---\\n\")<\/code><\/pre>\n<p>loop.run_until_complete() starts the execution of handle_two_queries(), which processes both queries concurrently.<\/p>\n<p>The system prints the results, displaying the AI-generated resolutions for each query.<\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1742\" height=\"568\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_fIdqfmh.webp\" alt=\"output: Concurrent Query Resolution System\" class=\"wp-image-223590\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_fIdqfmh.webp 1742w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_fIdqfmh-300x98.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_fIdqfmh-768x250.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_fIdqfmh-1536x501.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_fIdqfmh-150x49.webp 150w\" sizes=\"(max-width: 1742px) 100vw, 1742px\"\/><\/figure>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1758\" height=\"430\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_h3hvY4w.webp\" alt=\"output: Concurrent Query Resolution System\" class=\"wp-image-223592\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_h3hvY4w.webp 1758w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_h3hvY4w-300x73.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_h3hvY4w-768x188.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_h3hvY4w-1536x376.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/02\/image_h3hvY4w-150x37.webp 150w\" sizes=\"auto, (max-width: 1758px) 100vw, 1758px\"\/><\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-advantages-of-concurrent-query-resolution-system\">Advantages of Concurrent Query Resolution System<\/h2>\n<p>Below, we will see how the Concurrent Query Resolution System enhances efficiency by processing multiple queries simultaneously, leading to faster response times and improved user experience.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Faster Response Time: <\/strong>Parallel execution resolves multiple queries simultaneously.<\/li>\n<li><strong>Improved Accuracy: <\/strong>Leveraging multiple LLMs ensures a balance between creativity and factual correctness.<\/li>\n<li><strong>Scalability: <\/strong>The system can handle a high volume of queries without human intervention.<\/li>\n<li><strong>Better Customer Experience:<\/strong> Automated summaries provide a quick overview of query resolutions.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-applications-of-concurrent-query-resolution-system\">Applications of Concurrent Query Resolution System<\/h2>\n<p>We will now explore the various applications of the Concurrent Query Resolution System, including customer support automation, real-time query handling in chatbots, and efficient processing of large-scale service requests.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Customer Support Automation<\/strong>: Enables AI-driven chatbots to resolve multiple customer queries simultaneously, reducing response time.<\/li>\n<li><strong>Real-Time Query Processing<\/strong>: Enhances live support systems by handling numerous queries in parallel, improving efficiency.<\/li>\n<li><strong>E-commerce Assistance<\/strong>: Streamlines product inquiries, order tracking, and payment issue resolutions in online shopping platforms.<\/li>\n<li><strong>IT Helpdesk Management<\/strong>: Supports IT service desks by diagnosing and resolving multiple technical issues concurrently.<\/li>\n<li><strong>Healthcare &amp; Telemedicine<\/strong>: Assists in managing patient inquiries, appointment scheduling, and medical advice simultaneously.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>The Concurrent Query Resolution System demonstrates how AI-driven multi-agent collaboration can revolutionize customer support. By leveraging CrewAI, OpenAI\u2019s GPT models, and Google Gemini, businesses can automate query handling, improving efficiency and user satisfaction. This approach paves the way for more advanced AI-driven service solutions in the future.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-key-takeaways\">Key Takeaways<\/h4>\n<ul class=\"wp-block-list\">\n<li>AI agents streamline customer support, reducing response times.<\/li>\n<li>CrewAI enables specialized agents to work together effectively.<\/li>\n<li>Using asyncio, multiple queries are handled concurrently.<\/li>\n<li>Different LLM configurations balance accuracy and creativity.<\/li>\n<li>The system can manage high query volumes without human intervention.<\/li>\n<li>Automated summaries provide quick, clear query resolutions.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-frequently-asked-questions\">Frequently Asked Questions<\/h2>\n<div class=\"schema-faq wp-block-yoast-faq-block\">\n<div class=\"schema-faq-section\" id=\"faq-question-1740643155126\"><strong class=\"schema-faq-question\">Q1. What is CrewAI?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. CrewAI is a framework that allows multiple AI agents to work collaboratively on complex tasks. It enables task management, role specialization, and seamless coordination among agents.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1740643176737\"><strong class=\"schema-faq-question\">Q2. How does CrewAI work?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. CrewAI defines agents with specific roles, assigns tasks dynamically, and processes them either sequentially or concurrently. It leverages AI models like OpenAI\u2019s GPT and Google Gemini to execute tasks efficiently.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1740643191301\"><strong class=\"schema-faq-question\">Q3. How does CrewAI handle multiple queries simultaneously?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. CrewAI uses Python\u2019s asyncio.gather() to run multiple tasks concurrently, ensuring faster query resolution without performance bottlenecks.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1740643208663\"><strong class=\"schema-faq-question\">Q4. Can CrewAI integrate with different LLMs?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. Yes, CrewAI supports various large language models (LLMs), including OpenAI\u2019s GPT-4, GPT-4o, and Google\u2019s Gemini, allowing users to choose based on speed and accuracy requirements.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1740643229738\"><strong class=\"schema-faq-question\">Q5. How does CrewAI ensure task accuracy?<\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. By using different AI models with varied temperature settings, CrewAI balances creativity and factual correctness, ensuring reliable responses.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><strong>The media shown in this article is not owned by Analytics Vidhya and is used at the Author\u2019s discretion.<\/strong><\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/seematiwari01161296977\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_INvoac4.webp\" width=\"48\" height=\"48\" alt=\"seematiwari0116 .\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>Hi! I am a keen Data Science student who loves to explore new things. My passion for data science stems from a deep curiosity about how data can be transformed into actionable insights. I enjoy diving into various datasets, uncovering patterns, and applying machine learning algorithms to solve real-world problems. Each project I undertake is an opportunity to enhance my skills and learn about new tools and techniques in the ever-evolving field of data science.<\/p>\n<\/p><\/div>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>In the era of artificial intelligence, businesses are constantly seeking innovative ways to enhance customer support services. One such approach is leveraging AI agents that work collaboratively to resolve customer queries efficiently. This article explores the implementation of a Concurrent Query Resolution System using CrewAI, OpenAI\u2019s GPT models, and Google Gemini. This system employs multiple [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":115799,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[5815,51381,25471,44762,19578,2345],"dealstore":[],"offerexpiration":[],"class_list":["post-115797","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-blogathon","tag-concurrent","tag-crewai","tag-query","tag-resolution","tag-system"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Concurrent Query Resolution System Using CrewAI - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=115797\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Concurrent Query Resolution System Using CrewAI - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"In the era of artificial intelligence, businesses are constantly seeking innovative ways to enhance customer support services. One such approach is leveraging AI agents that work collaboratively to resolve customer queries efficiently. This article explores the implementation of a Concurrent Query Resolution System using CrewAI, OpenAI\u2019s GPT models, and Google Gemini. This system employs multiple [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=115797\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-28T19:34:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=115797#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=115797\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Concurrent Query Resolution System Using CrewAI\",\"datePublished\":\"2025-02-28T19:34:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=115797\"},\"wordCount\":1854,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=115797#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp\",\"keywords\":[\"Blogathon\",\"Concurrent\",\"CrewAI\",\"Query\",\"Resolution\",\"SYSTEM\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=115797#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=115797\",\"url\":\"https:\/\/fivemor.com\/?p=115797\",\"name\":\"Concurrent Query Resolution System Using CrewAI - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=115797#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=115797#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp\",\"datePublished\":\"2025-02-28T19:34:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=115797#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=115797\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=115797#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp\",\"width\":872,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=115797#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Concurrent Query Resolution System Using CrewAI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Concurrent Query Resolution System Using CrewAI - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=115797","og_locale":"en_US","og_type":"article","og_title":"Concurrent Query Resolution System Using CrewAI - Som2ny Network","og_description":"In the era of artificial intelligence, businesses are constantly seeking innovative ways to enhance customer support services. One such approach is leveraging AI agents that work collaboratively to resolve customer queries efficiently. This article explores the implementation of a Concurrent Query Resolution System using CrewAI, OpenAI\u2019s GPT models, and Google Gemini. This system employs multiple [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=115797","og_site_name":"Som2ny Network","article_published_time":"2025-02-28T19:34:06+00:00","og_image":[{"width":872,"height":473,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=115797#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=115797"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Concurrent Query Resolution System Using CrewAI","datePublished":"2025-02-28T19:34:06+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=115797"},"wordCount":1854,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=115797#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp","keywords":["Blogathon","Concurrent","CrewAI","Query","Resolution","SYSTEM"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=115797#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=115797","url":"https:\/\/fivemor.com\/?p=115797","name":"Concurrent Query Resolution System Using CrewAI - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=115797#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=115797#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp","datePublished":"2025-02-28T19:34:06+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=115797#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=115797"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=115797#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/Concurrent-Query-Resolution-System-Using-crewAI-1.webp.webp","width":872,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=115797#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Concurrent Query Resolution System Using CrewAI"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/115797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=115797"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/115797\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/115799"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=115797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=115797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=115797"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=115797"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=115797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}