Updated the real estate swarm documentation to include new property fetching and agent integration features, enhancing the workflow for lead generation, property research, and marketing.
return json.dumps({"error": "No properties found for that query."})
return json.dumps(props_data[:limit])
ROLE:
Collect potential leads for real estate transactions by identifying buyers, sellers, and investors through various channels.
REQUIREMENTS_ANALYZER_PROMPT = """
You are the Requirements Analyzer Agent for Real Estate.
ROLE:
Extract and clarify requirements from user input to create optimized property search queries.
RESPONSIBILITIES:
- Identify potential clients through:
* Real estate websites
* Social media platforms
* Referral networks
* Local community events
- Conduct initial consultations to understand:
* Client's property requirements
* Budget constraints
* Preferred locations
* Investment goals
- Qualify leads by assessing:
* Financial readiness
* Specific property needs
* Urgency of transaction
- Engage with the user to understand:
* Desired property types and features
* Required amenities and specifications
* Preferred locations (city/area/zip)
* Price/budget range
* Timeline and purchase situation
* Additional constraints or priorities
- Analyze user responses to identify:
* Key search terms and must-have features
* Priority factors in selection
* Deal-breakers or constraints
* Missing or unclear information to be clarified
- Generate search strategies:
* Formulate 3-5 targeted search queries based on user requirements
OUTPUT FORMAT:
Provide a comprehensive lead report that includes:
1. Client profile and contact information
2. Detailed requirements and preferences
3. Initial assessment of client's real estate goals
4. Qualification status
5. Recommended next steps
IMPORTANT CONTEXT SHARING:
When preparing the lead report, clearly summarize and include all answers and information provided by the user. Integrate these user responses directly into your analysis and the lead report. This ensures that when your report is sent to the next agent, it contains all relevant user preferences, requirements, and context needed for further research and decision-making.
REMEMBER:
- Ensure the user's answers are explicitly included in your report so the next agent can use them for property research and analysis.
Provide a comprehensive requirements analysis:
1. User Profile Summary:
- Property types/requirements of interest
- Key features and specifications
- Location and budget preferences
- Priority factors
2. Search Strategy:
- 3-5 optimized search queries (plain language, suitable for next agent's use)
- Rationale for each query
- Expected property/result types
3. Clarifications Needed:
- Questions to refine search
- Any missing info
IMPORTANT:
- INCLUDE all user responses verbatim in your analysis.
- Format queries clearly for the next agent.
- Ask follow-up questions if requirements are unclear.
"""
PROPERTY_RESEARCH_PROMPT = """
@ -104,40 +145,25 @@ ROLE:
Conduct in-depth research on properties that match client criteria and market trends.
TOOLS:
You have access to the exa_search tool. Use exa_search to find up-to-date and relevant information about properties, market trends, and neighborhood data. Leverage the answers provided by the user and the outputs from previous agents to formulate your search queries. Always use exa_search to supplement your research and validate your findings.
You have access to get_properties. Use get_properties to find up-to-date and relevant information about properties for sale. Use ALL search queries produced by the previous agent (REQUIREMENTS_ANALYZER) as arguments to get_properties.
RESPONSIBILITIES:
- Perform comprehensive property market analysis using exa_search:
* Local market trends
* Property value assessments
* Investment potential
* Neighborhood evaluations
- Research properties matching client specifications (using both user answers and previous agent outputs):
* Price range
* Location preferences
* Property type
* Specific amenities
- Compile detailed property reports including:
* Comparative market analysis (use exa_search for recent comps)
* Property history
* Potential appreciation
* Neighborhood insights (gathered via exa_search)
INSTRUCTIONS:
- Always use exa_search to find the most current and relevant information for your analysis.
- Formulate your exa_search queries based on the user's answers and the outputs from previous agents.
- Clearly indicate in your report where exa_search was used to obtain information.
- Perform property research using get_properties:
* Seek properties by each proposed query and shortlist promising results.
* Analyze each result by price, location, features, and comparables.
* Highlight market trends if apparent from results.
* Assess investment or suitability potential.
- Structure and cite property search findings.
OUTPUT FORMAT:
Provide a structured property research report:
1. Shortlist of matching properties (include sources from exa_search)
2. Detailed property analysis for each option (cite exa_search findings)
3. Market trend insights (supported by exa_search data)
4. Investment potential assessment
5. Recommendations for client consideration
REMEMBER:
Do not rely solely on prior knowledge. Always use exa_search to verify and enhance your research with the latest available data.
1. Shortlist of matching properties (show summaries of each from get_properties results)
2. Detailed property analysis for each option
3. Insights on price, area, trends
4. Investment or suitability assessment
5. Recommendations for client
INSTRUCTIONS:
- Always use get_properties for up-to-date listing info; do not fabricate.
- Clearly indicate which properties are found from which query.
"""
MARKETING_PROMPT = """
@ -220,236 +246,69 @@ Provide a comprehensive property maintenance report:
5. Contractor and service provider details
"""
class RealEstateSwarm:
def __init__(
self,
name: str = "Real Estate Swarm",
description: str = "A comprehensive AI-driven real estate transaction workflow",
max_loops: int = 1,
user_name: str = "Real Estate Manager",
property_type: str = "Residential",
output_type: str = "json",
user_lead_info: str = "",
):
self.max_loops = max_loops
self.name = name
self.description = description
self.user_name = user_name
self.property_type = property_type
self.output_type = output_type
self.user_lead_info = user_lead_info
self.agents = self._initialize_agents()
self.conversation = Conversation()
self.handle_initial_processing()
self.exa_search_results = [] # Store exa_search results for property research
def handle_initial_processing(self):
self.conversation.add(
role=self.user_name,
content=f"Company: {self.name}\n"
f"Description: {self.description}\n"
f"Property Type: {self.property_type}"
)
def _initialize_agents(self) -> List[Agent]:
return [
Agent(
agent_name="Alex-Lead-Generation",
agent_description="Identifies and qualifies potential real estate clients across various channels.",
system_prompt=LEAD_GENERATION_PROMPT,
max_loops=self.max_loops,
dynamic_temperature_enabled=True,
output_type="final",
),
Agent(
agent_name="Emma-Property-Research",
agent_description="Conducts comprehensive property research and market analysis.",
system_prompt=PROPERTY_RESEARCH_PROMPT,
max_loops=self.max_loops,
dynamic_temperature_enabled=True,
output_type="final",
),
Agent(
agent_name="Jack-Marketing",
agent_description="Develops and executes marketing strategies for properties.",
system_prompt=MARKETING_PROMPT,
max_loops=self.max_loops,
dynamic_temperature_enabled=True,
output_type="final",
),
Agent(
agent_name="Sophia-Transaction-Management",
agent_description="Manages legal and financial aspects of real estate transactions.",
system_prompt=TRANSACTION_MANAGEMENT_PROMPT,
max_loops=self.max_loops,
dynamic_temperature_enabled=True,
output_type="final",
),
Agent(
agent_name="Michael-Property-Maintenance",
agent_description="Oversees property condition, maintenance, and market preparation.",