# musabumair687/xobalt-ai architecture

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

- Interactive diagram: https://gitdiagram.com/musabumair687/xobalt-ai
- Repository: https://github.com/musabumair687/xobalt-ai

## Overview

Xobalt AI is a sales-prospecting backend: API requests can discover and ingest leads, analyze company websites, score intent and fit, and generate personalized outreach. The Hunter workflow’s sampled path covers discovery through verification and database ingestion; website analysis runs as a background workflow and persists extracted evidence. Scoring and personalization are distinct product branches. Several routes and workflow implementations are indexed but not excerpted, so their internal links are shown only where the index or API excerpt supports them; unsampled integrations are omitted.

Main entry points: [`backend/app/agents/hunter/nodes.py`](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/hunter/nodes.py) (Hunter agent), [`backend/app/main.py`](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/api/website_intelligence.py`](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/website_intelligence.py) (Website API), [`backend/app/agents/website_intelligence/nodes.py`](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/website_intelligence/nodes.py) (Website analysis agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API and workflows"]
  node_app["FastAPI app<br/>[main.py]"]
  node_hunter_api["Hunter API<br/>[hunter.py]"]
  node_hunter_flow["Hunter workflow<br/>[hunter_workflow.py]"]
  node_website_api["Website API"]
  node_website_flow["Website workflow"]
  node_scoring_api["Scoring API<br/>[scoring.py]"]
  node_personal_api["Personalization API<br/>[personalization.py]"]
  node_personal_flow["Personalization workflow"]
end

subgraph group_prospect["Lead discovery"]
  node_hunter_agent["Hunter agent<br/>[nodes.py]"]
  node_discovery["Company discovery"]
  node_enrichment["Lead enrichment"]
  node_verification["Contact verification"]
  node_dedupe["Lead deduplication"]
  node_ingestion["Lead ingestion"]
end

subgraph group_insights["Company intelligence"]
  node_website_agent["Website analysis agent<br/>[nodes.py]"]
  node_page_discovery["Page discovery"]
  node_content_extract["Content extraction"]
  node_intelligence["Intelligence extraction"]
  node_web_store["Website records<br/>[website_service.py]"]
  node_scoring["Lead scoring<br/>[scoring_service.py]"]
  node_intent["Intent analysis<br/>[intent_service.py]"]
  node_personal_agent["Personalization agent<br/>[nodes.py]"]
  node_personal_service["Message generation"]
end

subgraph group_platform["Persistence"]
  node_database[("PostgreSQL models<br/>[lead.py]")]
  node_company_intel[("Company intelligence records")]
  node_session["Database session<br/>[session.py]"]
end

node_user(("API client"))

node_user -->|"sends requests"| node_app
node_app -->|"routes to"| node_hunter_api
node_app -->|"routes to"| node_website_api
node_app -->|"routes to"| node_scoring_api
node_app -->|"routes to"| node_personal_api
node_hunter_api -.->|"starts workflow"| node_hunter_flow
node_hunter_flow -->|"runs agent"| node_hunter_agent
node_hunter_agent -->|"discovers companies"| node_discovery
node_hunter_agent -->|"enriches leads"| node_enrichment
node_hunter_agent -->|"verifies contacts"| node_verification
node_hunter_agent -->|"deduplicates candidates"| node_dedupe
node_hunter_agent -->|"ingests results"| node_ingestion
node_ingestion -->|"writes lead records"| node_database
node_website_api -->|"resolves website"| node_web_store
node_website_api -->|"starts background task"| node_website_flow
node_website_flow -.->|"runs analysis"| node_website_agent
node_website_agent -->|"discovers pages"| node_page_discovery
node_website_agent -->|"extracts content"| node_content_extract
node_website_agent -->|"extracts insights"| node_intelligence
node_website_api -->|"saves pages and intelligence"| node_web_store
node_web_store -->|"persists intelligence"| node_company_intel
node_scoring_api -.->|"requests scoring"| node_scoring
node_scoring_api -.->|"requests intent analysis"| node_intent
node_personal_api -->|"starts workflow"| node_personal_flow
node_personal_flow -.->|"runs agent"| node_personal_agent
node_personal_agent -->|"generates message"| node_personal_service
node_session -->|"creates tables"| node_database

click node_app "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/main.py"
click node_hunter_api "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/hunter.py"
click node_hunter_flow "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/workflows/hunter_workflow.py"
click node_website_api "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/website_intelligence.py"
click node_website_flow "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/workflows/website_intelligence_workflow.py"
click node_scoring_api "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/scoring.py"
click node_personal_api "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/personalization.py"
click node_personal_flow "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/workflows/personalization_workflow.py"
click node_hunter_agent "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/hunter/nodes.py"
click node_discovery "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/discovery_service.py"
click node_enrichment "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/enrichment_service.py"
click node_verification "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/verification_service.py"
click node_dedupe "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/deduplication_service.py"
click node_ingestion "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/lead_ingestion_service.py"
click node_website_agent "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/website_intelligence/nodes.py"
click node_page_discovery "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/page_discovery_service.py"
click node_content_extract "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/content_extraction_service.py"
click node_intelligence "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/intelligence_service.py"
click node_web_store "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/website_service.py"
click node_scoring "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/scoring_service.py"
click node_intent "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/intent_service.py"
click node_personal_agent "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/personalization/nodes.py"
click node_personal_service "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/personalization_service.py"
click node_database "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/models/lead.py"
click node_company_intel "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/models/company_intelligence.py"
click node_session "https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/database/session.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_hunter_api,node_hunter_flow,node_website_api,node_website_flow,node_scoring_api,node_personal_api,node_personal_flow,node_user toneBlue
class node_hunter_agent,node_discovery,node_enrichment,node_verification,node_dedupe,node_ingestion toneAmber
class node_website_agent,node_page_discovery,node_content_extract,node_intelligence,node_web_store,node_scoring,node_intent,node_personal_agent,node_personal_service toneMint
class node_database,node_company_intel,node_session toneRose
```

## Components

### API and workflows

- [FastAPI app](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Hunter API](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/hunter.py): `backend/app/api/hunter.py`
- [Hunter workflow](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/workflows/hunter_workflow.py): `backend/app/workflows/hunter_workflow.py`
- [Website API](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/website_intelligence.py): `backend/app/api/website_intelligence.py`
- [Website workflow](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/workflows/website_intelligence_workflow.py): `backend/app/workflows/website_intelligence_workflow.py`
- [Scoring API](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/scoring.py): `backend/app/api/scoring.py`
- [Personalization API](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/api/personalization.py): `backend/app/api/personalization.py`
- [Personalization workflow](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/workflows/personalization_workflow.py): `backend/app/workflows/personalization_workflow.py`

### Lead discovery

- [Hunter agent](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/hunter/nodes.py): `backend/app/agents/hunter/nodes.py`
- [Company discovery](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/discovery_service.py): `backend/app/services/discovery_service.py`
- [Lead enrichment](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/enrichment_service.py): `backend/app/services/enrichment_service.py`
- [Contact verification](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/verification_service.py): `backend/app/services/verification_service.py`
- [Lead deduplication](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/deduplication_service.py): `backend/app/services/deduplication_service.py`
- [Lead ingestion](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/lead_ingestion_service.py): `backend/app/services/lead_ingestion_service.py`

### Company intelligence

- [Website analysis agent](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/website_intelligence/nodes.py): `backend/app/agents/website_intelligence/nodes.py`
- [Page discovery](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/page_discovery_service.py): `backend/app/services/page_discovery_service.py`
- [Content extraction](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/content_extraction_service.py): `backend/app/services/content_extraction_service.py`
- [Intelligence extraction](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/intelligence_service.py): `backend/app/services/intelligence_service.py`
- [Website records](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/website_service.py): `backend/app/services/website_service.py`
- [Lead scoring](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/scoring_service.py): `backend/app/services/scoring_service.py`
- [Intent analysis](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/intent_service.py): `backend/app/services/intent_service.py`
- [Personalization agent](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/agents/personalization/nodes.py): `backend/app/agents/personalization/nodes.py`
- [Message generation](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/services/personalization_service.py): `backend/app/services/personalization_service.py`

### Persistence

- [PostgreSQL models](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/models/lead.py): `backend/app/models/lead.py`
- [Company intelligence records](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/models/company_intelligence.py): `backend/app/models/company_intelligence.py`
- [Database session](https://github.com/musabumair687/xobalt-ai/blob/main/backend/app/database/session.py): `backend/app/database/session.py`

### Other components

- **API client**

## Connections

- API client → FastAPI app: sends requests
- FastAPI app → Hunter API: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Website API: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Scoring API: routes to (evidence: `backend/app/main.py`)
- FastAPI app → Personalization API: routes to (evidence: `backend/app/main.py`)
- Hunter API → Hunter workflow: starts workflow
- Hunter workflow → Hunter agent: runs agent (evidence: `backend/app/workflows/hunter_workflow.py`)
- Hunter agent → Company discovery: discovers companies (evidence: `backend/app/agents/hunter/nodes.py`)
- Hunter agent → Lead enrichment: enriches leads (evidence: `backend/app/agents/hunter/nodes.py`)
- Hunter agent → Contact verification: verifies contacts (evidence: `backend/app/agents/hunter/nodes.py`)
- Hunter agent → Lead deduplication: deduplicates candidates (evidence: `backend/app/agents/hunter/nodes.py`)
- Hunter agent → Lead ingestion: ingests results (evidence: `backend/app/agents/hunter/nodes.py`)
- Lead ingestion → PostgreSQL models: writes lead records (evidence: `backend/app/services/lead_ingestion_service.py`)
- Website API → Website records: resolves website (evidence: `backend/app/api/website_intelligence.py`)
- Website API → Website workflow: starts background task (evidence: `backend/app/api/website_intelligence.py`)
- Website workflow → Website analysis agent: runs analysis
- Website analysis agent → Page discovery: discovers pages (evidence: `backend/app/agents/website_intelligence/nodes.py`)
- Website analysis agent → Content extraction: extracts content (evidence: `backend/app/agents/website_intelligence/nodes.py`)
- Website analysis agent → Intelligence extraction: extracts insights (evidence: `backend/app/agents/website_intelligence/nodes.py`)
- Website API → Website records: saves pages and intelligence (evidence: `backend/app/api/website_intelligence.py`)
- Website records → Company intelligence records: persists intelligence (evidence: `backend/app/services/website_service.py`)
- Scoring API → Lead scoring: requests scoring
- Scoring API → Intent analysis: requests intent analysis
- Personalization API → Personalization workflow: starts workflow (evidence: `backend/app/api/personalization.py`)
- Personalization workflow → Personalization agent: runs agent
- Personalization agent → Message generation: generates message (evidence: `backend/app/agents/personalization/nodes.py`)
- Database session → PostgreSQL models: creates tables (evidence: `backend/app/database/session.py`)
