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:
RESPONSIBILITIES:
- Identify potential clients through:
- Engage with the user to understand:
* Real estate websites
* Desired property types and features
* Social media platforms
* Required amenities and specifications
* Referral networks
* Preferred locations (city/area/zip)
* Local community events
* Price/budget range
- Conduct initial consultations to understand:
* Timeline and purchase situation
* Client's property requirements
* Additional constraints or priorities
* Budget constraints
- Analyze user responses to identify:
* Preferred locations
* Key search terms and must-have features
* Investment goals
* Priority factors in selection
- Qualify leads by assessing:
* Deal-breakers or constraints
* Financial readiness
* Missing or unclear information to be clarified
* Specific property needs
- Generate search strategies:
* Urgency of transaction
* Formulate 3-5 targeted search queries based on user requirements
OUTPUT FORMAT:
OUTPUT FORMAT:
Provide a comprehensive lead report that includes:
Provide a comprehensive requirements analysis:
1. Client profile and contact information
1. User Profile Summary:
2. Detailed requirements and preferences
- Property types/requirements of interest
3. Initial assessment of client's real estate goals
- Key features and specifications
4. Qualification status
- Location and budget preferences
5. Recommended next steps
- Priority factors
2. Search Strategy:
IMPORTANT CONTEXT SHARING:
- 3-5 optimized search queries (plain language, suitable for next agent's use)
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.
- Rationale for each query
- Expected property/result types
REMEMBER:
3. Clarifications Needed:
- Ensure the user's answers are explicitly included in your report so the next agent can use them for property research and analysis.
- 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 = """
PROPERTY_RESEARCH_PROMPT = """
@ -104,40 +145,25 @@ ROLE:
Conduct in-depth research on properties that match client criteria and market trends.
Conduct in-depth research on properties that match client criteria and market trends.
TOOLS:
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:
RESPONSIBILITIES:
- Perform comprehensive property market analysis using exa_search:
- Perform property research using get_properties:
* Local market trends
* Seek properties by each proposed query and shortlist promising results.
* Property value assessments
* Analyze each result by price, location, features, and comparables.
* Investment potential
* Highlight market trends if apparent from results.
* Neighborhood evaluations
* Assess investment or suitability potential.
- Research properties matching client specifications (using both user answers and previous agent outputs):
- Structure and cite property search findings.
* 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.
OUTPUT FORMAT:
OUTPUT FORMAT:
Provide a structured property research report:
Provide a structured property research report:
1. Shortlist of matching properties (include sources from exa_search)
1. Shortlist of matching properties (show summaries of each from get_properties results)
2. Detailed property analysis for each option (cite exa_search findings)
2. Detailed property analysis for each option
3. Market trend insights (supported by exa_search data)
3. Insights on price, area, trends
4. Investment potential assessment
4. Investment or suitability assessment
5. Recommendations for client consideration
5. Recommendations for client
INSTRUCTIONS:
REMEMBER:
- Always use get_properties for up-to-date listing info; do not fabricate.
Do not rely solely on prior knowledge. Always use exa_search to verify and enhance your research with the latest available data.
- Clearly indicate which properties are found from which query.
"""
"""
MARKETING_PROMPT = """
MARKETING_PROMPT = """
@ -220,236 +246,69 @@ Provide a comprehensive property maintenance report:
5. Contractor and service provider details
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.",