A sophisticated 3-agent AI architecture for real estate investment analysis using Google's Gemini models and ATTOM Data API.
- File:
agents/customer_agent.py - Handles user interactions and conversations
- Explains complex analysis in simple terms
- Provides friendly, accessible responses
- Fast response times for real-time chat
- Answers follow-up questions and provides guidance
- File:
agents/analysis_engine.py - Performs complex property valuations and ARV calculations
- Conducts comprehensive market analysis
- Assesses investment risks and opportunities
- Generates deal scores and investment recommendations
- Finds and analyzes comparable properties
- File:
agents/deal_finder.py - Continuously monitors new property listings
- Flags undervalued properties automatically
- Generates investment opportunity alerts
- Background service with configurable search criteria
- User-specific deal notifications
- File:
agents/coordinator.py - Manages communication between all agents
- Priority-based message queuing and routing
- Load balancing and error recovery
- Performance monitoring and metrics
- Quick Property Analysis: Get instant property evaluations with deal scores
- Comprehensive Market Analysis: Deep market insights using AI-powered analysis
- Investment Strategy Recommendations: AI suggests optimal investment approaches
- Risk Assessment: Detailed risk evaluation across multiple categories
- Multi-Agent Coordination: Sophisticated inter-agent communication system
- ATTOM Data Integration: Real property data and market analytics (when configured)
pip install -r requirements.txt- Copy
.env.exampleto.env - Add your API keys:
GEMINI_API_KEY=your_gemini_api_key_here ATTOM_API_KEY=your_attom_api_key_here # Optional - will use mock data if not provided
- Go to Google AI Studio
- Create a new API key
- Copy the key to your
.envfile
- Sign up at ATTOM Data
- Get your API key from the dashboard
- Add to
.envfile (platform works with mock data if not provided)
.\run.ps1or
run.batpython -m uvicorn main:app --host 0.0.0.0 --port 8000 --reload- Open your browser and go to: http://localhost:8000
- Try the chatbot interface or use the API endpoints directly
GET /- Main chat interface (HTML)POST /chat- Chat with Customer AgentGET /health- System health check
POST /api/analyze/quick- Quick property analysisPOST /api/analyze/comprehensive- Comprehensive analysisGET /api/analyze/status/{analysis_id}- Check analysis status
POST /api/deals/search- Search for investment dealsPOST /api/deals/monitor- Add property to monitoringGET /api/deals/alerts/{user_id}- Get user's deal alertsPOST /api/deals/criteria/{user_id}- Set search criteriaGET /api/deals/status- Deal Finder monitoring status
POST /api/chat/explain- Explain analysis resultsPOST /api/chat/followup- Answer follow-up questionsPOST /api/chat/next-steps- Get recommended next steps
GET /api/agent/coordinator/metrics- Agent coordination metricsGET /api/agent/status/{agent_type}- Individual agent status
GET /api/property/details/{address}- Detailed property informationGET /api/market/data- Market analytics by area
GET /api/demo/sample-analysis- Sample analysis resultsGET /api/demo/sample-deals- Sample deals from Deal FinderGET /api/demo/all-agents- See all three agents working together
curl -X POST "http://localhost:8000/api/analyze/quick" \
-H "Content-Type: application/json" \
-d '{
"address": "123 Main St, Blacksburg, VA 24060",
"listing_price": 275000
}'curl -X POST "http://localhost:8000/api/deals/search" \
-H "Content-Type: application/json" \
-d '{
"max_price": 300000,
"min_deal_score": 70,
"target_locations": ["Blacksburg", "VA"],
"max_results": 10
}'curl -X POST "http://localhost:8000/api/chat/explain" \
-H "Content-Type: application/json" \
-d '{
"analysis_data": {
"deal_score": 78.5,
"investment_potential": "Good",
"arv_estimate": 285000,
"monthly_cash_flow": 450
}
}'curl "http://localhost:8000/api/demo/all-agents"{
"address": "123 Main St, Blacksburg, VA 24060",
"deal_score": 78.5,
"investment_potential": "Good",
"arv_estimate": 285000,
"recommended_strategy": "buy_and_hold",
"monthly_cash_flow": 450.0,
"key_insight": "Property shows strong cash flow potential with moderate appreciation",
"confidence_score": 0.85
}VT_Hacks_25/
βββ agents/
β βββ customer_agent.py # Agent 1: Customer-facing conversational agent
β βββ analysis_engine.py # Agent 2: Property analysis engine
β βββ deal_finder.py # Agent 3: Background deal monitoring service
β βββ coordinator.py # Multi-agent coordination system
β βββ __init__.py
βββ models/
β βββ data_models.py # Pydantic models for all data structures
β βββ __init__.py
βββ integrations/
β βββ attom_api.py # ATTOM Data API integration
β βββ __init__.py
βββ static/
β βββ index.html # Frontend chat interface
βββ main.py # FastAPI application with all endpoints
βββ requirements.txt # Python dependencies
βββ .env.example # Configuration template
βββ README.md # This file
The Analysis Engine (Agent 2) provides comprehensive real estate investment analysis:
- ARV (After Repair Value) Calculations: AI-powered property value estimates
- Comparable Property Analysis: Finds and analyzes similar properties
- Market Price Evaluation: Current market value assessments
- Deal Scoring: 0-100 scale rating system for investment opportunities
- Cash Flow Projections: Monthly and annual cash flow estimates
- ROI Calculations: Return on investment and cash-on-cash returns
- Strategy Recommendations: Optimal investment approach (Buy & Hold, Flip, BRRRR, Wholesale)
- Market Risk Analysis: Local market volatility and trends
- Property-Specific Risks: Condition, location, and tenant factors
- Financial Risk Evaluation: Interest rate sensitivity and financing risks
- Regulatory Risk Assessment: Zoning and regulatory considerations
- Local Market Trends: Price movements and inventory analysis
- Neighborhood Dynamics: Gentrification and development patterns
- Economic Indicators: Employment and population growth factors
- Investment Climate: Cap rates and rental yield analysis
- Agent Coordinator: Manages communication between all agents
- Message Queuing: Priority-based request handling
- Load Balancing: Distributes workload across agents
- Error Handling: Robust error recovery and retry mechanisms
- Gemini 1.5 Pro: Complex analysis and reasoning tasks
- Gemini 2.5 Flash: Fast conversational responses
- ATTOM Data API: Property details, market data, comparable sales
- AI Analysis: Gemini-powered insights and recommendations
- Mock Data: Fallback when APIs are unavailable
- Agent 3: Deal Finder - Automated property discovery and monitoring
- Advanced ATTOM Integration - Full property search and filtering
- User Authentication - Personalized analysis and saved properties
- Email Alerts - Automated deal notifications
- Portfolio Tracking - Investment performance monitoring
- Mobile App - iOS and Android companion apps
The platform includes comprehensive error handling:
- API timeouts and retries
- Graceful degradation when services are unavailable
- Fallback calculations when AI analysis fails
- Detailed logging for troubleshooting
All components include detailed logging:
- Request/response tracking
- Performance metrics
- Error diagnostics
- Agent coordination events
βββ main.py # FastAPI backend
βββ static/
β βββ index.html # Chat interface
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (your API keys)
βββ .env.example # Environment template
βββ run.ps1 # PowerShell run script
βββ run.bat # Batch run script
βββ README.md # This file
- β Clean, responsive chat interface
- β Real-time messaging with Gemini AI
- β Health check endpoint
- β Error handling and connection status
- β Typing indicators
- β Mobile-friendly design
-
"Import google.generativeai could not be resolved"
- Make sure you've installed dependencies:
pip install -r requirements.txt
- Make sure you've installed dependencies:
-
"GEMINI_API_KEY not found"
- Create a
.envfile with your API key - Make sure the key is valid and active
- Create a
-
"No response generated from Gemini"
- Check your API key is correct
- Verify your Google Cloud project has the Gemini API enabled
- Check the
/healthendpoint for connection status