# mdehghani86/appliedgenai architecture

> Architecture diagram of the GitHub repository mdehghani86/appliedgenai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mdehghani86/appliedgenai
- Repository: https://github.com/mdehghani86/appliedgenai

## Overview

##### Main Components
- Notebooks as Modules: Consider each Jupyter Notebook as a separate learning module or lab. Group them logically when possible. For example:
- ChatGPT_API_Tutorial.ipynb and CrewAI.ipynb could represent API integration and custom AI module examples.
- GenAI_BeerGame_V1_0.ipynb and Lab_7_HealthLLM.ipynb may illustrate domain-specific applications.
- The various LangChain_Lab*.ipynb files (including LangGraph_Tutorial_1.ipynb) focus on chaining language model operations.
- Underlying AI Infrastructure: Even though this is a lab collection, the notebooks interact with external AI models/APIs (e.g., OpenAI’s services). Represent the generative AI backends (ChatGPT/LLMs, LangChain framework) as core components.
- Execution Environment: Notebooks typically run in environments like Google Colab or Jupyter Notebook. Represent this as the “Interactive Notebook Environment.”
- External Dependencies: Include external APIs, libraries, or frameworks such as OpenAI’s API, any LangChain or LangGraph packages, and possibly other Python libraries for data handling.

##### Relationships and Interactions
- Each Notebook module serves as an entry point where users trigger experiments or demonstrations.
- From these modules, there is a clear data flow:
- The Notebook environment sends requests to the generative AI APIs.
- The AI backend processes the request and returns results.
- The notebooks then process these results for demonstration (e.g., displaying text, visualizations).

##### Architectural Patterns and Design Principles
- Modularity: Each notebook is self-contained and demonstrates focused concepts, which aligns with modular design.
- Layered Architecture: Although minimal, the flow can be seen as layered:
1. Presentation/Interaction layer (the notebook UI).
2. Application logic layer (coding examples and API calls within the notebooks).
3. External service layer (ChatGPT API, LangChain framework functions).
- Integration Points: Emphasize the clear use of external libraries and services (APIs), which is a key integration point in generative AI projects.

##### Relevant Technologies and Frameworks
- Jupyter Notebook / Google Colab as the interface.
- Python libraries and frameworks for generative AI.
- OpenAI’s API (for ChatGPT and related generative models).
- LangChain and potential LangGraph libraries to structure and chain AI tasks.

- “Flow of Data/Commands” – showing how a user’s action in one of the notebooks triggers a chain of events (API calls, model computations, result rendering).
- Notes indicating that these notebooks are primarily for educational/demonstrative purposes rather than production deployment.

## Diagram (Mermaid)

```mermaid
graph TD
    User["User"]:::external

    Week1_Intro["Interactive Notebook Environment: Week 1 - Intro to Colab"]:::env

    subgraph "Experimental Modules: API Integration & Custom AI Examples"
        ChatGPT_API["Notebook: ChatGPT_API_Tutorial"]:::notebook
        CrewAI["Notebook: CrewAI"]:::notebook
    end

    subgraph "Experimental Modules: Domain-Specific Applications"
        BeerGame["Notebook: GenAI_BeerGame_V1_0"]:::notebook
        HealthLLM["Notebook: Lab_7_HealthLLM"]:::notebook
    end

    subgraph "Experimental Modules: LangChain & LangGraph Labs"
        LangChain1["Notebook: LangChain_Lab1"]:::notebook
        LangChain2["Notebook: LangChain_Lab2"]:::notebook
        LangChain3["Notebook: LangChain_Lab3"]:::notebook
        LangChain4["Notebook: Langchain_Lab4"]:::notebook
        LangChain5["Notebook: LangChain_Lab5"]:::notebook
        LangGraph1["Notebook: LangGraph_Tutorial_1"]:::notebook
    end

    Documentation["Educational Documentation: README.md"]:::env

    OpenAI_API["OpenAI ChatGPT API"]:::external
    Framework["LangChain Framework & LangGraph"]:::framework

    User -->|"starts"| Week1_Intro

    Week1_Intro -->|"launches"| ChatGPT_API
    Week1_Intro -->|"launches"| CrewAI
    Week1_Intro -->|"launches"| BeerGame
    Week1_Intro -->|"launches"| HealthLLM
    Week1_Intro -->|"launches"| LangChain1
    Week1_Intro -->|"launches"| LangChain2
    Week1_Intro -->|"launches"| LangChain3
    Week1_Intro -->|"launches"| LangChain4
    Week1_Intro -->|"launches"| LangChain5
    Week1_Intro -->|"launches"| LangGraph1

    ChatGPT_API -->|"calls"| OpenAI_API
    CrewAI -->|"calls"| OpenAI_API
    BeerGame -->|"calls"| OpenAI_API
    HealthLLM -->|"calls"| OpenAI_API

    LangChain1 -->|"calls"| Framework
    LangChain2 -->|"calls"| Framework
    LangChain3 -->|"calls"| Framework
    LangChain4 -->|"calls"| Framework
    LangChain5 -->|"calls"| Framework
    LangGraph1 -->|"calls"| Framework

    Framework -->|"returns"| LangChain1
    Framework -->|"returns"| LangChain2
    Framework -->|"returns"| LangChain3
    Framework -->|"returns"| LangChain4
    Framework -->|"returns"| LangChain5
    Framework -->|"returns"| LangGraph1

    Documentation ---|"provides_info"| Week1_Intro

    click ChatGPT_API "https://github.com/mdehghani86/appliedgenai/blob/main/ChatGPT_API_Tutorial.ipynb"
    click CrewAI "https://github.com/mdehghani86/appliedgenai/blob/main/CrewAI.ipynb"
    click BeerGame "https://github.com/mdehghani86/appliedgenai/blob/main/GenAI_BeerGame_V1_0.ipynb"
    click HealthLLM "https://github.com/mdehghani86/appliedgenai/blob/main/Lab_7_HealthLLM.ipynb"
    click LangChain1 "https://github.com/mdehghani86/appliedgenai/blob/main/LangChain_Lab1.ipynb"
    click LangChain2 "https://github.com/mdehghani86/appliedgenai/blob/main/LangChain_Lab2.ipynb"
    click LangChain3 "https://github.com/mdehghani86/appliedgenai/blob/main/LangChain_Lab3.ipynb"
    click LangChain4 "https://github.com/mdehghani86/appliedgenai/blob/main/Langchain_Lab4.ipynb"
    click LangChain5 "https://github.com/mdehghani86/appliedgenai/blob/main/LangChain_Lab5.ipynb"
    click LangGraph1 "https://github.com/mdehghani86/appliedgenai/blob/main/LangGraph_Tutorial_1.ipynb"
    click Week1_Intro "https://github.com/mdehghani86/appliedgenai/blob/main/Week 1 - Intro to Colab.ipynb"
    click Documentation "https://github.com/mdehghani86/appliedgenai/blob/main/README.md"

classDef notebook fill:#bbf,stroke:#333,stroke-width:2px;
classDef external fill:#faa,stroke:#333,stroke-width:2px;
classDef framework fill:#afa,stroke:#333,stroke-width:2px;
classDef env fill:#ffb,stroke:#333,stroke-width:2px;
```
