# techloset/agentic-ai architecture

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

- Interactive diagram: https://gitdiagram.com/techloset/agentic-ai
- Repository: https://github.com/techloset/agentic-ai

## Overview

##### Project Type and Purpose
- This repository is a monorepo for a “Cloud-Native Applied AI Agentic Developer” training course.
- It is not a single product but a collection of progressively organized modules and example code covering:
– Python foundations
– AI theory
– FastAPI back-ends
– Database integrations
– Data preprocessing
– Model development
– LLM and prompt engineering
– Agent frameworks (OpenAI Agent SDK, LangChain, LangGraph, CrewAI)
– Deployment (Docker, devcontainer)
– A Next.js front-end scaffold

##### File Structure
- Top-level directories represent logical layers or modules in the course pipeline:
– 01_python: basic Python scripts & readme
– 02_ai_theory: theory notes (Markdown)
– 03_fastapi: FastAPI demos (hello, routing, middleware, file handling, exceptions) and a “folder_standard” scaffold with routes/controllers/utils
– 04_databases: examples with MongoDB and Postgres (SQLAlchemy/Alembic migrations, controllers, models, routes, utils, validations)
– 05_data_preprocessing: NumPy, Pandas, OpenCV, NLTK scripts and sample CSVs
– 06_model_development: model training (MNIST, cat/dog), prediction scripts, FastAPI prediction endpoint
– 07_llm_and_prompt_engineering: basic LLM calls, settings, prompting techniques
– 08_openai-agent-sdk: an SDK plus example agents, tools, streaming, contexts, guardrails, orchestration
– 09_langchain: LangChain chains, memory, tools, RAG examples
– 09a_langgraph: LangGraph agent examples, FastAPI integration, memory backends, WebSocket agents
– 10_crewai: CrewAI flow examples, knowledge agents
– 11_deployment: Dockerfile
– 12_frontend: Next.js boilerplate
– assignments, data, books, main.py, pyproject.toml

##### Readme Insights
- Explains using Poetry for dependency management and virtual environments
- Shows how to run Python scripts and serve FastAPI apps with Uvicorn
- Contains a “Course Outline” flowchart:
Python → AI Theory → FastAPI → Databases → Third-party libraries → Model Dev → LLMs → LangChain → LangGraph → CrewAI → Cloud/DevOps → Frontend

a. Developer Environment
- Poetry / pyproject.toml
- .devcontainer (VS Code Development Container)
b. Core Language Layer
- 01_python
- 02_ai_theory (documentation)
c. API Layer (Backend Services)
- 03_fastapi (folder_standard app)
- 06_model_development/fastapi_prediction_model.py
d. Data Layer
- 04_databases/Postgres (SQLAlchemy + Alembic)
- 04_databases/MongoDB
e. Data Pipeline
- 05_data_preprocessing (NumPy, Pandas, OpenCV, NLTK)
f. ML Model Layer
- 06_model_development (training & prediction artifacts)
g. LLM & Prompt Layer
- 07_llm_and_prompt_engineering
- External LLM APIs (OpenAI, Gemini)
h. Agent Frameworks (Orchestrator Layer)
- 08_openai-agent-sdk
- 09_langchain
- 09a_langgraph
- 10_crewai
i. Front-End Layer
- 12_frontend (Next.js scaffolding)
j. Deployment & DevOps
- 11_deployment/Dockerfile
- uv.lock, .env.example, Docker, Kubernetes (implied)

##### Relationships and Interactions
- Frontend ↔ API Layer (HTTP/REST via Uvicorn)
- API Layer ↔ Data Layer (ORM calls to Postgres, drivers to MongoDB)
- API Layer ↔ Data Pipeline (invokes preprocessing scripts)
- API Layer ↔ ML Model Layer (loads model artifacts for inference)
- API Layer ↔ LLM & Prompt Layer (calls external OpenAI/Gemini endpoints)
- Agent Frameworks orchestrate calls across API, Data, Models, LLMs
- Deployment containerizes API, Agent services, and Frontend

##### Architectural Patterns & Principles
- Modular monorepo with clearly separated concerns
- Layered architecture (presentation, API, data, model, orchestration)
- Use of standardized FastAPI code scaffolding (routes/controllers/utils)
- Database migrations via Alembic (schema versioning)
- Dependency management via Poetry
- DevContainer for consistent developer environment
- Micro-examples that can be combined into composite microservices

## Diagram (Mermaid)

