Skip to content

CheenDing/pp2pp

Repository files navigation

🎓 PP2PP — 智能科研演示文稿生成系统

Version: v2.0
Architecture: Ctx2Skill Multi-Agent Self-Play Evolution + SurveyGO MCP Server Layer
Output: Native editable PowerPoint (.pptx)

📋 系统定位

PP2PP 是一个面向科研场景的智能 PPT 生成系统,采用 Ctx2Skill 多 Agent 自对弈进化架构,能够从学术论文自动生成高质量、原生可编辑的学术演示文稿。

双模式架构

模式 场景 输入 核心技术
场景 A 单篇论文 → 汇报 PPT PDF 文件 全文 Prompt + 图表精确提取 + 技能进化
场景 B 主题综述 → 演讲 PPT 研究主题关键词 Map-Reduce + 多论文综合 + 全局技能进化

🏗️ 三层架构

┌─────────────────────────────────────────────────────────────┐
│              Layer 3: Agent Evolution Layer                  │
│   SlideCraftsman / SlideReviewer / QualityJudge             │
│   StructureProposer / VisualGenerator / HistoricalBestReplay│
└────────────────────────┬────────────────────────────────────┘
                         │ MCP Protocol (JSON-RPC 2.0)
┌────────────────────────▼────────────────────────────────────┐
│              Layer 2: MCP Server Layer                       │
│   PDFParse / FigureExtract / ContentPlan / SlideGen         │
│   VisualEnhance / PaperRetrieve                             │
└────────────────────────┬────────────────────────────────────┘
                         │ External APIs
┌────────────────────────▼────────────────────────────────────┐
│              Layer 1: External Services                      │
│   MinerU/PyMuPDF / OpenAI API / arXiv / Semantic Scholar    │
└─────────────────────────────────────────────────────────────┘

🚀 快速开始

1. 环境准备

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

2. 配置环境变量

export OPENAI_API_KEY="sk-xxx"
export OPENAI_API_BASE="https://api.openai.com/v1"  # 如需代理

3. 运行方式

Gradio Web 界面

python -m src.web.app
# 打开 http://localhost:7860

命令行(场景 A)

python -m src.orchestrator.pipeline --scene A --input data/paper.pdf --output output/slides.pptx

VS Code 调试 直接按 F5,选择 🌐 Gradio Web App 或场景配置。

📁 项目结构

pp2pp/
├── .vscode/                    # VS Code 工作区配置
├── .github/workflows/          # GitHub Actions CI
├── prompts/                    # Agent 系统提示词
│   ├── slide_craftsman.txt
│   ├── slide_reviewer.txt
│   ├── quality_judge.txt
│   ├── structure_proposer.txt
│   ├── visual_generator.txt
│   └── historical_best_replay.txt
├── skills_library/             # 自然语言 Skill 文件
│   ├── structure/
│   ├── visual/
│   └── content/
├── docs/
│   ├── ARCHITECTURE.md         # v1 架构文档
│   └── v2/                     # v2 详细设计文档
│       ├── v2_agent_evolution.md
│       ├── v2_mcp_architecture.md
│       ├── v2_skill_design.md
│       └── ...
├── engines/
│   └── surveygo -> ../surveygo-v3/LLMxMapReduce
├── src/
│   ├── agents/                 # Layer 3: 进化 Agent
│   │   ├── base.py
│   │   ├── slide_craftsman.py
│   │   ├── slide_reviewer.py
│   │   ├── quality_judge.py
│   │   ├── structure_proposer.py
│   │   ├── visual_generator.py
│   │   └── historical_best_replay.py
│   ├── mcp_servers/            # Layer 2: MCP Server
│   │   ├── base.py
│   │   ├── pdf_parse_server.py
│   │   ├── figure_extract_server.py
│   │   ├── content_plan_server.py
│   │   ├── slide_gen_server.py
│   │   ├── visual_enhance_server.py
│   │   └── paper_retrieve_server.py
│   ├── orchestrator/           # 中央编排器
│   │   ├── pipeline.py         # 7步主流程
│   │   ├── state_manager.py    # 版本化状态管理
│   │   └── router.py           # 场景 A/B 路由
│   ├── skills/                 # Skill Library 管理
│   │   ├── library.py
│   │   └── evolution.py
│   ├── web/
│   │   └── app.py              # Gradio 前端
│   └── core/utils/
│       ├── config.py
│       └── llm_client.py       # 统一 LLM 客户端
├── tests/
├── requirements.txt
├── pyproject.toml
└── README.md

🧬 Agent 角色映射 (Ctx2Skill → PP2PP)

Ctx2Skill PP2PP Agent 职责
Reasoner SlideCraftsman 在技能指导下生成幻灯片规格
Challenger SlideReviewer 生成质量 rubrics,多维度评估
Judge QualityJudge 二值裁决(PASS/FAIL)
Proposer StructureProposer 分析结构失败,提出技能更新
Generator VisualGenerator 分析视觉失败,提出技能更新
Cross-time Replay HistoricalBestReplay 防对抗性崩溃,选择最优技能集

🛠️ MCP Server 对照

PPTGen Server SurveyGO 对应 核心职责
PDFParseServer 新增 PDF 文本提取、章节识别、元数据
FigureExtractServer 新增 图表精确提取、Caption 匹配、分类
ContentPlanServer Skeleton + Digest + Refine 大纲生成、7层卷积优化
SlideGenServer Writing Server python-pptx 模板渲染
VisualEnhanceServer 新增 外部配图、Mermaid 图、配色
PaperRetrieveServer Search + Group Server 论文检索、去重、聚类(场景 B)

🌿 GitHub 管理

# 已配置 remote
 git remote -v
# pp2pp  https://github.com/CheenDing/pp2pp.git (fetch)
# pp2pp  https://github.com/CheenDing/pp2pp.git (push)

# 推送最新代码
git push -u pp2pp main

分支策略

  • main:稳定版本,仅通过 PR 合并
  • dev:日常开发集成
  • feat/*:功能分支
  • fix/*:Bug 修复

📄 开源协议

MIT License

👥 团队

  • 丁晨
  • 叶锦澄
  • 伍助航

📚 参照工作

  • Si et al., "From Context to Skills: Can Language Models Learn from Context Skillfully?" (Ctx2Skill)
  • THUNLP / LLMxMapReduce — SurveyGO V3 MCP 架构
  • hugohe3 / ppt-master — SKILL.md 沉淀模式

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors