# 1maazansari/rankpilot-ai architecture

> Architecture diagram of the GitHub repository 1maazansari/rankpilot-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/1maazansari/rankpilot-ai
- Repository: https://github.com/1maazansari/rankpilot-ai

## Overview

BrandVizi is an SEO/AEO website-audit platform: users submit a site for scanning, receive technical findings and a score, then get AI recommendations and audit results. Its principal backend flow is visible in the scan API; the README also documents multi-page audits, reports, and an AI copilot. The graph includes those distinct capabilities where the tree supports them, but several frontend-to-backend and multi-page routing details are unsampled, so those links are left unasserted or marked unverified.

Main entry points: [`backend/agents/graph.py`](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/graph.py) (Agent workflow), [`backend/api/scanner.py`](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/api/scanner.py) (Scan API), [`backend/ai/llm.py`](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/ai/llm.py) (Gemini integration), [`backend/services/audit_persistence_service.py`](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/audit_persistence_service.py) (Audit persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web app routes<br/>[index.tsx]"]
  node_scanroute["Audit results<br/>[analyze.tsx]"]
  node_copilot["AI copilot<br/>[ai-chat-panel.tsx]"]
end

subgraph group_audit["Audit pipeline"]
  node_scanapi["Scan API<br/>[scanner.py]"]
  node_scanner["Website scanner<br/>[scanner.py]"]
  node_seo["SEO evaluation<br/>[engine.py]"]
  node_score["SEO scoring<br/>[engine.py]"]
end

subgraph group_intelligence["AI intelligence"]
  node_agents["Agent workflow<br/>[graph.py]"]
  node_technical["Technical SEO agent<br/>[technical_seo.py]"]
  node_content["Content intelligence"]
  node_aeo["AEO/GEO agent<br/>[aeo_geo.py]"]
  node_validation["Finding validation<br/>[validation.py]"]
  node_recommend["Recommendation engine<br/>[engine.py]"]
  node_llm["Gemini integration<br/>[llm.py]"]
end

subgraph group_persistence["Audit data"]
  node_db[("SQLite database<br/>[session.py]")]
  node_audit_store["Audit persistence"]
  node_records[("Audit records<br/>[scan.py]")]
end

subgraph group_multi["Multi-page audit"]
  node_multi_service["Multi-page recommendations"]
  node_reports["SEO reports<br/>[report_service.py]"]
end

node_user(("Website owner"))
node_gemini{{"Google Gemini"}}

node_user -->|"submits site"| node_web
node_web -.->|"requests analysis"| node_scanroute
node_scanapi -->|"scans website"| node_scanner
node_scanapi -->|"evaluates scan"| node_seo
node_seo -->|"calculates score"| node_score
node_scanapi -->|"generates recommendations"| node_recommend
node_recommend -->|"requests generation"| node_llm
node_llm -->|"sends prompt"| node_gemini
node_scanapi -->|"runs workflow"| node_agents
node_agents -->|"dispatches"| node_technical
node_agents -->|"dispatches"| node_content
node_agents -->|"dispatches"| node_aeo
node_agents -->|"dispatches"| node_validation
node_user -->|"asks audit questions"| node_copilot
node_user -->|"requests multi-page audit"| node_multi_service
node_multi_service -->|"generates suggestions"| node_llm
node_user -->|"reviews results"| node_reports
node_audit_store -->|"persists audit data"| node_records
node_audit_store -.->|"uses database session"| node_db

click node_web "https://github.com/1maazansari/rankpilot-ai/blob/main/src/routes/index.tsx"
click node_scanroute "https://github.com/1maazansari/rankpilot-ai/blob/main/src/routes/analyze.tsx"
click node_copilot "https://github.com/1maazansari/rankpilot-ai/blob/main/src/components/ai-chat-panel.tsx"
click node_scanapi "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/api/scanner.py"
click node_scanner "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/scanner/scanner.py"
click node_seo "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/seo/engine.py"
click node_score "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/score/engine.py"
click node_agents "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/graph.py"
click node_technical "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/technical_seo.py"
click node_content "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/content_intelligence.py"
click node_aeo "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/aeo_geo.py"
click node_validation "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/validation.py"
click node_recommend "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/ai/engine.py"
click node_llm "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/ai/llm.py"
click node_multi_service "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/multi_page_recommendation_service.py"
click node_reports "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/report_service.py"
click node_db "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/database/session.py"
click node_audit_store "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/audit_persistence_service.py"
click node_records "https://github.com/1maazansari/rankpilot-ai/blob/main/backend/models/scan.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_web,node_scanroute,node_copilot toneBlue
class node_scanapi,node_scanner,node_seo,node_score toneAmber
class node_agents,node_technical,node_content,node_aeo,node_validation,node_recommend,node_llm toneMint
class node_db,node_audit_store,node_records toneRose
class node_multi_service,node_reports,node_user,node_gemini toneIndigo
```

## Components

### User experience

- [Web app routes](https://github.com/1maazansari/rankpilot-ai/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Audit results](https://github.com/1maazansari/rankpilot-ai/blob/main/src/routes/analyze.tsx): `src/routes/analyze.tsx`
- [AI copilot](https://github.com/1maazansari/rankpilot-ai/blob/main/src/components/ai-chat-panel.tsx): `src/components/ai-chat-panel.tsx`

### Audit pipeline

- [Scan API](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/api/scanner.py): `backend/api/scanner.py`
- [Website scanner](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/scanner/scanner.py): `backend/scanner/scanner.py`
- [SEO evaluation](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/seo/engine.py): `backend/seo/engine.py`
- [SEO scoring](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/score/engine.py): `backend/score/engine.py`

### AI intelligence

- [Agent workflow](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/graph.py): `backend/agents/graph.py`
- [Technical SEO agent](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/technical_seo.py): `backend/agents/technical_seo.py`
- [Content intelligence](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/content_intelligence.py): `backend/agents/content_intelligence.py`
- [AEO/GEO agent](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/aeo_geo.py): `backend/agents/aeo_geo.py`
- [Finding validation](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/agents/validation.py): `backend/agents/validation.py`
- [Recommendation engine](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/ai/engine.py): `backend/ai/engine.py`
- [Gemini integration](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/ai/llm.py): `backend/ai/llm.py`

### Audit data

- [SQLite database](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/database/session.py): `backend/database/session.py`
- [Audit persistence](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/audit_persistence_service.py): `backend/services/audit_persistence_service.py`
- [Audit records](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/models/scan.py): `backend/models/scan.py`

### Multi-page audit

- [Multi-page recommendations](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/multi_page_recommendation_service.py): `backend/services/multi_page_recommendation_service.py`
- [SEO reports](https://github.com/1maazansari/rankpilot-ai/blob/main/backend/services/report_service.py): `backend/services/report_service.py`

### Other components

- **Website owner**
- **Google Gemini**

## Connections

- Website owner → Web app routes: submits site (evidence: `README.md`)
- Web app routes → Audit results: requests analysis
- Scan API → Website scanner: scans website (evidence: `backend/api/scanner.py`)
- Scan API → SEO evaluation: evaluates scan (evidence: `backend/api/scanner.py`)
- SEO evaluation → SEO scoring: calculates score (evidence: `backend/seo/engine.py`)
- Scan API → Recommendation engine: generates recommendations (evidence: `backend/api/scanner.py`)
- Recommendation engine → Gemini integration: requests generation (evidence: `backend/ai/engine.py`)
- Gemini integration → Google Gemini: sends prompt (evidence: `backend/ai/llm.py`)
- Scan API → Agent workflow: runs workflow (evidence: `backend/api/scanner.py`)
- Agent workflow → Technical SEO agent: dispatches (evidence: `backend/agents/graph.py`)
- Agent workflow → Content intelligence: dispatches (evidence: `backend/agents/graph.py`)
- Agent workflow → AEO/GEO agent: dispatches (evidence: `backend/agents/graph.py`)
- Agent workflow → Finding validation: dispatches (evidence: `backend/agents/graph.py`)
- Website owner → AI copilot: asks audit questions (evidence: `README.md`)
- Website owner → Multi-page recommendations: requests multi-page audit (evidence: `README.md`)
- Multi-page recommendations → Gemini integration: generates suggestions (evidence: `backend/services/multi_page_recommendation_service.py`)
- Website owner → SEO reports: reviews results (evidence: `README.md`)
- Audit persistence → Audit records: persists audit data (evidence: `backend/services/audit_persistence_service.py`)
- Audit persistence → SQLite database: uses database session
