# adityaprakash-work/realtor-agent-main architecture

> Architecture diagram of the GitHub repository adityaprakash-work/realtor-agent-main, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adityaprakash-work/realtor-agent-main
- Repository: https://github.com/adityaprakash-work/realtor-agent-main

## Overview

Simplified High-Level Logic & Process Flow (for non-technical stakeholders)

##### User Interface
- Streamlit frontend or any API client where a user enters their search.
##### Prototype Server
- FastAPI service that receives requests and coordinates work.
##### Orchestrator & Agents
- Internal “brains” that decide which external service to call (e.g., Zillow search).
##### External Real-Estate APIs
- Third-party data sources (Unofficial Zillow API via RapidAPI).
##### AI Processing
- Optional enrichment via OpenAI / GoogleAI models.
##### Response Formatter
- Final step that packages results for display.

##### User → UI
User enters property search criteria (location, price range, etc.).
##### UI → Server
The UI sends a request to the Prototype Server’s chat/search endpoint.
##### Server → Orchestrator/Agents
The server’s orchestrator hands off the request to the appropriate agent (e.g., Zillow agent).
##### Agent → External API
The agent calls the real-estate API to fetch listings.
##### External API → Agent
Listings data returns to the agent.
##### Agent → AI Processing (if enabled)
The server may send raw listings through an AI model to refine recommendations or add commentary.
##### AI → Server
Enriched data comes back.
##### Server → Response Formatter
The server packages the data into a neat response format.
##### Server → UI
The formatted results are sent back to the UI and displayed to the user.

- Blue for UI
- Green for Server & Orchestrator
- Orange for External APIs
- Purple for AI Processing

This high-level flow captures the core steps without technical jargon, making it easy for business stakeholders to understand how user requests transform into real-estate search results.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User"] 
    UI["User Interface"]:::frontend
    Server["Prototype Server (FastAPI)"]:::server
    Orchestration["Orchestrator & Agents"]:::server
    External["External Real-Estate APIs"]:::external
    AI["AI Processing"]:::ai
    Formatter["Response Formatter"]:::server

    User -->|"enter search criteria"| UI
    UI -->|"send request to chat/search"| Server
    Server -->|"delegate request"| Orchestration
    Orchestration -->|"fetch listings"| External
    External -->|"return data"| Orchestration
    Orchestration -->|"optional enrichment"| AI
    AI -->|"return enriched data"| Server
    Server -->|"package response"| Formatter
    Formatter -->|"send formatted results"| UI

    click UI "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/scripts/streamlit_ptpserver_rapidapizillow.py"
    click UI "https://github.com/adityaprakash-work/realtor-agent-main/tree/main/fgai_ra_backend_clients/"
    click Server "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/fgai_ra_backend/app/main.py"
    click Server "https://github.com/adityaprakash-work/realtor-agent-main/tree/main/fgai_ra_backend/app/api/v1/"
    click Server "https://github.com/adityaprakash-work/realtor-agent-main/tree/main/fgai_ra_backend/app/core/"
    click Orchestration "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/src/fastguruai_realtor_agent/agents/orchestrator.py"
    click Orchestration "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/src/fastguruai_realtor_agent/agents/auto_task.py"
    click Orchestration "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/src/fastguruai_realtor_agent/agents/client_support.py"
    click Orchestration "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/src/fastguruai_realtor_agent/agents/crm.py"
    click External "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/src/fastguruai_realtor_agent/agents/rapidapi_zillow/search.py"
    click External "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/src/fastguruai_realtor_agent/agents/rapidapi_realtor/search.py"
    click AI "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/fgai_ra_backend/app/services/graphs/chat.py"
    click AI "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/fgai_ra_backend/app/services/manage_system_prompts.py"
    click Formatter "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/fgai_ra_backend/app/services/client_support.py"
    click Formatter "https://github.com/adityaprakash-work/realtor-agent-main/blob/main/fgai_ra_backend/app/schemas/graphs.py"

    classDef frontend fill:#BBDEFB,stroke:#000,stroke-width:1px
    classDef server fill:#C8E6C9,stroke:#000,stroke-width:1px
    classDef external fill:#FFE0B2,stroke:#000,stroke-width:1px
    classDef ai fill:#E1BEE7,stroke:#000,stroke-width:1px
```
