A production-ready multi-agent home buying application built using the Google Agent Development Kit (ADK) framework. This cloud-native application demonstrates advanced agent orchestration, intelligent property analysis, and modern web interfaces using Google Cloud services.
This application provides an intelligent home buying assistant that coordinates 5 specialized AI agents to help users find, analyze, and get personalized property recommendations. The system processes real estate data, performs semantic search, and provides comprehensive property analysis through a modern React web interface.
- π Intelligent Property Discovery: Vector-based semantic search using Vertex AI embeddings
- π€ Multi-Agent Analysis: 5 specialized agents providing comprehensive property evaluation
- π Real-time Data: Live BigQuery integration with property listings and neighborhood data
- π― Personalized Recommendations: User priority-based scoring with detailed explanations
- βοΈ Cloud-Native: Fully deployed on Google Cloud Run with auto-scaling and high availability
- π± Modern Interface: React-based responsive web application with Ant Design
- π Persistent History: Firestore-backed query tracking for analytics and debugging
- π Smart Filtering: Advanced criteria matching with fallback recommendations
React Frontend (Cloud Run) β API Gateway β Backend API (Cloud Run)
β
ADK Orchestrator β Specialized Agents
β
BigQuery (Properties) + Firestore (History) + Vertex AI (LLMs)
Agent Workflow:
User Request β
π Listing Discovery (Vector Search + Filtering) β
π Parallel Analysis:
ποΈ Neighborhood Analysis (Demographics, Schools)
β οΈ Risk Assessment (Natural disasters, Safety)
π° Affordability Calculation (DTI, Monthly costs)
β π― Personalized Recommendations (Priority-based scoring)
β π Ranked Results with AI-generated Explanations
c:\github\ADKAgent\
βββ agents/ # Specialized agent implementations
β βββ base_agent.py # Base agent class with ADK patterns
β βββ listing_review_agent.py # Vector search and property filtering
β βββ locality_review_agent.py # Neighborhood and school analysis
β βββ hazard_analysis_agent.py # Risk assessment and safety scoring
β βββ affordability_agent.py # Financial analysis and DTI calculations
β βββ recommendation_agent.py # Personalized scoring and ranking
β βββ agent_utils.py # Shared utilities (BigQuery, logging)
β βββ vector_search_utils.py # Vector embeddings and semantic search
βββ config/
β βββ settings.py # Production configuration management
β βββ cloud_run_settings.py # Cloud Run specific configurations
β βββ affordability_params.json # Financial calculation parameters
βββ frontend/ # Modern React web application
β βββ src/
β β βββ components/ # React components
β β β βββ SearchForm.js # Enhanced property search form
β β β βββ ProgressTracker.js # Real-time analysis progress
β β β βββ RecommendationResults.js # Beautiful results display
β β βββ services/
β β β βββ api.js # Backend API client
β β βββ App.js # Main React application with modern UI
β β βββ index.js # React entry point
β βββ public/ # Static assets and PWA configuration
β βββ package.json # Node.js dependencies
β βββ Dockerfile # Frontend container for Cloud Run
β βββ .dockerignore # Docker build optimization
βββ deploy/ # Production deployment configurations
β βββ deploy_cloud_run.sh # Linux/Mac Cloud Run deployment
β βββ deploy_cloud_run.ps1 # Windows PowerShell Cloud Run deployment
β βββ deployment_architecture.md # Cloud architecture documentation
βββ docs/ # Comprehensive documentation
β βββ deployment_checklist.md # Production deployment guide
β βββ api_documentation.md # API endpoint documentation
βββ orchestrator_adk.py # Production ADK orchestrator
βββ api_server.py # Flask API server with Cloud Run optimization
βββ query_history_cloud.py # Cloud-native query history (Firestore)
βββ main.py # CLI application entry point
βββ Dockerfile # Backend container for Cloud Run
βββ .dockerignore # Container build optimization
βββ requirements-production.txt # Minimal production dependencies
βββ .gitignore # Comprehensive security exclusions
βββ README.md # This documentation
The project includes a production-ready React frontend with professional UI/UX:
- π¨ Modern Design: Glass morphism effects with Ant Design components
- π Intelligent Search: Comprehensive form with financial criteria and user priorities
- π Real-time Progress: Visual tracking of AI agents working in parallel
- π Beautiful Results: Professional property cards with detailed analysis
- π± Responsive Design: Optimized for desktop, tablet, and mobile
- β‘ Performance Optimized: Code splitting, lazy loading, and PWA features
- βΏ Accessible: WCAG AA compliant design with proper contrast and navigation
React Frontend (Cloud Run) β Load Balancer β Flask API (Cloud Run)
β β β
Modern UI/UX β REST API β ADK Orchestrator
β β β
User Experience β JSON Responses β Multi-Agent Analysis
-
Prerequisites:
# Ensure you have the required tools node --version # v16+ required python --version # 3.8+ required gcloud --version # Latest Google Cloud SDK
-
Environment Setup:
# Clone and setup virtual environment git clone <repository-url> cd ADKAgent python -m venv venv venv\Scripts\activate # Windows # source venv/bin/activate # Linux/Mac # Install dependencies pip install -r requirements-production.txt
-
Configure Environment Variables:
# Copy template and update with your credentials cp .env.example .env # Edit .env with your Google Cloud project details
-
Start Development Servers:
# Terminal 1: Backend API python api_server.py # Terminal 2: Frontend Development Server cd frontend npm install npm start
-
Access Application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Health Check: http://localhost:8000/api/health
Deploy both frontend and backend to Google Cloud Run:
Windows PowerShell:
# Set your project ID
$env:GOOGLE_CLOUD_PROJECT = "your-project-id"
# Deploy to Cloud Run
.\deploy\deploy_cloud_run.ps1Linux/Mac Bash:
# Set your project ID
export GOOGLE_CLOUD_PROJECT="your-project-id"
# Deploy to Cloud Run
./deploy/deploy_cloud_run.shThe deployment script automatically:
- β Builds optimized containers for both frontend and backend
- β Configures environment variables for production
- β Sets up auto-scaling with cost optimization
- β Enables health checks and monitoring
- β Configures CORS for cross-origin requests
- β Provides deployment URLs for immediate access
# Required for Cloud Run deployment
GOOGLE_CLOUD_PROJECT=your-project-id
QUERY_HISTORY_BACKEND=firestore
BIGQUERY_PROJECT_ID=your-project-id
BIGQUERY_DATASET_ID=your-dataset-name
VERTEX_AI_PROJECT_ID=your-project-id- Semantic Understanding: Vertex AI text-embedding-004 with 768-dimensional embeddings
- Smart Discovery: Finds up to 15 relevant listings with intelligent filtering
- Real-time Processing: Sub-second similarity matching with BigQuery integration
- Criteria Matching: Combines semantic similarity with hard constraints (bedrooms, price, etc.)
- ADK Framework: Built on Google's official Agent Development Kit
- Parallel Processing: Concurrent analysis using
ParallelAgentpatterns - Specialized Intelligence: Domain-specific agents with focused expertise
- Fault Tolerance: Robust error handling and graceful degradation
- Advanced Calculations: Monthly payments, property taxes, insurance, HOA fees
- Affordability Assessment: Debt-to-income ratios with industry standards
- Market Intelligence: Property value evaluation and investment insights
- Scenario Analysis: Multiple financing option comparisons
- Multi-Hazard Analysis: Wildfire, flood, earthquake, and crime risk evaluation
- Official Data Sources: FEMA flood zones, USGS geological data
- Insurance Impact: Risk-based insurance cost estimates
- Safety Scoring: Neighborhood safety analysis with multiple data sources
- Personalized Scoring: User priority-based ranking algorithm
- Detailed Explanations: AI-generated summaries explaining recommendations
- Fallback Logic: Provides alternatives when no "perfect" matches exist
- Investment Analysis: Long-term value and market trend insights
The application includes production-ready query history using Firestore:
- Persistent Storage: All user queries stored in Firestore database
- Performance Analytics: Query response times and success rates
- User Behavior Insights: Search patterns and preference analysis
- Debugging Support: Detailed query logs for troubleshooting
- Scalable Architecture: Auto-scaling storage with Google Cloud
# View recent query history
GET /api/history
# Get query analytics
GET /api/history/analytics
# Search query history
GET /api/history/search?criteria=<search_terms>Key configuration in config/settings.py:
# AI Model Configuration
DEFAULT_AGENT_MODEL = "gemini-2.0-flash-001" # Latest Gemini model
ORCHESTRATOR_MODEL = "gemini-2.0-flash-001" # Optimized for coordination
# Search Optimization
VECTOR_SEARCH_LIMIT = 15 # Enhanced discovery
FINAL_RECOMMENDATION_COUNT = 3 # Focused results
# Cloud Run Optimization
REQUEST_TIMEOUT = 300 # Extended for AI processing
MAX_CONCURRENT_REQUESTS = 80 # High throughput# Development
QUERY_HISTORY_BACKEND = "local" # JSON file storage
# Production
QUERY_HISTORY_BACKEND = "firestore" # Cloud-native storage
# Testing
QUERY_HISTORY_BACKEND = "memory" # In-memory onlyThe system includes extensive testing:
# Run all tests
python -m pytest tests/
# Run specific test suites
python test_agents.py # Individual agent testing
python test_orchestrator.py # Workflow testing
python test_vector_search.py # Search functionality
python test_api_endpoints.py # API testingBefore deployment, run the validation suite:
# Validate Google Cloud connectivity
python validate_cloud_setup.py
# Test end-to-end workflow
python validate_production_ready.py
# Performance benchmarking
python benchmark_performance.py- Response Time: < 30 seconds for complete analysis
- Throughput: 80+ concurrent requests supported
- Availability: 99.9% uptime with Cloud Run auto-scaling
- Cost Optimization: Pay-per-request with automatic scaling to zero
- Container Optimization: Multi-stage Docker builds for minimal image size
- Memory Management: Efficient resource allocation (2GB RAM, 1 CPU)
- Caching Strategy: Intelligent caching of vector embeddings and BigQuery results
- Auto-Scaling: Scales from 0 to 10 instances based on demand
- Environment Isolation: Secure credential management with Cloud Run
- HTTPS Enforcement: All traffic encrypted with automatic SSL certificates
- CORS Configuration: Properly configured cross-origin resource sharing
- Input Validation: Comprehensive request validation and sanitization
- Error Handling: Secure error responses without sensitive information exposure
- Query Anonymization: Personal financial data not stored permanently
- Secure Transmission: All API calls encrypted in transit
- Access Controls: Cloud IAM integration for fine-grained permissions
- Audit Logging: Comprehensive request logging for security monitoring
Follow ADK patterns to extend the system:
from google.adk.agents import LlmAgent
from google.adk.tools import FunctionTool
# Create new agent following ADK patterns
new_agent = LlmAgent(
name="NewAnalysisAgent",
instructions="Analyze property for specific criteria...",
model_name=DEFAULT_AGENT_MODEL,
tools=[
FunctionTool(analyze_new_criteria, description="Analysis function")
],
input_schema=NewAgentInput,
output_key="new_analysis"
)# Add to parallel analysis workflow
parallel_analysis_agent = ParallelAgent(
name="ParallelAnalysisAgent",
sub_agents=[
locality_agent,
hazard_agent,
affordability_agent,
new_agent # Your new agent
]
)Add new endpoints following Flask patterns:
@app.route('/api/new-feature', methods=['POST'])
def new_feature():
"""New API endpoint with proper error handling"""
try:
# Implementation
return jsonify({"status": "success", "data": result})
except Exception as e:
logger.error(f"New feature error: {e}")
return jsonify({"error": "Processing failed"}), 500- Deployment Guide: Step-by-step production deployment
- Architecture Overview: System design and cloud architecture
- API Documentation: Complete API reference
- Agent Development Guide: Creating new agents
This application demonstrates advanced ADK patterns:
- Sequential Pipeline:
SequentialAgentfor workflow coordination - Parallel Fan-Out/Gather:
ParallelAgentfor concurrent analysis - Function Tools:
FunctionToolfor external system integration - Session Management: Shared state across agent interactions
- Error Handling: Robust exception management and recovery
Option 1: Local Development
git clone <repository>
cd ADKAgent
python -m venv venv && venv\Scripts\activate
pip install -r requirements-production.txt
cp .env.example .env # Update with your credentials
python api_server.pyOption 2: Cloud Run Deployment
export GOOGLE_CLOUD_PROJECT="your-project-id"
./deploy/deploy_cloud_run.shOption 3: Docker Development
docker-compose up --build- Configure Google Cloud: Set up BigQuery, Firestore, and Vertex AI
- Deploy Infrastructure: Use provided deployment scripts
- Customize Agents: Modify agent logic for your specific use case
- Extend Frontend: Add new UI components and features
- Monitor Performance: Set up Cloud Monitoring and alerting
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please see our Contributing Guide for details on:
- Code standards and ADK patterns
- Testing requirements
- Documentation guidelines
- Pull request process
- Google Agent Development Kit (ADK): Official framework powering the multi-agent architecture
- Google Cloud Platform: Infrastructure and AI services
- React & Ant Design: Modern frontend framework and components
- Open Source Community: Various libraries and tools that make this project possible
Project Status: β Production Ready | Last Updated: January 2025 | Version: 2.0.0
Built with β€οΈ using Google ADK framework for intelligent real estate analysis