# adamplatin123/open-deep-research-workflow-on-dify architecture

> Architecture diagram of the GitHub repository adamplatin123/open-deep-research-workflow-on-dify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adamplatin123/open-deep-research-workflow-on-dify
- Repository: https://github.com/adamplatin123/open-deep-research-workflow-on-dify

## Overview

##### Project type and purpose
- This is an AI‐driven research‐report pipeline implemented as a Dify workflow.
- Purpose: ingest a user query, break it into hierarchical topics, retrieve relevant content from local and online sources, orchestrate multiple LLMs in a cascaded/branched fashion, and emit a structured Markdown report.

##### File structure
- Top level contains:
- “Deep Researcher On Dify .yml” – the Dify workflow definition, listing nodes, data flows and conditional branches.
- “README.md” – describes core features, architecture and external dependencies.
- There is no monolithic codebase: the entire logic lives as modules (nodes) in the .yml file, orchestrated by the Dify engine.

##### README for insights
- Core components: Theme parsing, question generation, conditional user feedback loops, secondary topic extraction, hybrid retrieval engine, multi‐model generation, final report assembly.
- External systems: Local knowledge base, Wikipedia/Google/Bing APIs.
- Models: Gemini 2.0 Flash, deepseek-r1-distill (and placeholders for custom LLMs).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Orchestration
    UI["User Input\n(Dify Web UI/API)"]:::external
    Orchestrator["Orchestrator\n(Dify Workflow Engine)"]:::external
    UI -->|submit query| Orchestrator
    click Orchestrator "https://github.com/adamplatin123/open-deep-research-workflow-on-dify/blob/main/Deep Researcher On Dify .yml"

    %% Processing Pipeline
    ThemeParsing["Theme Parsing\n(Gemini 2.0 Flash)"]:::parsing
    QuestionGen["Question Generation\n(Configurable LLM)"]:::parsing
    SecondaryExtraction["Secondary Topic Extraction\n(Configurable LLM)"]:::parsing
    Orchestrator --> ThemeParsing --> QuestionGen --> UserFeedback

    %% User Feedback Branch
    UserFeedback{"Need User Feedback?"}:::decision
    UserFeedback -->|yes| UI
    UserFeedback -->|no| SecondaryExtraction

    %% Hybrid Retrieval Engine
    subgraph "Hybrid Retrieval Engine"
        direction TB
        LocalKB["Local Knowledge Base\n(FAISS Vector Store)"]:::retrieval
        ExternalAPIs["External Search APIs\n(Wikipedia, Google, Bing)"]:::external
    end
    SecondaryExtraction --> HybridRetrievalCall
    HybridRetrievalCall(("Parallel Retrieval")):::retrieval
    HybridRetrievalCall --> LocalKB
    HybridRetrievalCall --> ExternalAPIs

    %% Multi-Model Collaboration
    subgraph "Multi-Model Collaboration\n(2>1 Cascaded LLMs)"
        direction TB
        InitialDraft["Initial Draft Generation\n(Gemini 2.0 Flash)"]:::generation
        Refinement["Refinement Step\n(deepseek-r1-distill)"]:::generation
    end
    LocalKB --> InitialDraft
    ExternalAPIs --> InitialDraft
    InitialDraft --> Refinement

    %% Report Assembly and Output
    ReportAssembly["Report Assembly\n(Markdown Formatter)"]:::generation
    Output["Output Channel\n(Dify Export/File)"]:::external
    Refinement --> ReportAssembly --> Output

    %% Documentation Nodes
    WorkflowDiagram["Workflow Diagram\n(Human-readable Export)"]:::external
    README["Project README\n(Overview & Architecture)"]:::external
    click WorkflowDiagram "https://github.com/adamplatin123/open-deep-research-workflow-on-dify/blob/main/Deep Researcher On Dify - Powered by Dify.pdf"
    click README "https://github.com/adamplatin123/open-deep-research-workflow-on-dify/blob/main/README.md"

    %% Legend
    subgraph Legend
        direction LR
        P[Parsing Nodes]:::parsing
        R[Retrieval Nodes]:::retrieval
        G[Generation Nodes]:::generation
        D[Decision Node]:::decision
        E[External Services]:::external
    end

    %% Styles
    classDef parsing fill:#e0ffe0,stroke:#333
    classDef retrieval fill:#e0e0ff,stroke:#333
    classDef generation fill:#ffe0b3,stroke:#333
    classDef decision fill:#fff2cc,stroke:#333,shape:diamond
    classDef external fill:#d9d9d9,stroke:#333
```
