geo/docs/01-项目概览/architecture.md

122 lines
7.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 系统架构
## 整体架构
```
┌─────────────────────────────────────────────────────────────┐
│ 前端 (Next.js) │
├─────────────────────────────────────────────────────────────┤
│ Dashboard │ 诊断中心 │ 内容管理 │ 知识库 │ 监控面板 │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ API网关 (FastAPI) │
├─────────────────────────────────────────────────────────────┤
│ Auth │ Brands │ Diagnosis │ Content │ Knowledge │ Monitoring│
└─────────────────────────────────────────────────────────────┘
┌────────────────────┼────────────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ PostgreSQL │ │ Redis │ │ LLM Providers │
│ (数据存储) │ │ (缓存/队列) │ │ (AI服务) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
```
## 诊断架构
### SEO诊断
```
网站URL输入 → 爬虫抓取 → 技术分析 → 内容分析 → 外链分析 → 生成SEO诊断报告
```
**诊断维度:**
- 技术SEO索引、爬取、Core Web Vitals
- 页面SEOTitle/Meta、H标签、内链
- 内容质量E-E-A-T、新鲜度、重复内容
- 外链分析(质量、毒性、锚文本)
- 用户体验(移动适配、页面速度)
### GEO诊断
```
品牌信息输入 → 内容可提取性检测 → 实体清晰度检测 → E-E-A-T信号检测
→ Schema标记检测 → 主题权威检测 → AI平台引用检测 → 生成GEO诊断报告
```
**诊断维度:**
- 内容可提取性(直接回答块、问答式标题、列表表格)
- 实体清晰度(品牌定义、目标受众、差异化价值)
- E-E-A-T信号作者资质、专业认证、数据来源
- Schema标记Organization、Product、FAQPage等
- 主题权威(内容深度、话题覆盖度、实体信号一致性)
- 引用就绪度引用频率、引用质量、AI声量占比
## Agent Framework
```
┌─────────────────────────────────────────────────────────────┐
│ Agent Framework │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Dispatcher │→│ Registry │→│ Monitor │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Agents │ │
│ ├───────────┬───────────┬───────────┬────────────┤ │
│ │ Citation │ Content │ DeAI │ GEO │ │
│ │ Detector │ Generator │ Agent │ Optimizer │ │
│ └───────────┴───────────┴───────────┴────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Services │ │
│ ├───────────┬───────────┬───────────┬────────────┤ │
│ │ RuleValid │ SEOOptim │ Sensitive │ HTMLGen │ │
│ └───────────┴───────────┴───────────┴────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
**Agent职责说明**
| Agent | 职责 | 输入 | 输出 |
|-------|------|------|------|
| CitationDetector | 引用检测 | AI平台响应、品牌名称 | 引用检测结果 |
| ContentGenerator | 内容生成 | 主题、规则库、品牌素材 | GEO优化内容 |
| DeAIAgent | 去AI化 | AI生成内容 | 自然化内容 |
| GEOOptimizer | GEO优化 | 原始内容、关键词策略 | 优化后内容 |
**注意:** 当前项目中的`SEOOptimizer`实际执行的是GEO优化内容结构化、实体优化而非传统SEO优化技术SEO。建议在后续版本中明确区分
- **SEOOptimizer** → 技术SEO优化网站技术层面
- **GEOOptimizer** → 内容实体优化AI引用层面
## 内容生成Pipeline
```
用户输入 → 母题选择 → 内容生成 → 去AI化 → GEO优化 → HTML生成 → 输出
```
**注意:** 原Pipeline中的"SEO优化"实际是GEO优化内容结构化不是传统SEO优化。
## 知识库系统
```
文档上传 → 文本分块 → 向量化 → RAG检索 → LLM增强生成
```
## 监控体系
```
API请求 → Prometheus指标 → Grafana可视化
健康检查 → 告警通知
```
## 数据库设计
核心表users, organizations, brands, competitors, queries, citations, alerts, contents, knowledge_bases, knowledge_entities, knowledge_relations