SuitSenseAI is a cutting-edge conversational AI platform that revolutionizes real estate analytics. Users can ask questions in plain English and receive sophisticated insights, interactive visualizations, and professional reports about condominium markets.
- π€ Conversational Analytics - Ask questions in natural language, get intelligent answers
- π Dynamic Visualizations - Auto-generated charts, graphs, and interactive maps
- π AI-Generated Reports - Professional PDF reports created on-demand
- πΊοΈ Location Intelligence - Google Maps integration with proximity analysis
- π Market Analysis - Holding periods, sales volumes, and trend predictions
- π Secure Code Execution - Safe AI-generated Python code execution
- π¬ Memory-Aware - Maintains conversation context for complex analysis
"Which buildings has the highest sale in collins"
"can u put this into HTML Table"
"Can u please generate a graph of this for me to analyze"
"can u please add a third row with avergae median sale"
"can u also show me the closest school distance to each of this building"
"can u show me on map the nearby schools around this property"
"can u also add a new column with average holding period"
"provide me a pdf report of the whole table to download"
- Google Gemini 2.0 Flash Experimental - Latest multimodal LLM
- LangGraph ReAct Agent - Advanced reasoning and acting framework
- FAISS Vector Database - Semantic search capabilities
- Google Embeddings - High-quality text embeddings
- PostgreSQL - Production-grade database with geographic data
- LangChain SQL Toolkit - Intelligent database interactions
- Flask Web Framework - Lightweight and scalable web server
- Session Management - Conversation history and user tracking
- Google Maps JavaScript API - Interactive mapping
- Google Places API - Location search and discovery
- Google Directions API - Distance calculations
- Google Geocoding API - Address to coordinate conversion
- Chart.js - Dynamic chart generation
- ReportLab - PDF report creation
- Google Maps Advanced Markers - Custom map visualizations
- Markdown Processing - Rich text formatting
git clone https://github.com/sohailshk/suitsense-ai.git
cd suitsense-ai
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
-- From PostgreSQL shell (psql)
CREATE DATABASE suitsense_ai;
CREATE USER readonly_user WITH PASSWORD 'your_secure_password';
GRANT CONNECT ON DATABASE suitsense_ai TO readonly_user;
GRANT USAGE ON SCHEMA public TO readonly_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly_user;
Windows (PowerShell):
$env:GPLACES_API_KEY="your_google_places_api_key"
$env:GEMINI_API_KEY="your_gemini_api_key"
$env:FLASK_SECRET="your_flask_secret_key"
$env:PG_USER="readonly_user"
$env:PG_PASSWORD="your_secure_password"
$env:PG_PORT="5432"
$env:PG_DB="suitsense_ai"
macOS/Linux (Bash):
export GPLACES_API_KEY="your_google_places_api_key"
export GEMINI_API_KEY="your_gemini_api_key"
export FLASK_SECRET="your_flask_secret_key"
export PG_USER="readonly_user"
export PG_PASSWORD="your_secure_password"
export PG_PORT="5432"
export PG_DB="suitsense_ai"
psql -d suitsense_ai < sample_db.sql
pip install -r requirements.txt
python test_gemini.py
You should see all green checkmarks β
python server.py
Visit http://localhost:5000
and start asking questions! π
- Google Cloud Console: https://console.cloud.google.com/
- Enable APIs:
- Google Places API
- Google Maps JavaScript API
- Google Geocoding API
- Google Directions API
- Create API Key and restrict it to your domains
- Google AI Studio: https://aistudio.google.com/
- Get API Key for Gemini 2.0
- Set Usage Limits as needed
SuitSenseAI/
βββ π main.py # Core AI processing logic
βββ π server.py # Flask web application
βββ π οΈ tools.py # AI tools and integrations
βββ π prefix.py # AI system prompts and instructions
βββ π§ boilerplate.py # Code templates and snippets
βββ π§ͺ test_gemini.py # Integration testing
βββ ποΈ init_db.py # Database initialization
βββ π sample_db.sql # Sample real estate data
βββ π requirements.txt # Python dependencies
βββ π GEMINI_MIGRATION.md # Migration guide from OpenAI
βββ π templates/ # HTML templates
β βββ π index.html # Main web interface
βββ π static/ # Static assets
β βββ πΌοΈ images/ # Logo and images
β βββ π README.md # Static files documentation
βββ π __pycache__/ # Python cache files
User questions are processed by Google Gemini 2.0 Flash Experimental, which understands real estate terminology and context.
The AI agent autonomously selects appropriate tools:
- SQL queries for database analysis
- Google Maps for location services
- Vector search for semantic matching
- Code generation for reports
Based on the analysis, the system generates:
- Interactive charts using Chart.js
- Google Maps with custom markers
- Professional PDF reports
- Rich markdown responses
All AI-generated code is scanned for malicious patterns before execution, ensuring a secure environment.
Uses FAISS vector database with Google embeddings for intelligent property name and address matching.
- Holding Period Analysis: Calculate investment holding periods
- Market Segmentation: Analyze by unit type, building, or location
- Geographic Intelligence: Distance calculations and proximity analysis
- Trend Prediction: Historical analysis and forecasting
- Advanced Google Maps Integration: Custom markers and clustering
- School Proximity Analysis: Find nearby educational institutions
- Distance Calculations: Multi-point route optimization
- Boundary Visualization: Market area definitions
- PDF Creation: Executive-level reports with charts and analysis
- Custom Layouts: Professional formatting with ReportLab
- Data Visualization: Embedded charts and maps in reports
# Modify in main.py for custom database connections
POSTGRES_USER = os.getenv("PG_USER")
POSTGRES_PASSWORD = os.getenv("PG_PASSWORD")
POSTGRES_PORT = os.getenv("PG_PORT")
POSTGRES_DB = os.getenv("PG_DB")
# Modify in main.py for different Gemini models
llm = ChatGoogleGenerativeAI(
model="gemini-2.0-flash-exp", # or "gemini-pro", "gemini-2.0-flash"
temperature=0.1, # Adjust for creativity vs. consistency
)
# Modify in server.py for conversation history length
MAX_CONTEXT_LENGTH = 3 # Number of previous exchanges to remember
# Test database connection
python test_db.py
# Test Gemini integration
python test_gemini.py
# Test Google Places API
python sandbox.py
# Run with debug mode
export FLASK_ENV=development
python server.py
- Use environment variables for all sensitive configuration
- Set up proper database user permissions
- Configure CORS for your domain
- Use HTTPS for secure communication
- Set up monitoring and logging
# Example Dockerfile structure
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "server:app"]
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow PEP 8 style guidelines
- Add tests for new features
- Update documentation
- Ensure security best practices
This project is licensed under the MIT License - see the LICENSE file for details.
- Google AI for Gemini 2.0 and embeddings
- LangChain for the agent framework
- Google Maps Platform for location services
- PostgreSQL for robust data storage
- Open Source Community for amazing tools and libraries
- GitHub Issues: Report bugs or request features
- Documentation: Read the full docs
- Email: sohail@example.com
β Star this repository if you find it helpful!
π Fork it to contribute or customize for your needs
π’ Share with others who might benefit from AI-powered real estate analytics
Made with β€οΈ for the Real Estate & AI Community