```mermaid
graph TD
    %% Developer Environment
    subgraph "Developer Environment"
        DevContainer["DevContainer"]:::developerEnv
        Poetry["Poetry"]:::developerEnv
    end

    %% Core Language Layer
    subgraph "Core Language Layer"
        Python["Python Foundations"]:::core
        AIT["AI Theory Documentation"]:::core
    end

    %% API Layer
    subgraph "API Layer"
        FastAPI["FastAPI Service"]:::backend
        subgraph "Service Components"
            Scaffold["Scaffold"]:::backend
            ModelPred["Prediction Endpoint"]:::backend
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        Mongo["MongoDB"]:::data
        Postgres["Postgres (SQLAlchemy/Alembic)"]:::data
    end

    %% Data Pipeline
    subgraph "Data Pipeline"
        Preprocess["Preprocessing Scripts"]:::data
    end

    %% ML Model Layer
    subgraph "ML Model Layer"
        MLModel["Training & Prediction"]:::ml
    end

    %% LLM & Prompt Layer
    subgraph "LLM & Prompt Layer"
        LLM["LLM & Prompt Techniques"]:::ml
        ExternalLLM["External LLM APIs"]:::ml
    end

    %% Orchestration (Agent Frameworks)
    subgraph "Orchestration (Agent Frameworks)"
        OpenAIAgent["OpenAI Agent SDK"]:::orchestration
        LangChain["LangChain Examples"]:::orchestration
        LangGraph["LangGraph Examples"]:::orchestration
        CrewAI["CrewAI Examples"]:::orchestration
    end

    %% Front-End Layer
    subgraph "Front-End Layer"
        Frontend["Next.js Frontend"]:::frontend
    end

    %% Deployment & DevOps
    subgraph "Deployment & DevOps"
        Docker["Dockerfile"]:::ops
        EnvExample[".env.example"]:::ops
    end

    %% Connections
    Frontend -->|REST API calls| FastAPI
    FastAPI -->|ORM/Driver| Postgres
    FastAPI -->|Driver| Mongo
    FastAPI -->|Invoke| Preprocess
    FastAPI -->|Load Model| MLModel
    FastAPI -->|Calls| ExternalLLM

    OpenAIAgent -->|orchestrates| FastAPI
    LangChain -->|orchestrates| FastAPI
    LangGraph -->|orchestrates| FastAPI
    CrewAI -->|orchestrates| FastAPI

    OpenAIAgent -->|accesses| Mongo
    OpenAIAgent -->|accesses| Postgres
    OpenAIAgent -->|uses| MLModel
    OpenAIAgent -->|calls| ExternalLLM

    Docker -->|containers| FastAPI
    Docker -->|containers| OpenAIAgent
    Docker -->|containers| LangChain
    Docker -->|containers| LangGraph
    Docker -->|containers| CrewAI
    Docker -->|containers| Frontend

    %% Click Events
    click DevContainer "https://github.com/techloset/agentic-ai/blob/master/.devcontainer/devcontainer.json"
    click Poetry "https://github.com/techloset/agentic-ai/blob/master/pyproject.toml"
    click Python "https://github.com/techloset/agentic-ai/blob/master/01_python/readme.md"
    click AIT "https://github.com/techloset/agentic-ai/blob/master/02_ai_theory/readme.md"
    click Scaffold "https://github.com/techloset/agentic-ai/tree/master/03_fastapi/folder_standard/"
    click ModelPred "https://github.com/techloset/agentic-ai/blob/master/06_model_development/fastapi_pridiction_model.py"
    click Mongo "https://github.com/techloset/agentic-ai/blob/master/04_databases/01_fastapi_mongodb.py"
    click Postgres "https://github.com/techloset/agentic-ai/tree/master/04_databases/02_fast_api_postgress/"
    click Preprocess "https://github.com/techloset/agentic-ai/tree/master/05_data_preprocessing/"
    click MLModel "https://github.com/techloset/agentic-ai/tree/master/06_model_development/"
    click LLM "https://github.com/techloset/agentic-ai/tree/master/07_llm_and_prompt_engineering/"
    click OpenAIAgent "https://github.com/techloset/agentic-ai/tree/master/08_openai-agent-sdk/"
    click LangChain "https://github.com/techloset/agentic-ai/tree/master/09_langchain/"
    click LangGraph "https://github.com/techloset/agentic-ai/tree/master/09a_langgraph/"
    click CrewAI "https://github.com/techloset/agentic-ai/tree/master/10_crewai/"
    click Frontend "https://github.com/techloset/agentic-ai/tree/master/12_frontend/"
    click Docker "https://github.com/techloset/agentic-ai/tree/master/11_deployment/dockerfile"
    click EnvExample "https://github.com/techloset/agentic-ai/blob/master/.env.example"

    %% Styles
    classDef developerEnv fill:#cccccc,stroke:#333,stroke-width:1px
    classDef core fill:#add8e6,stroke:#333,stroke-width:1px
    classDef backend fill:#87cefa,stroke:#333,stroke-width:1px
    classDef data fill:#98fb98,stroke:#333,stroke-width:1px
    classDef ml fill:#ffd700,stroke:#333,stroke-width:1px
    classDef orchestration fill:#dda0dd,stroke:#333,stroke-width:1px
    classDef frontend fill:#40e0d0,stroke:#333,stroke-width:1px
    classDef ops fill:#cd853f,stroke:#333,stroke-width:1px
```
