# boomeshks/ai-powered-intelligent-sales-infosys architecture

> Architecture diagram of the GitHub repository boomeshks/ai-powered-intelligent-sales-infosys, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/boomeshks/ai-powered-intelligent-sales-infosys
- Repository: https://github.com/boomeshks/ai-powered-intelligent-sales-infosys

## Overview

SalesGenie AI is a FastAPI lead-intelligence and sales-assistance backend. Users create and manage leads, then request company analysis, scoring, and generated outreach; each API route owns its own database reads/writes and service calls. The graph includes the model-based conversion probability capability and the recommendation-generation branch. Source excerpts show the route and service relationships; training and recommendation helper implementations were not sampled, so no unsupported links to them are asserted.

Main entry points: [`app/database.py`](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/database.py) (Database session and engine), [`app/main.py`](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/main.py) (FastAPI application), [`app/routers/scoring.py`](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/scoring.py) (Scoring routes), [`app/routers/analysis.py`](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/analysis.py) (Company analysis route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API workflows"]
  node_app["FastAPI application<br/>[main.py]"]
  node_leads["Lead management<br/>[leads.py]"]
  node_analysis_route["Company analysis route<br/>[analysis.py]"]
  node_outreach["Outreach routes<br/>[outreach.py]"]
  node_scoring_route["Scoring routes<br/>[scoring.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
end

subgraph group_ai["AI intelligence"]
  node_company_ai["Company analysis<br/>[ai_service.py]"]
  node_ai_core["Gemini response generation<br/>[ai_service.py]"]
  node_outreach_ai["Email and strategy generation<br/>[ai_service.py]"]
  node_recommendation["Recommendation helper<br/>[recommendation.py]"]
end

subgraph group_scoring["Lead scoring"]
  node_score_service["Score and priority calculation<br/>[scoring_service.py]"]
  node_conversion["Conversion probability model<br/>[predict.py]"]
  node_training["Model training<br/>[train_model.py]"]
  node_model_artifact["Trained model artifact"]
end

subgraph group_data["Persistence"]
  node_database_config["Database session and engine<br/>[database.py]"]
  node_entities["Lead and result entities<br/>[models.py]"]
  node_store[("SQL database")]
end

node_user(("API client"))
node_gemini{{"Google Gemini API"}}

node_user -->|"sends requests"| node_app
node_app -->|"registers routes"| node_leads
node_app -->|"registers routes"| node_analysis_route
node_app -->|"registers routes"| node_outreach
node_app -->|"registers routes"| node_scoring_route
node_app -->|"creates tables"| node_database_config
node_leads -->|"uses sessions"| node_database_config
node_analysis_route -->|"uses sessions"| node_database_config
node_outreach -->|"uses sessions"| node_database_config
node_scoring_route -->|"uses sessions"| node_database_config
node_database_config -->|"connects"| node_store
node_entities -->|"inherits base"| node_database_config
node_leads -->|"reads and writes"| node_entities
node_analysis_route -->|"reads and writes"| node_entities
node_outreach -->|"reads and writes"| node_entities
node_scoring_route -->|"reads and writes"| node_entities
node_analysis_route -->|"requests analysis"| node_company_ai
node_company_ai -->|"generates response"| node_ai_core
node_outreach -->|"requests generation"| node_outreach_ai
node_outreach_ai -.->|"calls model"| node_gemini
node_scoring_route -->|"calculates score"| node_score_service
node_scoring_route -->|"predicts probability"| node_conversion
node_score_service -.->|"loads model"| node_model_artifact
node_training -.->|"produces artifact"| node_model_artifact
node_schemas -.->|"validates payloads"| node_leads
node_schemas -.->|"shapes responses"| node_analysis_route
node_schemas -.->|"shapes requests"| node_outreach
node_schemas -.->|"shapes payloads"| node_scoring_route

click node_app "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/main.py"
click node_leads "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/leads.py"
click node_analysis_route "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/analysis.py"
click node_outreach "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/outreach.py"
click node_scoring_route "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/scoring.py"
click node_schemas "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/schemas.py"
click node_company_ai "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ai_service.py"
click node_ai_core "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ai_service.py"
click node_outreach_ai "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/services/ai_service.py"
click node_recommendation "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/services/recommendation.py"
click node_score_service "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/services/scoring_service.py"
click node_conversion "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ml/predict.py"
click node_training "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ml/train_model.py"
click node_model_artifact "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ml/conversion_model.joblib"
click node_database_config "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/database.py"
click node_entities "https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/models.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_app,node_leads,node_analysis_route,node_outreach,node_scoring_route,node_schemas,node_user toneBlue
class node_company_ai,node_ai_core,node_outreach_ai,node_recommendation toneAmber
class node_score_service,node_conversion,node_training,node_model_artifact,node_gemini toneMint
class node_database_config,node_entities,node_store toneRose
```

## Components

### API workflows

- [FastAPI application](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/main.py): `app/main.py`
- [Lead management](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/leads.py): `app/routers/leads.py`
- [Company analysis route](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/analysis.py): `app/routers/analysis.py`
- [Outreach routes](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/outreach.py): `app/routers/outreach.py`
- [Scoring routes](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/routers/scoring.py): `app/routers/scoring.py`
- [Request and response schemas](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/schemas.py): `app/schemas.py`

### AI intelligence

- [Company analysis](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ai_service.py): `app/ai_service.py`
- [Gemini response generation](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ai_service.py): `app/ai_service.py`
- [Email and strategy generation](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/services/ai_service.py): `app/services/ai_service.py`
- [Recommendation helper](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/services/recommendation.py): `app/services/recommendation.py`

### Lead scoring

- [Score and priority calculation](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/services/scoring_service.py): `app/services/scoring_service.py`
- [Conversion probability model](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ml/predict.py): `app/ml/predict.py`
- [Model training](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ml/train_model.py): `app/ml/train_model.py`
- [Trained model artifact](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/ml/conversion_model.joblib): `app/ml/conversion_model.joblib`

### Persistence

- [Database session and engine](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/database.py): `app/database.py`
- [Lead and result entities](https://github.com/boomeshks/ai-powered-intelligent-sales-infosys/blob/main/app/models.py): `app/models.py`
- **SQL database**

### Other components

- **API client**
- **Google Gemini API**

## Connections

- API client → FastAPI application: sends requests (evidence: `app/main.py`)
- FastAPI application → Lead management: registers routes (evidence: `app/main.py`)
- FastAPI application → Company analysis route: registers routes (evidence: `app/main.py`)
- FastAPI application → Outreach routes: registers routes (evidence: `app/main.py`)
- FastAPI application → Scoring routes: registers routes (evidence: `app/main.py`)
- FastAPI application → Database session and engine: creates tables (evidence: `app/main.py`)
- Lead management → Database session and engine: uses sessions (evidence: `app/routers/leads.py`)
- Company analysis route → Database session and engine: uses sessions (evidence: `app/routers/analysis.py`)
- Outreach routes → Database session and engine: uses sessions (evidence: `app/routers/outreach.py`)
- Scoring routes → Database session and engine: uses sessions (evidence: `app/routers/scoring.py`)
- Database session and engine → SQL database: connects (evidence: `app/database.py`)
- Lead and result entities → Database session and engine: inherits base (evidence: `app/models.py`)
- Lead management → Lead and result entities: reads and writes (evidence: `app/routers/leads.py`)
- Company analysis route → Lead and result entities: reads and writes (evidence: `app/routers/analysis.py`)
- Outreach routes → Lead and result entities: reads and writes (evidence: `app/routers/outreach.py`)
- Scoring routes → Lead and result entities: reads and writes (evidence: `app/routers/scoring.py`)
- Company analysis route → Company analysis: requests analysis (evidence: `app/routers/analysis.py`)
- Company analysis → Gemini response generation: generates response (evidence: `app/ai_service.py`)
- Outreach routes → Email and strategy generation: requests generation (evidence: `app/routers/outreach.py`)
- Email and strategy generation → Google Gemini API: calls model
- Scoring routes → Score and priority calculation: calculates score (evidence: `app/routers/scoring.py`)
- Scoring routes → Conversion probability model: predicts probability (evidence: `app/routers/scoring.py`)
- Score and priority calculation → Trained model artifact: loads model
- Model training → Trained model artifact: produces artifact
- Request and response schemas → Lead management: validates payloads (evidence: `app/routers/leads.py`)
- Request and response schemas → Company analysis route: shapes responses (evidence: `app/routers/analysis.py`)
- Request and response schemas → Outreach routes: shapes requests (evidence: `app/routers/outreach.py`)
- Request and response schemas → Scoring routes: shapes payloads (evidence: `app/routers/scoring.py`)
