# rakesh000007/ai-business-assistant architecture

> Architecture diagram of the GitHub repository rakesh000007/ai-business-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakesh000007/ai-business-assistant
- Repository: https://github.com/rakesh000007/ai-business-assistant

## Overview

AI Business Assistant is a Flask real-estate CRM: business users manage properties and customers, while public visitors can chat or call to find properties and submit lead details. The principal path runs from AI routes through conversation/property handling to customer and lead records; authenticated dashboard routes support ongoing CRM work. The source excerpts establish app registration, selected route/model operations, and AI-to-Ollama calls. Other documented-by-name capabilities in the AI routes are retained, but their internal wiring is omitted where excerpts do not show it.

Main entry points: [`app/routes/ai.py`](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/ai.py) (AI chat and calls), [`app/__init__.py`](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/__init__.py) (Flask app setup), [`app/routes/lead.py`](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/lead.py) (Lead management), [`app/routes/public_business.py`](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/public_business.py) (Public business site)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and accounts"]
  node_app["Flask app setup<br/>[__init__.py]"]
  node_auth["Accounts and login<br/>[auth.py]"]
  node_public["Public business site<br/>[public_business.py]"]
end

subgraph group_crm["CRM operations"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_customer_routes["Customer management<br/>[customer.py]"]
  node_property_routes["Property management<br/>[property.py]"]
  node_lead_routes["Lead management<br/>[lead.py]"]
end

subgraph group_ai["AI engagement"]
  node_ai_routes["AI chat and calls<br/>[ai.py]"]
  node_conversation["Conversation controller"]
  node_ai_service["AI response service<br/>[ai_service.py]"]
  node_lead_analysis["Lead analysis and scoring<br/>[lead_analyzer.py]"]
  node_recommend["Property recommendations<br/>[recommendation.py]"]
  node_summary["Conversation summaries<br/>[summary.py]"]
  node_whisper["Audio transcription<br/>[whisper_service.py]"]
end

subgraph group_domain["Business records"]
  node_business_model[("Business information")]
  node_property_model[("Properties<br/>[property.py]")]
  node_customer_model[("Customers<br/>[customer.py]")]
  node_lead_model[("Leads<br/>[lead.py]")]
  node_support_models[("Conversation and requirements records")]
end

node_visitor(("Visitor"))
node_agent(("Business user"))
node_ollama["Ollama model service"]

node_app -->|"registers"| node_auth
node_app -->|"registers"| node_dashboard
node_app -->|"registers"| node_customer_routes
node_app -->|"registers"| node_property_routes
node_app -->|"registers"| node_lead_routes
node_app -->|"registers"| node_ai_routes
node_app -->|"registers"| node_public
node_agent -->|"signs in"| node_auth
node_agent -.->|"views CRM"| node_dashboard
node_agent -.->|"manages"| node_customer_routes
node_agent -.->|"manages"| node_property_routes
node_agent -.->|"manages"| node_lead_routes
node_visitor -.->|"visits"| node_public
node_visitor -.->|"chats or calls"| node_ai_routes
node_public -->|"reads business"| node_business_model
node_public -->|"reads listings"| node_property_model
node_dashboard -->|"queries"| node_customer_model
node_dashboard -->|"queries"| node_property_model
node_customer_routes -->|"manages"| node_customer_model
node_property_routes -->|"manages"| node_property_model
node_lead_routes -->|"manages"| node_lead_model
node_lead_routes -->|"checks customer"| node_customer_model
node_lead_routes -->|"requests summary"| node_summary
node_ai_routes -.->|"loads business"| node_business_model
node_ai_routes -.->|"searches listings"| node_property_model
node_ai_routes -.->|"creates or updates"| node_customer_model
node_ai_routes -.->|"creates leads"| node_lead_model
node_ai_routes -.->|"uses flow logic"| node_conversation
node_ai_routes -.->|"requests responses"| node_ai_service
node_ai_routes -.->|"analyzes leads"| node_lead_analysis
node_ai_routes -.->|"requests recommendations"| node_recommend
node_ai_routes -.->|"requests summaries"| node_summary
node_ai_routes -.->|"requests transcription"| node_whisper
node_ai_routes -.->|"uses conversation records"| node_support_models
node_ai_service -->|"generates text"| node_ollama
node_summary -->|"generates summary"| node_ollama

click node_app "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/__init__.py"
click node_auth "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/auth.py"
click node_public "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/public_business.py"
click node_dashboard "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/dashboard.py"
click node_customer_routes "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/customer.py"
click node_property_routes "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/property.py"
click node_lead_routes "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/lead.py"
click node_ai_routes "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/ai.py"
click node_conversation "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/conversation_controller.py"
click node_ai_service "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/ai_service.py"
click node_lead_analysis "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/lead_analyzer.py"
click node_recommend "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/recommendation.py"
click node_summary "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/summary.py"
click node_whisper "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/services/whisper_service.py"
click node_business_model "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/business_information.py"
click node_property_model "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/property.py"
click node_customer_model "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/customer.py"
click node_lead_model "https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/lead.py"
click node_support_models "https://github.com/rakesh000007/ai-business-assistant/tree/main/app/models"

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_app,node_auth,node_public,node_agent toneBlue
class node_dashboard,node_customer_routes,node_property_routes,node_lead_routes toneAmber
class node_ai_routes,node_conversation,node_ai_service,node_lead_analysis,node_recommend,node_summary,node_whisper toneMint
class node_business_model,node_property_model,node_customer_model,node_lead_model,node_support_models toneRose
class node_visitor,node_ollama toneIndigo
```

## Components

### Web entry and accounts

- [Flask app setup](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/__init__.py): `app/__init__.py`
- [Accounts and login](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/auth.py): `app/routes/auth.py`
- [Public business site](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/public_business.py): `app/routes/public_business.py`

### CRM operations

- [Dashboard](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/dashboard.py): `app/routes/dashboard.py`
- [Customer management](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/customer.py): `app/routes/customer.py`
- [Property management](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/property.py): `app/routes/property.py`
- [Lead management](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/lead.py): `app/routes/lead.py`

### AI engagement

- [AI chat and calls](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/routes/ai.py): `app/routes/ai.py`
- [Conversation controller](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/conversation_controller.py): `app/ai/conversation_controller.py`
- [AI response service](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/ai_service.py): `app/ai/ai_service.py`
- [Lead analysis and scoring](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/lead_analyzer.py): `app/ai/lead_analyzer.py`
- [Property recommendations](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/recommendation.py): `app/ai/recommendation.py`
- [Conversation summaries](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/ai/summary.py): `app/ai/summary.py`
- [Audio transcription](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/services/whisper_service.py): `app/services/whisper_service.py`

### Business records

- [Business information](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/business_information.py): `app/models/business_information.py`
- [Properties](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/property.py): `app/models/property.py`
- [Customers](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/customer.py): `app/models/customer.py`
- [Leads](https://github.com/rakesh000007/ai-business-assistant/blob/main/app/models/lead.py): `app/models/lead.py`
- [Conversation and requirements records](https://github.com/rakesh000007/ai-business-assistant/tree/main/app/models): `app/models`

### Other components

- **Visitor**
- **Business user**
- **Ollama model service**

## Connections

- Flask app setup → Accounts and login: registers (evidence: `app/__init__.py`)
- Flask app setup → Dashboard: registers (evidence: `app/__init__.py`)
- Flask app setup → Customer management: registers (evidence: `app/__init__.py`)
- Flask app setup → Property management: registers (evidence: `app/__init__.py`)
- Flask app setup → Lead management: registers (evidence: `app/__init__.py`)
- Flask app setup → AI chat and calls: registers (evidence: `app/__init__.py`)
- Flask app setup → Public business site: registers (evidence: `app/__init__.py`)
- Business user → Accounts and login: signs in (evidence: `app/routes/auth.py`)
- Business user → Dashboard: views CRM
- Business user → Customer management: manages
- Business user → Property management: manages
- Business user → Lead management: manages
- Visitor → Public business site: visits
- Visitor → AI chat and calls: chats or calls
- Public business site → Business information: reads business (evidence: `app/routes/public_business.py`)
- Public business site → Properties: reads listings (evidence: `app/routes/public_business.py`)
- Dashboard → Customers: queries (evidence: `app/routes/dashboard.py`)
- Dashboard → Properties: queries (evidence: `app/routes/dashboard.py`)
- Customer management → Customers: manages (evidence: `app/routes/customer.py`)
- Property management → Properties: manages (evidence: `app/routes/property.py`)
- Lead management → Leads: manages (evidence: `app/routes/lead.py`)
- Lead management → Customers: checks customer (evidence: `app/routes/lead.py`)
- Lead management → Conversation summaries: requests summary (evidence: `app/routes/lead.py`)
- AI chat and calls → Business information: loads business
- AI chat and calls → Properties: searches listings
- AI chat and calls → Customers: creates or updates
- AI chat and calls → Leads: creates leads
- AI chat and calls → Conversation controller: uses flow logic (evidence: `app/routes/ai.py`)
- AI chat and calls → AI response service: requests responses (evidence: `app/routes/ai.py`)
- AI chat and calls → Lead analysis and scoring: analyzes leads (evidence: `app/routes/ai.py`)
- AI chat and calls → Property recommendations: requests recommendations (evidence: `app/routes/ai.py`)
- AI chat and calls → Conversation summaries: requests summaries (evidence: `app/routes/ai.py`)
- AI chat and calls → Audio transcription: requests transcription (evidence: `app/routes/ai.py`)
- AI chat and calls → Conversation and requirements records: uses conversation records (evidence: `app/routes/ai.py`)
- AI response service → Ollama model service: generates text (evidence: `app/ai/ai_service.py`)
- Conversation summaries → Ollama model service: generates summary (evidence: `app/ai/summary.py`)
