PPTAgent (DeepPresenter)

repository·main·Indexed 26 days ago

https://github.com/icip-cas/pptagent

An agentic framework for reflective PowerPoint generation that converts documents into presentations via an Analysis Phase and a Generation Phase. It includes PPTEval for assessing content, design, and coherence. The system supports deep research integration, autonomous asset creation, and complex PDF parsing using tools like Tavily and MinerU. It provides a CLI for onboarding and generation, as well as Docker Compose deployment options.

Tokens
12.7K
Snippets
16
Records
104
Agent score
89%

What's inside pptagent

  1. Overview of PPTAgent and PPTEval

    main

    PPTAgent is a system designed to automatically generate presentations from documents using a two-phase approach: an Analysis Phase that learns patterns from reference presentations, and a Generation Phase that creates structured outlines and visually cohesive slides.

    PPTEval is the accompanying evaluation framework that assesses the quality of generated presentations across three dimensions:

    • Content: Accuracy and relevance of the slides.
    • Design: Visual appeal and consistency.
    • Coherence: Logical flow of ideas.
  2. Install and use PPTAgent via CLI

    main

    The CLI is the fastest way for personal use or integrating with OpenClaw.

    Note: Windows is not supported; use WSL. On macOS, the CLI may automatically install dependencies like Homebrew, Node.js, Docker, poppler, Playwright, and llama.cpp. On Linux, you must prepare the environment manually.

    1. Install uv.
    2. Run the interactive onboarding wizard to configure the environment.
    3. Use pptagent generate to create presentations.
    # Install uv
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # First-time interactive setup
    uvx pptagent onboard
    
    # Generate a presentation
    uvx pptagent generate "Single Page with Title: Hello World" -o hello.pptx
    
    # Generate with attachments
    uvx pptagent generate "Q4 Report" \
      -f data.xlsx \
      -f charts.pdf \
      -p "10-12" \
      -o report.pptx
  3. Install PPTAgent

    main

    You can install PPTAgent via pip. For a full installation including all dependencies, use the [full] extra.

    To install from PyPI:

    pip install "pptagent[full]"

    To install locally in editable mode:

    pip install -e ".[full]"
    pip install "pptagent[full]"
  4. Deploy PPTAgent using Docker Compose

    main

    For a stable server environment, use Docker Compose. This will pull the public images for the host service and the sandbox, then start the host service. The web UI will be available at http://localhost:7861.

    # Pull the public images
    docker pull forceless/deeppresenter-sandbox
    docker pull forceless/deeppresenter-host
    docker tag forceless/deeppresenter-sandbox deeppresenter-sandbox
    docker tag forceless/deeppresenter-host deeppresenter-host
    
    # Start the host service
    docker compose up -d
  5. Design reference slides for optimal generation

    main

    To maximize the quality of generated slides, follow these design guidelines for your reference presentations:

    Textframe Styles

    Set all textframes to Shrink text on overflow to improve text content adaptability.

    Layout and Elements

    • Simple Layout: Aim for no more than 6 elements per slide.
    • Space Utilization: Leave sufficient white space for content flexibility.
    • Content Hierarchy: Group related content (like Table of Contents items) within the same slide element using bullets rather than separate elements.
    • Text Density: Aim for text to occupy approximately 60% of the element's space.

    Functional Layouts

    PPTAgent uses rule-based insertion for four layout types: Opening, Table of Contents, Section Header, and Ending. To ensure structural integrity, include at least an Opening Page and an Ending Page in your reference slides.

  6. Run PPTAgent using Docker

    main

    You can run PPTAgent using a pre-built Docker image. Ensure you forward ports 8088 and 9297 if using a remote server.

    docker pull forceless/pptagent:latest
    
    # mapping home directory to /root to allow caching of models
    docker run -dt --gpus all --ipc=host --name pptagent \
      -e OPENAI_API_KEY=$OPENAI_API_KEY \
      -e MINERU_API=$MINERU_API \
      -p 9297:9297 \
      -p 8088:8088 \
      -v $HOME:/root \
      forceless/pptagent

    To view the running details, check the logs:

    docker logs -f pptagent
    docker run -dt --gpus all --ipc=host --name pptagent \
      -e OPENAI_API_KEY=$OPENAI_API_KEY \
      -e MINERU_API=$MINERU_API \
      -p 9297:9297 \
      -p 8088:8088 \
      -v $HOME:/root \
      forceless/pptagent
  7. Build PPTAgent from source for development

    main

    Use this mode for full control over dependencies during development. This requires uv, playwright, npm, and docker.

    1. Install the package in editable mode.
    2. Install Playwright dependencies and browser.
    3. Install HTML-to-PPTX components.
    4. Download required models.
    5. Pull and tag the necessary Docker images.
    6. Start the application using python webui.py.
    uv pip install -e .
    playwright install-deps
    playwright install chromium
    npm install --prefix deeppresenter/html2pptx
    modelscope download forceless/fasttext-language-id
    
    docker pull forceless/deeppresenter-sandbox
    docker pull forceless/deeppresenter-host
    docker tag forceless/deeppresenter-sandbox deeppresenter-sandbox
    docker tag forceless/deeppresenter-host deeppresenter-host
    
    # Start the app
    python webui.py
  8. Run PPTAgent WebUI locally

    main

    To run the full WebUI, follow these steps:

    1. Initialize Models: Set the following environment variables:

      • OPENAI_API_KEY: Your API key
      • API_BASE: Your service provider endpoint
      • LANGUAGE_MODEL: The model name (e.g., openai/gpt-4.1)
      • VISION_MODEL: The vision model name
      • MINERU_API: The MinerU API endpoint (e.g., http://localhost:8000/file_parse)
    2. Run Backend:

      python pptagent_ui/backend.py
    3. Launch Frontend:

      cd pptagent_ui
      npm install
      npm run serve

    Note: The backend API endpoint is configured in pptagent_ui/vue.config.js.

  9. Run PPTAgent via MCP Server

    main

    PPTAgent supports the Model Context Protocol (MCP), allowing you to generate presentations via tools in Claude or Cursor.

    First, install the package and set the required environment variables:

    uv pip install pptagent
    export PPTAGENT_MODEL=openai/gpt-4.1
    export PPTAGENT_API_BASE=http://localhost:8000/v1
    export PPTAGENT_API_KEY=your_key
    uv run pptagent-mcp

    To use it in Claude or Cursor, add the following configuration to your MCP settings:

    {
      "mcpServers": {
        "pptagent": {
          "command": "uv",
          "args": [
            "run",
            "--with",
            "pptagent",
            "pptagent-mcp"
          ],
          "env": {
            "PPTAGENT_MODEL": "openai/gpt-4.1",
            "PPTAGENT_API_BASE": "http://localhost:8000/v1",
            "PPTAGENT_API_KEY": "your_key"
          }
        }
      }
    }

    Available MCP Tools:

    • list_templates: List all available PowerPoint templates
    • set_template: Select a PowerPoint template by name
    • create_slide: Create a slide with a given layout
    • write_slide: Write the slide elements for generating a PowerPoint slide
    • generate_slide: Generate a slide after setting layout and content
    • save_generated_slides: Save generated slides to a PowerPoint file
    {
      "mcpServers": {
        "pptagent": {
          "command": "uv",
          "args": [
            "run",
            "--with",
            "pptagent",
            "pptagent-mcp"
          ],
          "env": {
            "PPTAGENT_MODEL": "openai/gpt-4.1",
            "PPTAGENT_API_BASE": "http://localhost:8000/v1",
            "PPTAGENT_API_KEY": "your_key"
          }
        }
      }
    }
  10. Use the Desktop Commander MCP Server

    main

    The desktop-commander is a Model Context Protocol (MCP) server that provides tools for filesystem management, terminal command execution, process control, and configuration. It is designed to be used by LLM clients to interact with a local or containerized environment.

    Capabilities:

    • Tools: Extensive set of filesystem and terminal tools.
    • Resources: Currently returns an empty list.
    • Prompts: Currently returns an empty list.
    • Logging: Supports logging for console redirection.

    Important Path Guidance: Unless explicitly requested, always use absolute paths. Relative paths may fail depending on the current working directory, and tilde paths (~/...) may not work in all contexts.

  11. Configure PPTAgent services and offline mode

    main

    You can improve generation quality for research, PDF parsing, and visual assets by configuring optional services.

    • Tavily: Improves web search. Set TAVILY_API_KEY in deeppresenter/mcp.json.
    • MinerU: Improves PDF parsing. Set MINERU_API_KEY in deeppresenter/mcp.json or set MINERU_API_URL to a local deployment.
    • Text-to-image model: Configure t2i_model in deeppresenter/config.yaml.

    For a fully offline setup, deploy MinerU locally and set offline_mode: true in deeppresenter/config.yaml to disable network-dependent tools like web search.

  12. Onboard DeepPresenter

    main

    Run the onboard command to perform the first-time interactive setup. This process:

    • Checks for required dependencies (Docker, Playwright, NPM, Poppler).
    • Creates configuration files (config.yaml and mcp.json).
    • Allows you to configure LLM models (Research Agent, Design Agent, Long Context Model, Vision Model, and Text-to-Image Model).
    • Supports configuring local model services (via llama-server) or external APIs.
    • Configures MCP (Model Context Protocol) keys for web search (Tavily, SerpAPI) and PDF parsing (MinerU).

    If a configuration already exists, you will be prompted to reconfigure (with a backup of existing files) or reuse the current setup.

    deeppresenter onboard