An Experiment into Multi-Agent Orchestration with CrewAI
Source: Dev.to
Overview
An experiment in automating real‑estate market analysis and property discovery using agentic workflows.
CrewAI is a framework that orchestrates role‑playing autonomous AI agents to automate the data‑heavy task of finding real‑estate investment properties.
Instead of a single broad prompt like:
“Find good investment houses in Texas”
the problem is broken into specialized roles:
- Market Researcher – Identifies promising cities based on rental yield and economic signals.
- Property Listing Specialist – Finds active listings in those cities and evaluates investment potential.
This separation improves clarity, reasoning quality, and execution reliability. The agents are defined, assigned tasks, and run sequentially so that the output of one agent becomes the input for the next.
Setup
import os
from crewai import Agent, Task, Crew, Process
from langchain_google_genai import ChatGoogleGenerativeAI
from crewai_tools import ScrapeWebsiteTool, SerperDevTool
# Set API keys
os.environ["GOOGLE_API_KEY"] = "your_google_key"
os.environ["SERPER_API_KEY"] = "your_serper_key"
# Initialize tools
search_tool = SerperDevTool()
scrape_tool = ScrapeWebsiteTool()
# Initialize LLM
smart_llm = ChatGoogleGenerativeAI(
model="gemini-1.5-flash",
temperature=0.5,
verbose=True
)
Temperature Settings
| Temperature | Effect |
|---|---|
| 0.1–0.3 (Low) | Precise and factual; good for data extraction. |
| 0.5 (Medium) | Balanced; ideal for agents that need logical reasoning while adapting to varied search results. |
| 0.8+ (High) | Creative and random; better for brainstorming or storytelling. |
SerperDevTool provides real‑time internet search capability for the agents.
Agents
Market Researcher
market_researcher = Agent(
role="Real Estate Research Analyst",
goal="Identify the top 3 cities in Texas for rental yield based on current economic data.",
backstory=(
"You are an expert in Texas real estate with a background in urban planning and economics. "
"You specialize in identifying emerging markets early."
),
tools=[search_tool],
llm=smart_llm,
verbose=True
)
Property Listing Specialist
listing_specialist = Agent(
role="Property Investment Specialist",
goal="Locate high‑potential property listings in the cities identified by the researcher.",
backstory=(
"You are a seasoned property investor who analyzes listing price, rent estimates, "
"and cash flow potential."
),
tools=[search_tool],
llm=smart_llm,
verbose=True
)
Tasks
Task 1 – Market Analysis
research_task = Task(
description="Analyze the Texas real estate market to find the top 3 cities for rental yield.",
expected_output="A report identifying 3 specific cities or neighborhoods in Texas.",
agent=market_researcher
)
Task 2 – Property Search
property_search_task = Task(
description=(
"Using the cities identified by the market researcher, "
"find 3‑5 property listings currently on the market."
),
expected_output="A list of 5 property links with price, address, and investment summary.",
agent=listing_specialist
)
Execution
real_estate_crew = Crew(
agents=[market_researcher, listing_specialist],
tasks=[research_task, property_search_task],
process=Process.sequential
)
result = real_estate_crew.kickoff(
inputs={"topic": "Texas Rental Markets"}
)
print(result)
Benefits of Agentic Workflows
- Task decomposition
- Role specialization
- Context‑aware execution
- Multi‑step reasoning
- Automated research pipelines
Installation
pip install crewai langchain-google-genai crewai-tools