# anmolsanger/real_estate_ai-agent architecture

> Architecture diagram of the GitHub repository anmolsanger/real_estate_ai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anmolsanger/real_estate_ai-agent
- Repository: https://github.com/anmolsanger/real_estate_ai-agent

## Overview

EstateMind accepts a supported Indian market and property type, runs a multi-agent research and analysis workflow, then combines the analyst’s judgment with Python-verified financial metrics in a report. Users can initiate runs through the Streamlit UI, FastAPI, or CLI. The README documents these interfaces and the research/modeler/analyst stages; sampled source confirms the pipeline’s finance, persistence, and telemetry responsibilities. Some API and CLI details are represented only by the README and source index.

Main entry points: [`pipeline.py`](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/pipeline.py) (Analysis pipeline), [`app.py`](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/app.py) (Streamlit UI), [`api.py`](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/api.py) (FastAPI), [`storage.py`](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/storage.py) (Artifact storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_streamlit["Streamlit UI<br/>[app.py]"]
  node_api["FastAPI<br/>[api.py]"]
  node_cli["CLI<br/>[crew.py]"]
  node_locations["City validation<br/>[cities.py]"]
  node_mcp["MCP finance server<br/>[mcp_server.py]"]
end

subgraph group_orchestration["Analysis workflow"]
  node_schemas["Request and report models<br/>[schemas.py]"]
  node_pipeline["Analysis pipeline<br/>[pipeline.py]"]
end

subgraph group_agents["Research agents"]
  node_research["Property researcher<br/>[agents.py]"]
  node_modeler["Financial modeler<br/>[agents.py]"]
  node_analyst["Investment analyst<br/>[agents.py]"]
  node_tasks["Agent task prompts<br/>[tasks.py]"]
  node_search["Web search<br/>[tools.py]"]
end

subgraph group_finance["Financial modeling"]
  node_roi_tool["ROI calculator tool<br/>[tools.py]"]
  node_finance_engine["Deterministic finance<br/>[finance.py]"]
end

subgraph group_outputs["Reports and operations"]
  node_report["Verified report<br/>[pipeline.py]"]
  node_storage["Artifact storage<br/>[storage.py]"]
  node_telemetry["Run telemetry<br/>[telemetry.py]"]
end

node_user(("Investor"))
node_web(("Property listing sites"))
node_object_store[("S3-compatible storage")]
node_local_store[("Local artifacts")]

node_user -->|"submits analysis"| node_streamlit
node_user -->|"requests analysis"| node_api
node_user -->|"starts analysis"| node_cli
node_streamlit -->|"selects city"| node_locations
node_streamlit -->|"builds assumptions"| node_schemas
node_streamlit -->|"runs analysis"| node_pipeline
node_api -->|"validates request"| node_schemas
node_api -->|"runs analysis"| node_pipeline
node_api -->|"reports run data"| node_telemetry
node_cli -->|"runs analysis"| node_pipeline
node_pipeline -->|"creates agent"| node_research
node_pipeline -->|"creates agent"| node_modeler
node_pipeline -->|"creates agent"| node_analyst
node_pipeline -->|"creates tasks"| node_tasks
node_pipeline -->|"validates and scores"| node_finance_engine
node_pipeline -->|"builds result"| node_schemas
node_pipeline -->|"saves artifacts"| node_storage
node_pipeline -->|"records run"| node_telemetry
node_research -->|"uses search"| node_search
node_search -.->|"searches listings"| node_web
node_modeler -->|"calculates candidates"| node_roi_tool
node_roi_tool -->|"averages and calculates"| node_finance_engine
node_analyst -->|"writes judgment"| node_report
node_pipeline -->|"adds verified metrics"| node_report
node_storage -->|"uploads artifacts"| node_object_store
node_storage -->|"falls back to"| node_local_store
node_mcp -->|"exposes formulas"| node_finance_engine

click node_streamlit "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/app.py"
click node_api "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/api.py"
click node_cli "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/crew.py"
click node_locations "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/cities.py"
click node_schemas "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/schemas.py"
click node_pipeline "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/pipeline.py"
click node_research "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/agents.py"
click node_modeler "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/agents.py"
click node_analyst "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/agents.py"
click node_tasks "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/tasks.py"
click node_search "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/tools.py"
click node_roi_tool "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/tools.py"
click node_finance_engine "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/finance.py"
click node_report "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/pipeline.py"
click node_storage "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/storage.py"
click node_telemetry "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/telemetry.py"
click node_mcp "https://github.com/anmolsanger/real_estate_ai-agent/blob/main/mcp_server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_streamlit,node_api,node_cli,node_locations,node_mcp toneBlue
class node_schemas,node_pipeline,node_object_store,node_local_store toneAmber
class node_research,node_modeler,node_analyst,node_tasks,node_search toneMint
class node_roi_tool,node_finance_engine toneRose
class node_report,node_storage,node_telemetry,node_user,node_web toneIndigo
```

## Components

### User interfaces

- [Streamlit UI](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/app.py): `app.py`
- [FastAPI](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/api.py): `api.py`
- [CLI](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/crew.py): `crew.py`
- [City validation](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/cities.py): `cities.py`
- [MCP finance server](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/mcp_server.py): `mcp_server.py`

### Analysis workflow

- [Request and report models](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/schemas.py): `schemas.py`
- [Analysis pipeline](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/pipeline.py): `pipeline.py`

### Research agents

- [Property researcher](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/agents.py): `agents.py`
- [Financial modeler](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/agents.py): `agents.py`
- [Investment analyst](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/agents.py): `agents.py`
- [Agent task prompts](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/tasks.py): `tasks.py`
- [Web search](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/tools.py): `tools.py`

### Financial modeling

- [ROI calculator tool](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/tools.py): `tools.py`
- [Deterministic finance](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/finance.py): `finance.py`

### Reports and operations

- [Verified report](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/pipeline.py): `pipeline.py`
- [Artifact storage](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/storage.py): `storage.py`
- [Run telemetry](https://github.com/anmolsanger/real_estate_ai-agent/blob/main/telemetry.py): `telemetry.py`

### Other components

- **Investor**
- **Property listing sites**
- **S3-compatible storage**
- **Local artifacts**

## Connections

- Investor → Streamlit UI: submits analysis (evidence: `README.md`)
- Investor → FastAPI: requests analysis (evidence: `README.md`)
- Investor → CLI: starts analysis (evidence: `README.md`)
- Streamlit UI → City validation: selects city (evidence: `app.py`)
- Streamlit UI → Request and report models: builds assumptions (evidence: `app.py`)
- Streamlit UI → Analysis pipeline: runs analysis (evidence: `app.py`)
- FastAPI → Request and report models: validates request (evidence: `api.py`)
- FastAPI → Analysis pipeline: runs analysis (evidence: `api.py`)
- FastAPI → Run telemetry: reports run data (evidence: `api.py`)
- CLI → Analysis pipeline: runs analysis (evidence: `crew.py`)
- Analysis pipeline → Property researcher: creates agent (evidence: `pipeline.py`)
- Analysis pipeline → Financial modeler: creates agent (evidence: `pipeline.py`)
- Analysis pipeline → Investment analyst: creates agent (evidence: `pipeline.py`)
- Analysis pipeline → Agent task prompts: creates tasks (evidence: `pipeline.py`)
- Analysis pipeline → Deterministic finance: validates and scores (evidence: `pipeline.py`)
- Analysis pipeline → Request and report models: builds result (evidence: `pipeline.py`)
- Analysis pipeline → Artifact storage: saves artifacts (evidence: `pipeline.py`)
- Analysis pipeline → Run telemetry: records run (evidence: `pipeline.py`)
- Property researcher → Web search: uses search (evidence: `agents.py`)
- Web search → Property listing sites: searches listings
- Financial modeler → ROI calculator tool: calculates candidates (evidence: `agents.py`)
- ROI calculator tool → Deterministic finance: averages and calculates (evidence: `tools.py`)
- Investment analyst → Verified report: writes judgment (evidence: `README.md`)
- Analysis pipeline → Verified report: adds verified metrics (evidence: `pipeline.py`)
- Artifact storage → S3-compatible storage: uploads artifacts (evidence: `storage.py`)
- Artifact storage → Local artifacts: falls back to (evidence: `storage.py`)
- MCP finance server → Deterministic finance: exposes formulas (evidence: `mcp_server.py`)
