Skip to content

Architecture overview

Two orchestrator DAGs (youtube_pipeline, tiktok_pipeline) trigger child DAGs in order. Children do the real work: API ingest into MongoDB, graph projection into Neo4j, then OpenAI/Azure analysis and embeddings.

flowchart TB
    subgraph orch [Pipeline orchestrators]
        YT[youtube_pipeline]
        TT[tiktok_pipeline]
    end
    subgraph ingest [Ingest]
        API[Platform APIs]
        Mongo[(MongoDB)]
    end
    subgraph graph [Graph]
        Neo[(Neo4j)]
    end
    subgraph ai [Analysis]
        LLM[OpenAI / Azure OpenAI]
    end
    YT --> API
    TT --> API
    API --> Mongo
    Mongo --> Neo
    Mongo --> LLM
    Neo --> LLM

Environment switch

AIRFLOW_ENV in .env selects which Airflow Connections (and Mongo database name) the helpers use.

Value Mongo connection Neo4j connection Mongo DB name
development mongo_default neo4j_default airflow_db
production mongo_prod neo4j_prod rbl

Platform API keys (YouTube, TikTok) are read from Airflow Variables, not from .env.

Runtime

Compose builds a custom image (Dockerfile) on top of Airflow 3.0.4. Core settings:

  • Executor: LocalExecutor (not Celery, despite comments in the upstream Compose template)
  • Metadata DB: PostgreSQL
  • Auth: FAB auth manager
  • Python path: /opt/airflow/dags, /opt/airflow/helpers

DAG files live in dags/. Shared ETL, callbacks, rate limits, and embedding tasks live in helpers/ so Airflow does not parse them as DAGs.

Downstream consumer

GraphRAG reads the same Neo4j graph (and can use Mongo as a knowledge base). Collection bugs show up as missing nodes or stale embeddings in chat, not as Airflow UI errors — check both when investigating data issues.

See diagrams for the exact child-DAG order per platform.