# dedocrad/pptx-agent architecture

> Architecture diagram of the GitHub repository dedocrad/pptx-agent, 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/dedocrad/pptx-agent
- Repository: https://github.com/dedocrad/pptx-agent

## Overview

pptx-agent is a local-model research and PowerPoint-generation agent. Users can ask the ReAct agent to gather text and images, or use the deterministic topic-to-deck workflow; either can produce a .pptx when presentation creation is requested. The main stages are research, image discovery and validation, slide-spec creation, optional image resolution, and rendering. The README documents the product branches; source-index references support many internal links, but unsampled implementations mean some detailed call paths are not verified.

Main entry points: [`tools/langchain_tools.py`](https://github.com/dedocrad/pptx-agent/blob/main/tools/langchain_tools.py) (Tool registry), [`tools/image_search.py`](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_search.py) (Commons search), [`tools/image_quality.py`](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_quality.py) (Image evaluation), [`tools/image_resolver.py`](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_resolver.py) (Image resolver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent and tools"]
  node_react["ReAct agent<br/>[react.py]"]
  node_agent_model["Agent model adapter<br/>[llm.py]"]
  node_tool_registry["Tool registry<br/>[langchain_tools.py]"]
end

subgraph group_research["Research"]
  node_web_search["Web search<br/>[web_search.py]"]
  node_wiki["Wikipedia search<br/>[wiki.py]"]
  node_web_page["Page extraction<br/>[web_page.py]"]
  node_text_utils["Text utilities<br/>[text_utils.py]"]
  node_http["HTTP client<br/>[_http.py]"]
end

subgraph group_images["Image workflow"]
  node_image_search["Commons search<br/>[image_search.py]"]
  node_image_quality["Image evaluation<br/>[image_quality.py]"]
  node_image_resolver["Image resolver<br/>[image_resolver.py]"]
  node_image_types["Image data types<br/>[image_types.py]"]
  node_image_pipeline["Slide image resolution<br/>[resolve_images.py]"]
end

subgraph group_deck["Presentation generation"]
  node_generator["Deck content generator<br/>[generator.py]"]
  node_llm_client["LLM client<br/>[client.py]"]
  node_prompts["Generation prompts<br/>[prompts.py]"]
  node_spec["Presentation specification<br/>[spec.py]"]
  node_engine["PPTX renderer<br/>[engine.py]"]
  node_layouts["Slide layouts<br/>[layouts.py]"]
  node_theme["Presentation themes<br/>[theme.py]"]
end

node_user(("User"))
node_local_model{{"LM Studio"}}
node_commons{{"Wikimedia Commons"}}

node_user -->|"submits task"| node_react
node_react -->|"uses model"| node_agent_model
node_agent_model -->|"sends prompts"| node_local_model
node_react -->|"invokes tools"| node_tool_registry
node_tool_registry -->|"dispatches search"| node_web_search
node_tool_registry -->|"dispatches lookup"| node_wiki
node_tool_registry -->|"dispatches fetch"| node_web_page
node_web_search -->|"requests results"| node_http
node_wiki -->|"requests pages"| node_http
node_web_page -->|"fetches page"| node_http
node_web_search -->|"cleans snippets"| node_text_utils
node_wiki -->|"cleans text"| node_text_utils
node_web_page -->|"extracts text"| node_text_utils
node_tool_registry -->|"dispatches search"| node_image_search
node_tool_registry -->|"dispatches validation"| node_image_quality
node_tool_registry -->|"dispatches resolution"| node_image_resolver
node_image_search -->|"searches files"| node_commons
node_image_search -->|"requests metadata"| node_http
node_image_search -->|"creates candidates"| node_image_types
node_image_search -->|"normalizes query"| node_text_utils
node_image_resolver -->|"finds candidates"| node_image_search
node_image_resolver -->|"scores candidates"| node_image_quality
node_image_resolver -->|"uses image records"| node_image_types
node_image_quality -->|"requests model scoring"| node_llm_client
node_image_quality -->|"requests embeddings"| node_http
node_image_quality -->|"scores candidates"| node_image_types
node_image_quality -->|"uses text fallback"| node_text_utils
node_user -->|"requests deck"| node_tool_registry
node_tool_registry -->|"creates content"| node_generator
node_generator -->|"requests completion"| node_llm_client
node_generator -->|"uses prompts"| node_prompts
node_generator -->|"builds specification"| node_spec
node_tool_registry -->|"resolves slide images"| node_image_pipeline
node_image_pipeline -->|"selects image"| node_image_resolver
node_image_pipeline -->|"uses quick search"| node_image_search
node_image_pipeline -->|"updates slide fields"| node_spec
node_tool_registry -->|"validates deck input"| node_spec
node_tool_registry -->|"renders deck"| node_engine
node_engine -->|"reads slide data"| node_spec
node_engine -->|"dispatches layouts"| node_layouts
node_engine -->|"applies theme"| node_theme
node_layouts -->|"reads slide fields"| node_spec
node_layouts -->|"styles content"| node_theme
node_llm_client -->|"sends completions"| node_local_model

click node_react "https://github.com/dedocrad/pptx-agent/blob/main/agent/react.py"
click node_agent_model "https://github.com/dedocrad/pptx-agent/blob/main/agent/llm.py"
click node_tool_registry "https://github.com/dedocrad/pptx-agent/blob/main/tools/langchain_tools.py"
click node_web_search "https://github.com/dedocrad/pptx-agent/blob/main/tools/web_search.py"
click node_wiki "https://github.com/dedocrad/pptx-agent/blob/main/tools/wiki.py"
click node_web_page "https://github.com/dedocrad/pptx-agent/blob/main/tools/web_page.py"
click node_text_utils "https://github.com/dedocrad/pptx-agent/blob/main/tools/text_utils.py"
click node_http "https://github.com/dedocrad/pptx-agent/blob/main/tools/_http.py"
click node_image_search "https://github.com/dedocrad/pptx-agent/blob/main/tools/image_search.py"
click node_image_quality "https://github.com/dedocrad/pptx-agent/blob/main/tools/image_quality.py"
click node_image_resolver "https://github.com/dedocrad/pptx-agent/blob/main/tools/image_resolver.py"
click node_image_types "https://github.com/dedocrad/pptx-agent/blob/main/tools/image_types.py"
click node_image_pipeline "https://github.com/dedocrad/pptx-agent/blob/main/pipeline/resolve_images.py"
click node_generator "https://github.com/dedocrad/pptx-agent/blob/main/llm/generator.py"
click node_llm_client "https://github.com/dedocrad/pptx-agent/blob/main/llm/client.py"
click node_prompts "https://github.com/dedocrad/pptx-agent/blob/main/llm/prompts.py"
click node_spec "https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/spec.py"
click node_engine "https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/engine.py"
click node_layouts "https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/layouts.py"
click node_theme "https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/theme.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_react,node_agent_model,node_tool_registry,node_user toneBlue
class node_web_search,node_wiki,node_web_page,node_text_utils,node_http toneAmber
class node_image_search,node_image_quality,node_image_resolver,node_image_types,node_image_pipeline toneMint
class node_generator,node_llm_client,node_prompts,node_spec,node_engine,node_layouts,node_theme toneRose
class node_local_model,node_commons toneIndigo
```

## Components

### Agent and tools

- [ReAct agent](https://github.com/dedocrad/pptx-agent/blob/main/agent/react.py): `agent/react.py`
- [Agent model adapter](https://github.com/dedocrad/pptx-agent/blob/main/agent/llm.py): `agent/llm.py`
- [Tool registry](https://github.com/dedocrad/pptx-agent/blob/main/tools/langchain_tools.py): `tools/langchain_tools.py`

### Research

- [Web search](https://github.com/dedocrad/pptx-agent/blob/main/tools/web_search.py): `tools/web_search.py`
- [Wikipedia search](https://github.com/dedocrad/pptx-agent/blob/main/tools/wiki.py): `tools/wiki.py`
- [Page extraction](https://github.com/dedocrad/pptx-agent/blob/main/tools/web_page.py): `tools/web_page.py`
- [Text utilities](https://github.com/dedocrad/pptx-agent/blob/main/tools/text_utils.py): `tools/text_utils.py`
- [HTTP client](https://github.com/dedocrad/pptx-agent/blob/main/tools/_http.py): `tools/_http.py`

### Image workflow

- [Commons search](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_search.py): `tools/image_search.py`
- [Image evaluation](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_quality.py): `tools/image_quality.py`
- [Image resolver](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_resolver.py): `tools/image_resolver.py`
- [Image data types](https://github.com/dedocrad/pptx-agent/blob/main/tools/image_types.py): `tools/image_types.py`
- [Slide image resolution](https://github.com/dedocrad/pptx-agent/blob/main/pipeline/resolve_images.py): `pipeline/resolve_images.py`

### Presentation generation

- [Deck content generator](https://github.com/dedocrad/pptx-agent/blob/main/llm/generator.py): `llm/generator.py`
- [LLM client](https://github.com/dedocrad/pptx-agent/blob/main/llm/client.py): `llm/client.py`
- [Generation prompts](https://github.com/dedocrad/pptx-agent/blob/main/llm/prompts.py): `llm/prompts.py`
- [Presentation specification](https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/spec.py): `pptx_engine/spec.py`
- [PPTX renderer](https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/engine.py): `pptx_engine/engine.py`
- [Slide layouts](https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/layouts.py): `pptx_engine/layouts.py`
- [Presentation themes](https://github.com/dedocrad/pptx-agent/blob/main/pptx_engine/theme.py): `pptx_engine/theme.py`

### Other components

- **User**
- **LM Studio**
- **Wikimedia Commons**

## Connections

- User → ReAct agent: submits task (evidence: `README.md`)
- ReAct agent → Agent model adapter: uses model (evidence: `agent/react.py`)
- Agent model adapter → LM Studio: sends prompts (evidence: `agent/llm.py`)
- ReAct agent → Tool registry: invokes tools (evidence: `agent/react.py`)
- Tool registry → Web search: dispatches search (evidence: `tools/langchain_tools.py`)
- Tool registry → Wikipedia search: dispatches lookup (evidence: `tools/langchain_tools.py`)
- Tool registry → Page extraction: dispatches fetch (evidence: `tools/langchain_tools.py`)
- Web search → HTTP client: requests results (evidence: `tools/web_search.py`)
- Wikipedia search → HTTP client: requests pages (evidence: `tools/wiki.py`)
- Page extraction → HTTP client: fetches page (evidence: `tools/web_page.py`)
- Web search → Text utilities: cleans snippets (evidence: `tools/web_search.py`)
- Wikipedia search → Text utilities: cleans text (evidence: `tools/wiki.py`)
- Page extraction → Text utilities: extracts text (evidence: `tools/web_page.py`)
- Tool registry → Commons search: dispatches search (evidence: `tools/langchain_tools.py`)
- Tool registry → Image evaluation: dispatches validation (evidence: `tools/langchain_tools.py`)
- Tool registry → Image resolver: dispatches resolution (evidence: `tools/langchain_tools.py`)
- Commons search → Wikimedia Commons: searches files (evidence: `tools/image_search.py`)
- Commons search → HTTP client: requests metadata (evidence: `tools/image_search.py`)
- Commons search → Image data types: creates candidates (evidence: `tools/image_search.py`)
- Commons search → Text utilities: normalizes query (evidence: `tools/image_search.py`)
- Image resolver → Commons search: finds candidates (evidence: `tools/image_resolver.py`)
- Image resolver → Image evaluation: scores candidates (evidence: `tools/image_resolver.py`)
- Image resolver → Image data types: uses image records (evidence: `tools/image_resolver.py`)
- Image evaluation → LLM client: requests model scoring (evidence: `tools/image_quality.py`)
- Image evaluation → HTTP client: requests embeddings (evidence: `tools/image_quality.py`)
- Image evaluation → Image data types: scores candidates (evidence: `tools/image_quality.py`)
- Image evaluation → Text utilities: uses text fallback (evidence: `tools/image_quality.py`)
- User → Tool registry: requests deck (evidence: `README.md`)
- Tool registry → Deck content generator: creates content (evidence: `tools/langchain_tools.py`)
- Deck content generator → LLM client: requests completion (evidence: `llm/generator.py`)
- Deck content generator → Generation prompts: uses prompts (evidence: `llm/generator.py`)
- Deck content generator → Presentation specification: builds specification (evidence: `llm/generator.py`)
- Tool registry → Slide image resolution: resolves slide images (evidence: `tools/langchain_tools.py`)
- Slide image resolution → Image resolver: selects image (evidence: `pipeline/resolve_images.py`)
- Slide image resolution → Commons search: uses quick search (evidence: `pipeline/resolve_images.py`)
- Slide image resolution → Presentation specification: updates slide fields (evidence: `pipeline/resolve_images.py`)
- Tool registry → Presentation specification: validates deck input (evidence: `tools/langchain_tools.py`)
- Tool registry → PPTX renderer: renders deck (evidence: `tools/langchain_tools.py`)
- PPTX renderer → Presentation specification: reads slide data (evidence: `pptx_engine/engine.py`)
- PPTX renderer → Slide layouts: dispatches layouts (evidence: `pptx_engine/engine.py`)
- PPTX renderer → Presentation themes: applies theme (evidence: `pptx_engine/engine.py`)
- Slide layouts → Presentation specification: reads slide fields (evidence: `pptx_engine/layouts.py`)
- Slide layouts → Presentation themes: styles content (evidence: `pptx_engine/layouts.py`)
- LLM client → LM Studio: sends completions (evidence: `llm/client.py`)
