DEV Community

Benhar Mariasoosai
Benhar Mariasoosai

Posted on

An Experiment into Multi-Agent Orchestration with CrewAI

🏡 Real Estate Investment Research with CrewAI

An experiment in automating real estate market analysis and property discovery using agentic workflows.


📖 Introduction

We've moved past simple chatbots and into the era of agentic workflows — systems where LLMs can plan, execute tools, and collaborate to achieve complex goals.

This project explores CrewAI, a framework that orchestrates role-playing autonomous AI agents. The goal is to automate the tedious and data-heavy task of finding real estate investment properties.


💡 The Concept: Real Estate Research

Instead of asking a single broad prompt like:

"Find good investment houses in Texas"

We break the problem 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.


⚙️ Implementation

The key idea is to define agents, assign tasks, and run them sequentially so outputs from one agent become inputs for the next.


1️⃣ Configuration & Model Setup

This example uses Google Gemini. We can aslo different LLMs.

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
)
Enter fullscreen mode Exit fullscreen mode

In AI models, this setting "temperature" controls the balance between predictability and creativity:

0.1–0.3 (Low): Precise and factual; good for data extraction.

0.5 (Medium): The "balanced" setting you are using; ideal for agents that need to follow logic while adapting to different search results.

0.8+ (High): Creative and random; better for brainstorming or storytelling.

SerperDevTool is a specialized search tool designed to give your AI agents the ability to search the internet in real-time


2️⃣ Defining the Agents

Backstories help shape how each agent interprets information.

# Agent 1: 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
)

# Agent 2: 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
)
Enter fullscreen mode Exit fullscreen mode

3️⃣ Defining the Tasks

The second task explicitly depends on the first.

# 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
)
Enter fullscreen mode Exit fullscreen mode

4️⃣ Assembling the Crew

We enforce sequential execution so context flows properly.

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)
Enter fullscreen mode Exit fullscreen mode

🧠 Why This Matters

Agentic workflows allow:

  • Task decomposition
  • Role specialization
  • Context-aware execution
  • Multi-step reasoning
  • Automated research pipelines

📦 Requirements

pip install crewai langchain-google-genai crewai-tools
Enter fullscreen mode Exit fullscreen mode

Top comments (0)