# shashwat-akhilesh-shukla/pitchpilot architecture

> Architecture diagram of the GitHub repository shashwat-akhilesh-shukla/pitchpilot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shashwat-akhilesh-shukla/pitchpilot
- Repository: https://github.com/shashwat-akhilesh-shukla/pitchpilot

## Overview

##### Project type and purpose
- PitchPilot is an open-source, multi-agent AI toolkit for end-to-end startup pitch deck creation.
- It orchestrates specialized agents (research, competitor analysis, pitch drafting, slide design, visuals), uses semantic memory, and exports PowerPoint presentations.

##### File structure
- Top-level modules:
– agents/ – Agent implementations and orchestrator
– memory/ – Qdrant-backed semantic memory
– prompts/ – LLM prompt templates per agent
– utils/ – Helper functions (context prioritization, reflection loops, PPTX exporting)
– custom_llm.py – LLM wrapper plugin
– config.py – Global settings (LLM model, memory, template list)
– main.py – Workflow entry point
– app.py – (Optional) Web/CLI front door
– templates/ – PowerPoint templates

##### README for insights
- Workflow stages: user input → research → competitor analysis → content drafting → reflection loops → slide design → visuals → PPTX export.
- External dependencies: Hugging Face LLMs, Qdrant, optional Perplexity API, Matplotlib, python-pptx.

##### Main components & interactions
a. User Interface Layer
– CLI or app.py takes startup info (founders, market, goals).
– main.py loads config and invokes Orchestrator.
b. Orchestrator
– Coordinates sequential execution of agents.
– Passes context and memory between agents.
c. Agents
– ResearchAgent: market research + memory queries
– CompetitorAnalysisAgent: side-by-side analysis
– PitchCreationAgent: slide-by-slide content generation
– SlideDesignAgent: layout, titles, and placement
– VisualGenerationAgent: charts (Matplotlib) & business visuals (image APIs)
d. Memory Layer
– QdrantMemory (memory/qdrant_memory.py): store/retrieve vector embeddings for context recall.
e. Prompt Layer
– Each agent uses its own prompts module to format LLM calls.
f. LLM Layer
– custom_llm.py abstracts interaction with Hugging Face models (configurable model & temperature).
g. Utility Layer
– context_prioritization, reflection_loops, memory_pruning, presentation_exporter.
h. Output Layer
– presentation_exporter writes final .pptx using python-pptx + templates/.

##### Architectural patterns & principles
- Modular Agent-based design: clear separation of concerns per task.
- Pipeline orchestration: linear workflow via Orchestrator.
- Plugin-style extensibility: custom_llm, prompts, templates.
- Semantic memory caching & pruning: decouples knowledge store from agents.
- Reflection loops: self-critique + iterative improvement.

##### Final checklist
– [ ] Components grouped and labeled
– [ ] Notation of external services & data stores
– [ ] Callouts for extension points

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface Layer"
        UIApp["app.py"]:::internal
        UIMain["main.py"]:::internal
    end

    subgraph "Core Engine"
        Config["config.py"]:::internal
        Orchestrator["Orchestrator"]:::internal
        CustomLLM["custom_llm.py"]:::internal
    end

    subgraph "Agent Layer"
        ResearchA["ResearchAgent"]:::internal
        CompetitorA["CompetitorAnalysisAgent"]:::internal
        PitchA["PitchCreationAgent"]:::internal
        SlideA["SlideDesignAgent"]:::internal
        VisualA["VisualGenerationAgent"]:::internal
    end

    subgraph "Prompt Layer"
        RP["research_prompts.py"]:::internal
        CP["competitor_analysis_prompts.py"]:::internal
        PP["pitch_creation_prompts.py"]:::internal
        SP["slide_design_prompts.py"]:::internal
    end

    subgraph "Utilities"
        Context["context_prioritization.py"]:::internal
        Reflect["reflection_loops.py"]:::internal
        Prune["memory_pruning.py"]:::internal
        Exporter["presentation_exporter.py"]:::internal
    end

    subgraph "Data Stores"
        Qdrant["Qdrant Vector Store"]:::db
        Templates["Templates"]:::document
    end

    subgraph "External Services"
        HuggingFace["Hugging Face API"]:::external
        Perplexity["Perplexity/Image API"]:::external
        Matplotlib["Matplotlib"]:::external
    end

    Output[".pptx Output"]:::document

    User["User"]:::external

    User --> UIApp
    User --> UIMain
    UIMain --> Config
    UIMain --> Orchestrator
    UIApp --> Orchestrator

    Config --> Orchestrator

    Orchestrator --> ResearchA
    Orchestrator --> CompetitorA
    Orchestrator --> PitchA
    Orchestrator --> SlideA
    Orchestrator --> VisualA

    ResearchA --> CustomLLM
    CompetitorA --> CustomLLM
    PitchA --> CustomLLM
    SlideA --> CustomLLM
    VisualA --> CustomLLM

    ResearchA --> RP
    CompetitorA --> CP
    PitchA --> PP
    SlideA --> SP

    CustomLLM --> HuggingFace

    VisualA --> Matplotlib
    VisualA --> Perplexity

    ResearchA <--> Qdrant
    CompetitorA <--> Qdrant
    PitchA <--> Qdrant
    SlideA <--> Qdrant
    VisualA <--> Qdrant

    PitchA --> Reflect
    Reflect --> PitchA

    Prune --> Qdrant

    Orchestrator --> Exporter
    Exporter --> Templates
    Exporter --> Output

    classDef internal fill:#cce5ff,stroke:#0366d6
    classDef db fill:#d4edda,stroke:#28a745
    classDef external fill:#fff3cd,stroke:#ffc107
    classDef document fill:#e2e3e5,stroke:#6c757d

    click UIApp "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/app.py"
    click UIMain "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/main.py"
    click Config "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/config.py"
    click CustomLLM "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/custom_llm.py"
    click Orchestrator "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/agents/orchestrator.py"
    click ResearchA "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/agents/research_agent.py"
    click CompetitorA "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/agents/competitor_analysis_agent.py"
    click PitchA "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/agents/pitch_creation_agent.py"
    click SlideA "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/agents/slide_design_agent.py"
    click VisualA "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/agents/visual_generation_agent.py"
    click RP "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/prompts/research_prompts.py"
    click CP "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/prompts/competitor_analysis_prompts.py"
    click PP "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/prompts/pitch_creation_prompts.py"
    click SP "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/prompts/slide_design_prompts.py"
    click Context "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/utils/context_prioritization.py"
    click Reflect "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/utils/reflection_loops.py"
    click Prune "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/utils/memory_pruning.py"
    click Exporter "https://github.com/shashwat-akhilesh-shukla/pitchpilot/blob/main/utils/presentation_exporter.py"
    click Templates "https://github.com/shashwat-akhilesh-shukla/pitchpilot/tree/main/templates/"
```
