From prompts to production investment platform.
Monday: 3 core prompts for deal analysis. Tuesday: automation code. Wednesday: team workflows. Thursday: complete system architecture. Multi-agent orchestration, ML pipelines, data engineering, and scaling from 100 deals/day to enterprise 10,000+ volume with compliance.
Key Assumptions
System Requirements
Functional
- Ingest property data from MLS, public records, APIs, and manual uploads
- Extract 50+ features: location metrics, financials, market trends, risk factors
- Generate investment memos with comps analysis, cash flow projections, and risk assessment
- Support multi-property portfolio analysis with correlation and diversification metrics
- Provide explainable AI outputs with source citations and confidence scores
- Enable human-in-the-loop review workflows with approval gates
- Track analysis history and model versioning for audit trails
Non-Functional (SLOs)
💰 Cost Targets: {"per_deal_analysis_usd":0.5,"per_user_monthly_usd":200,"infrastructure_monthly_startup_usd":800,"infrastructure_monthly_enterprise_usd":5000}
Agent Layer
planner
L4Decompose deal analysis into sub-tasks and orchestrate agent execution
🔧 task_decomposer, dependency_resolver, agent_router
⚡ Recovery: If task decomposition fails → use default template, If agent unavailable → mark task as pending, retry with backoff
data_ingestion
L2Fetch property data from MLS, public records, and 3rd-party APIs
🔧 mls_adapter, public_records_scraper, zillow_api, costar_api, data_validator
⚡ Recovery: If API timeout → retry 3x with exponential backoff, If data incomplete → flag for manual review, proceed with available data, If all sources fail → return error, do not proceed
analysis_executor
L3Run financial analysis: cash flow, ROI, cap rate, IRR projections
🔧 cash_flow_calculator, roi_calculator, cap_rate_calculator, irr_calculator, sensitivity_analyzer
⚡ Recovery: If calculation error → use conservative default assumptions, If missing data → impute with market averages, flag uncertainty
comp_agent
L3Find comparable properties using vector similarity search
🔧 vector_db_search, embedding_generator, comp_ranker
⚡ Recovery: If no comps found → expand search radius 2x, If vector DB unavailable → fallback to SQL-based search (slower)
risk_agent
L3Assess market, property, and financial risks with severity scoring
🔧 market_risk_analyzer, property_risk_analyzer, financial_risk_analyzer, risk_aggregator
⚡ Recovery: If risk model unavailable → use rule-based fallback, If data missing → flag as 'insufficient data' risk
memo_generator
L3Generate investment memo using LLM with structured template
🔧 llm_api (GPT-4/Claude), template_engine, citation_generator
⚡ Recovery: If LLM API down → queue for retry, return cached template, If hallucination detected → regenerate with stricter prompt
evaluator
L3Quality check: validate accuracy, completeness, and consistency
🔧 accuracy_checker, completeness_checker, consistency_checker, confidence_scorer
⚡ Recovery: If quality score < 0.7 → flag for human review, If critical issue found → block output, return error
guardrail
L4Compliance checks: PII redaction, policy violations, safety filters
🔧 pii_detector, pii_redactor, policy_checker, safety_filter
⚡ Recovery: If PII detected → redact and log, If policy violation → block output, alert admin
ML Layer
Feature Store
Update: Daily batch + real-time on-demand
- • location_walkability_score
- • neighborhood_crime_rate
- • school_district_rating
- • property_age_years
- • square_feet_per_dollar
- • days_on_market
- • price_per_sqft_vs_market
- • rental_yield_estimate
- • appreciation_rate_5yr
- • vacancy_rate_area
- • property_tax_rate
- • hoa_fees_monthly
- • renovation_cost_estimate
- • flood_zone_risk
- • earthquake_zone_risk
- • market_liquidity_score
- • comparable_sales_count_6mo
- • price_trend_12mo
- • employment_growth_rate_area
- • population_growth_rate_area
- • median_income_area
- • inventory_months_supply
- • absorption_rate
- • cap_rate_market_avg
- • cash_on_cash_return
- • debt_service_coverage_ratio
- • loan_to_value_ratio
- • internal_rate_of_return_5yr
- • net_operating_income
- • gross_rent_multiplier
- • price_to_rent_ratio
- • property_condition_score
- • energy_efficiency_rating
- • parking_spaces_count
- • lot_size_sqft
- • zoning_type
- • permits_issued_count_5yr
- • new_construction_nearby
- • transit_accessibility_score
- • retail_density_1mi
- • restaurant_density_1mi
- • hospital_distance_mi
- • airport_distance_mi
- • highway_access_distance_mi
- • waterfront_flag
- • view_quality_score
- • noise_level_estimate
- • air_quality_index
- • property_tax_trend_5yr
- • insurance_cost_estimate
Model Registry
Strategy: Semantic versioning with A/B testing for major updates
- • property_value_estimator
- • risk_classifier
- • comp_reranker
- • memo_generator
- • hallucination_detector
Observability Stack
Real-time monitoring, tracing & alerting
0 activeDeployment Variants
Startup Architecture
Fast to deploy, cost-efficient, scales to 100 competitors
Infrastructure
Risks & Mitigations
⚠️ LLM API cost explosion (10x spike in usage)
Medium✓ Mitigation: Set hard rate limits (1000 req/hour per user). Alert at 80% of budget. Use cheaper models (Gemini) for non-critical tasks. Cache aggressively (24hr TTL).
⚠️ Data source reliability (Zillow API changes, MLS feed goes down)
High✓ Mitigation: Multi-source redundancy (Zillow + Redfin + public records). Cache stale data (24hr). Graceful degradation (proceed with available data, flag uncertainty).
⚠️ Hallucination in high-stakes deal (LLM invents fake comp, user loses $100K)
Low✓ Mitigation: Multi-layer hallucination detection (5 layers). Human review for deals >$500K. Insurance policy for AI errors. Clear disclaimers ('AI-assisted, not financial advice').
⚠️ Compliance violation (PII leak, GDPR breach)
Low✓ Mitigation: Guardrail agent (100% coverage). PII redaction before LLM. Immutable audit logs. SOC2 Type II certification. Annual penetration testing.
⚠️ Model drift (market changes, model becomes stale)
High✓ Mitigation: Monitor feature distributions weekly. Retrain quarterly. A/B test new models. Shadow mode for validation. Automated rollback if quality drops.
⚠️ Vendor lock-in (OpenAI changes pricing, deprecates API)
Medium✓ Mitigation: Multi-LLM architecture (OpenAI + Anthropic + Gemini). Abstraction layer (easy to swap providers). Regularly test failover. Budget for migration.
⚠️ Scaling bottleneck (database can't handle 10K deals/day)
Medium✓ Mitigation: Load testing at 2x expected volume. Database sharding by org_id. Read replicas for analytics. Auto-scaling workers. Circuit breakers to prevent cascading failures.
Evolution Roadmap
Progressive transformation from MVP to scale
Phase 1: MVP (0-3 months)
Phase 2: Scale (3-6 months)
Phase 3: Enterprise (6-12 months)
Complete Systems Architecture
9-layer architecture from presentation to security
Presentation
3 components
API Gateway
4 components
Agent Layer
8 components
ML Layer
6 components
Integration
5 components
Data
5 components
External
4 components
Observability
5 components
Security
5 components
Request Flow - Single Deal Analysis
Automated data flow every hour
Data Flow - Deal Analysis Pipeline
From property address to investment memo in 5 seconds
Key Integrations
MLS (Multiple Listing Service)
Zillow API
CoStar API (Commercial)
Public Records (County Assessor)
Vector DB (Pinecone/Weaviate)
Security & Compliance
Failure Modes & Recovery
| Failure | Fallback | Impact | SLA |
|---|---|---|---|
| LLM API down (OpenAI outage) | Failover to Anthropic Claude API → If both down, queue requests for retry | Degraded: 5-10 min delay, not broken | 99.5% (tolerates 3.6 hours/month downtime) |
| Data source unavailable (Zillow API rate limit) | Use cached data (24hr stale) + flag as 'stale' → Proceed with available sources | Partial data, lower confidence score | 99.0% |
| Vector DB unavailable (Pinecone outage) | Fallback to SQL-based comp search (slower, less accurate) → Flag as 'degraded' | Slower comps (5s → 15s), lower similarity scores | 99.0% |
| Feature computation timeout | Use cached features (if available) → If not, use market averages + flag uncertainty | Lower accuracy, higher uncertainty | 99.5% |
| Quality score < 0.7 (low confidence) | Route to human review queue → Notify analyst → Block auto-publish | Manual review required (SLA: 4 hours) | 100% (safety first) |
| Guardrail detects PII in memo | Auto-redact PII → Log violation → Alert security team | Redacted output (e.g., 'Owner: [REDACTED]') | 100% (compliance critical) |
| Database write failure | Retry 3x → If fails, write to S3 (eventual consistency) → Background job syncs to DB | Analysis available but not searchable immediately | 99.9% |
RAG vs Fine-Tuning
Hallucination Detection
Evaluation Framework
Dataset Curation
Agentic RAG
Multi-Model Ensemble
Tech Stack Summary
2026 Randeep Bhatia. All Rights Reserved.
No part of this content may be reproduced, distributed, or transmitted in any form without prior written permission.