# gyliu513/langx101 architecture

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

- Interactive diagram: https://gitdiagram.com/gyliu513/langx101
- Repository: https://github.com/gyliu513/langx101

## Overview

##### Project’s Main Components
- Core Testing & Demo Environment – The overall “langX101” concept is to run experiments and tests. Think of this as the central hub or framework.
- GenAI Integration Modules – There are many demonstration directories (e.g., langchain, openai, watsonx, langflow, litellm) that show various integrations with AI models or pipelines.
- Observability and Instrumentation Components – Directories like otel (and its various instrumentation integrations), newrelic, langfuse, and agent-semantic-convention indicate how the system is instrumented for telemetry (tracing, logging, metrics).
- External System Integrations – Modules under aws, graphql-example, my_flask_graphql_app, and mcp, as well as directories for several notebooks and API examples, point toward integrations with external systems/services (e.g., cloud services, databases, messaging layers).
- Utility Libraries and Wrappers – Components such as autowrapt, mylib, and promptlayer provide additional support or showcase how to wrap custom behavior around instrumentation and AI model calls.

##### Relationships and Interactions
- At the center, the GenAI demos (e.g., in langchain, openai, watsonx) represent the “business logic” where AI models are called and used.
- This core AI functionality flows into various observability tools. For example, the otel directory and its submodules show that instrumentation logic is embedded to capture telemetry data (traces, metrics, logs).
- Several containers/modules (like those under mcp or my_flask_graphql_app) act as client-server or API examples, communicating with external services. These illustrate how requests might be routed, processed, and their operations instrumented.
- The examples use notebooks and scripts (in directories such as crew, arize, and eval) to demonstrate how to test or evaluate GenAI performance and quality while tracking observability signals.
- Utility wrappers (like autowrapt) provide additional layers around core modules to instrument function calls or handle cross-cutting concerns.

##### Architectural Patterns and Design Principles
- Integration/Instrumentation “Side-Car” Approach: The observability components (e.g., otel, newrelic, langfuse) are layered “beside” the core GenAI operations, intercepting and tracking data flows.

##### Elements
- Interconnections: Some modules might serve as bridges (like autowrapt or mylib) and should be illustrated as links connecting core logic with observability or external service blocks.

##### Final Thought

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    T["Core Testing & Demo Environment"]:::core

    subgraph "GenAI Integration Modules"
        L1["Langchain"]:::genai
        O1["OpenAI"]:::genai
        W1["Watsonx"]:::genai
        LF["Langflow"]:::genai
        LL["LiteLLM"]:::genai
    end

    subgraph "Observability & Instrumentation"
        OT["OpenTelemetry"]:::observ
        NR["New Relic"]:::observ
        LFU["Langfuse"]:::observ
        AS["Agent Semantic Convention"]:::observ
    end

    subgraph "External Integrations"
        AWS["AWS"]:::external
        GQL["GraphQL Examples"]:::external
        FGA["Flask GraphQL App"]:::external
        MCP["MCP"]:::external
    end

    subgraph "Utility Libraries & Wrappers"
        AWrt["Autowrapt"]:::utility
        MYL["MyLib"]:::utility
        PL["Promptlayer"]:::utility
    end

    T -->|"triggers"| L1
    T -->|"triggers"| O1
    T -->|"triggers"| W1
    T -->|"triggers"| LF
    T -->|"triggers"| LL

    L1 -->|"telemetry"| OT
    O1 -->|"telemetry"| NR
    W1 -->|"telemetry"| LFU
    LF -->|"telemetry"| AS
    LL -->|"telemetry"| OT

    AWS -->|"API_req"| T
    GQL -->|"GraphQL"| T
    FGA -->|"API_call"| T
    MCP -->|"API_call"| T

    AWrt -->|"wraps"| L1
    MYL -->|"assists"| O1
    PL -->|"manages_prompts"| W1

    classDef core fill:#FCEABB,stroke:#333,stroke-width:2px;
    classDef genai fill:#D6EAF8,stroke:#333,stroke-width:2px;
    classDef observ fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef external fill:#A9DFBF,stroke:#333,stroke-width:2px;
    classDef utility fill:#F5B7B1,stroke:#333,stroke-width:2px;

    click T "https://github.com/gyliu513/langx101/blob/main/README.md"
    click L1 "https://github.com/gyliu513/langx101/tree/main//langchain"
    click O1 "https://github.com/gyliu513/langx101/tree/main//openai"
    click W1 "https://github.com/gyliu513/langx101/tree/main//watsonx"
    click LF "https://github.com/gyliu513/langx101/tree/main//langflow"
    click LL "https://github.com/gyliu513/langx101/tree/main//litellm"
    click OT "https://github.com/gyliu513/langx101/tree/main//otel"
    click NR "https://github.com/gyliu513/langx101/tree/main//newrelic"
    click LFU "https://github.com/gyliu513/langx101/tree/main//langfuse"
    click AS "https://github.com/gyliu513/langx101/tree/main//agent-semantic-convention"
    click AWS "https://github.com/gyliu513/langx101/tree/main//aws"
    click GQL "https://github.com/gyliu513/langx101/tree/main//graphql-example"
    click FGA "https://github.com/gyliu513/langx101/tree/main//my_flask_graphql_app"
    click MCP "https://github.com/gyliu513/langx101/tree/main//mcp"
    click AWrt "https://github.com/gyliu513/langx101/tree/main//autowrapt"
    click MYL "https://github.com/gyliu513/langx101/tree/main//mylib"
    click PL "https://github.com/gyliu513/langx101/tree/main//promptlayer"
```
