Configuration Guide - curlyphries/Crew.AI-Ollama-Multi-Agent-System GitHub Wiki
Mastering Crew.ai’s multi_agent_config.yaml: Enabling and Disabling Agents
The multi_agent_config.yaml file is the brain of the Crew.ai Ollama Multi-Agent System. It lets you easily control which agents (like virtual helpers) are active, which are disabled, and how they collaborate to perform tasks. Whether you’re new to tech or customizing for professional workflows, this guide will help you set up and manage your system step by step.
What is multi_agent_config.yaml?
Think of multi_agent_config.yaml as your system’s instruction manual. It helps you:
- Define how the system works as a whole.
- List all available agents (helpers) in your system.
- Turn specific agents on or off to match your needs.
Here’s an example of what the file looks like:
orchestration:
multi_agent: true
memory_store: vector_db
agents:
- name: ollama_agent
enabled: true
- name: household_chores_agent
enabled: true
- name: diet_meal_planning_agent
enabled: false
- name: photo_management_agent
enabled: false
Breaking Down the File
1. Orchestration Section
This part defines how your system operates:
multi_agent
: Iftrue
, multiple agents can collaborate to solve tasks. Iffalse
, only one agent will handle everything.memory_store
: Defines how your system stores information. Options include:vector_db
: Uses advanced storage for quick recall (great for complex tasks).in_memory
: Stores data temporarily while the system is running.
2. Agents Section
This section lists all your agents. Each agent has:
name
: A unique name for the agent (e.g.,ollama_agent
).enabled
: Atrue
orfalse
value to control whether the agent is active.
How to Enable or Disable Agents
Enabling an Agent
To turn on an agent, set its enabled
field to true
:
- name: diet_meal_planning_agent
enabled: true
Once enabled, this agent will activate the next time you restart the system.
Disabling an Agent
To turn off an agent, set its enabled
field to false
:
- name: photo_management_agent
enabled: false
Disabled agents won’t run, which saves system resources.
Why Would You Enable or Disable Agents?
1. Save Resources
Some agents require more memory or processing power. Disabling non-essential agents can improve performance, especially on less powerful machines.
2. Focus on What You Need
If you only care about meal planning and tracking expenses, you can disable agents like photo management or streaming recommendations to keep things simple.
3. Debugging or Testing
When creating or fixing a new agent, disable the others to isolate and test its functionality.
4. Privacy
Certain agents might use the internet (e.g., for weather or streaming data). If you prefer everything offline, disable agents that require external connections.
How the System Reads multi_agent_config.yaml
The AgentManager
in Crew.ai reads your configuration file to decide which agents to activate. Here’s a simplified version of how it works:
import yaml
from agents.ollama_agent import OllamaAgent
from agents.household_chores_agent import HouseholdChoresAgent
from agents.diet_meal_planning_agent import DietMealPlanningAgent
class AgentManager:
def __init__(self):
# Load the configuration file
with open("src/config/multi_agent_config.yaml", "r") as f:
self.config = yaml.safe_load(f)
self.active_agents = self.load_agents()
def load_agents(self):
agents = []
for agent_def in self.config.get("agents", []):
if agent_def["enabled"]:
if agent_def["name"] == "ollama_agent":
agents.append(OllamaAgent())
elif agent_def["name"] == "household_chores_agent":
agents.append(HouseholdChoresAgent())
elif agent_def["name"] == "diet_meal_planning_agent":
agents.append(DietMealPlanningAgent())
return agents
Key Takeaways:
- The system looks for agents marked
enabled: true
in themulti_agent_config.yaml
file. - Only enabled agents are added to the system and ready to handle tasks.
Example Configurations
Minimal Setup
For a basic system that handles general tasks and household chores:
orchestration:
multi_agent: true
memory_store: in_memory
agents:
- name: ollama_agent
enabled: true
- name: household_chores_agent
enabled: true
- name: diet_meal_planning_agent
enabled: false
Full Feature Setup
For a system with all available agents enabled:
orchestration:
multi_agent: true
memory_store: vector_db
agents:
- name: ollama_agent
enabled: true
- name: household_chores_agent
enabled: true
- name: diet_meal_planning_agent
enabled: true
- name: photo_management_agent
enabled: true
Tips for Success
-
Keep a Backup: Always save a copy of your working configuration file in case you need to revert.
-
Test Changes: When enabling a new agent, test it individually to make sure it works as expected.
-
Monitor Performance: If the system feels slow, try disabling resource-heavy agents.
-
Document Your Setup: Add comments to your
multi_agent_config.yaml
file to track why certain agents are enabled or disabled.
Example:
# Enabling photo management for organizing holiday pictures
- name: photo_management_agent
enabled: true
Conclusion
The multi_agent_config.yaml file gives you full control over how Crew.ai operates. By turning agents on or off, you can:
- Customize the system to match your goals.
- Optimize its performance for your hardware.
- Keep things simple or expand as needed.
Whether you’re a tech enthusiast or just looking for a practical assistant, mastering this configuration file is the key to unlocking Crew.ai’s full potential. Start experimenting today and create your perfect AI setup!