# saksham20189575/generative-ai-notes architecture

> Architecture diagram of the GitHub repository saksham20189575/generative-ai-notes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saksham20189575/generative-ai-notes
- Repository: https://github.com/saksham20189575/generative-ai-notes

## Overview

#### Purpose and Repository Shape
This is a curriculum repository, not a deployable application. It teaches Python through AI-agent, RAG, LangChain, and multi-agent patterns using sequential Markdown lessons plus independently runnable Python labs. The learner-facing entry point is `README.md`; environment dependencies are centralized in `requirements.txt` and `setup_env.sh`.

#### Learning Pipeline
The top-level numbered directories form the primary progression: Python foundations → agent concepts → memory and databases → embeddings/vector search → RAG → tools → LLM frameworks → automation. Each module’s `README.md` is the conceptual boundary and each topic folder is a lesson unit:
- `01-Programming-Foundations/README.md`
- `06-Retrieval-Augmented-Generation/README.md`
- `08-LLM-Frameworks-and-Local-Models/README.md`

#### Runnable Python Foundations
Early lessons use standalone scripts as direct execution entry points, establishing Python control flow, collections, functions, and OOP needed by later examples. They do not form a shared package or reusable runtime:
- `01-Programming-Foundations/01-Intro-to-Programming-and-Python-Basics/code/firstProgram.py`
- `01-Programming-Foundations/04-Lists-and-Functions/code/04_functions.py`
- `01-Programming-Foundations/05-Strings-Dictionaries-and-Classes/code/06_classes_objects.py`

#### RAG and Retrieval Labs
The core implementation pattern is document corpus → embedding/vector retrieval → LLM-grounded response. Policy or handbook files are local knowledge boundaries; the `main.py`/`rag.py` scripts orchestrate ingestion and querying. Retrieval quality is explored separately from the baseline pipeline:
- `Coding-Examples/rag_pipeline/main.py`
- `Coding-Examples/rag_pipeline/policy_documents/refunds_policy.txt`
- `Coding-Examples/improving_rag/main.py`
- `Coding-Examples/shopkart_rag/rag.py`

#### LangChain Agent Stack
LangChain examples progressively compose chains, tool calling, memory, RAG retrieval tools, and agent evaluation/debugging. Each directory is an isolated executable scenario rather than a shared agent platform. The integrated-agent examples use local handbook documents as retriever context; evaluation inputs include persisted JSON traces:
- `Coding-Examples/langChain/main.py`
- `Coding-Examples/langChain_integrated_agent/main.py`
- `Coding-Examples/langChain_integrated_agent/handbook_docs/leave_policy.md`
- `Coding-Examples/langChain_agent_evaluation/main.py`
- `Coding-Examples/langChain_agent_evaluation/trace_refund_policy.json`

#### External Models, Services, and Tools
Material integration boundaries include LLM APIs, JSON/HTTP APIs, local Ollama models, vector databases (Chroma is identified by the root README), LangChain, CrewAI, and n8n-oriented workflow concepts. Credentials are intentionally externalized through example environment files where needed:
- `Coding-Examples/api_call/main.py`
- `Coding-Examples/tool_integration/main.py`
- `Coding-Examples/ollama/main.py`
- `Coding-Examples/langChain_worktree/.env.example`
- `Coding-Examples/shopkart_rag/.env.example`

#### Multi-Agent Automation
The final stage demonstrates orchestration patterns: role/task-based CrewAI and an HTTP-triggered researcher → writer → editor flow. The latter is the closest thing to a service boundary, incorporating webhook callback, signature validation, and idempotency concepts, but remains a runnable educational script:
- `Coding-Examples/multi_agent_crewai/main.py`
- `Coding-Examples/multi_agent_crewai/campus_facts.txt`
- `Coding-Examples/multi_agent_http_automation/main.py`
- `09-Multi-Agent-Systems-and-Automation/36-Multi-Agent-Architecture-and-HTTP-Automation/README.md`

Main entry points: [`Coding-Examples/langChain_integrated_agent/main.py`](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_integrated_agent/main.py) (Integrated LangChain agent), [`Coding-Examples/rag_pipeline/main.py`](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/rag_pipeline/main.py) (Baseline RAG pipeline), [`01-Programming-Foundations/README.md`](https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/README.md) (Python foundations module), [`06-Retrieval-Augmented-Generation/README.md`](https://github.com/saksham20189575/generative-ai-notes/blob/main/06-Retrieval-Augmented-Generation/README.md) (RAG module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Curriculum"]
  node_root_readme["Course entry point<br/>Markdown<br/>[README.md]"]
  node_dependencies["Environment setup<br/>Dependencies<br/>[requirements.txt]"]
  node_foundations_module["Python foundations module<br/>Lesson module<br/>[README.md]"]
  node_rag_module["RAG module<br/>Lesson module<br/>[README.md]"]
  node_frameworks_module["LLM frameworks module<br/>Lesson module<br/>[README.md]"]
end

subgraph group_foundations["Python Foundations"]
  node_python_scripts["Standalone Python exercises<br/>Python scripts<br/>[firstProgram.py]"]
  node_functions_lab["Functions exercise<br/>Python script<br/>[04_functions.py]"]
  node_oop_lab["Classes and objects exercise<br/>Python script"]
end

subgraph group_rag["RAG Labs"]
  node_policy_corpus["Policy document corpus<br/>Local documents<br/>[refunds_policy.txt]"]
  node_rag_pipeline["Baseline RAG pipeline<br/>Python lab<br/>[main.py]"]
  node_improving_rag["Retrieval quality lab<br/>Python lab<br/>[main.py]"]
  node_shopkart_rag["Shopkart RAG lab<br/>Python lab<br/>[rag.py]"]
end

subgraph group_agents["Agent Labs"]
  node_langchain_basics["LangChain composition<br/>Python lab<br/>[main.py]"]
  node_integrated_agent["Integrated LangChain agent<br/>Python lab<br/>[main.py]"]
  node_handbook_docs["Handbook context<br/>Local documents<br/>[leave_policy.md]"]
  node_agent_evaluation["Agent evaluation lab<br/>Python lab<br/>[main.py]"]
  node_evaluation_trace["Persisted agent trace<br/>JSON trace"]
end

subgraph group_automation["Automation"]
  node_crewai_lab["CrewAI role/task lab<br/>Python lab<br/>[main.py]"]
  node_http_automation["HTTP automation flow<br/>Python lab<br/>[main.py]"]
  node_automation_lesson["HTTP automation lesson<br/>Lesson module<br/>[README.md]"]
end

node_vector_store[("Vector retrieval<br/>Chroma/vector DB")]
node_llm_services{{"LLM models and APIs<br/>External models"}}

node_root_readme -->|"setup guidance"| node_dependencies
node_root_readme -->|"starts progression"| node_foundations_module
node_foundations_module -->|"prerequisite progression"| node_rag_module
node_rag_module -->|"next stage"| node_frameworks_module
node_foundations_module -->|"contains runnable lesson"| node_python_scripts
node_python_scripts -.->|"builds toward"| node_functions_lab
node_functions_lab -.->|"builds toward"| node_oop_lab
node_rag_module -->|"applied lab"| node_rag_pipeline
node_policy_corpus -->|"ingested"| node_rag_pipeline
node_rag_pipeline -->|"embeds and retrieves"| node_vector_store
node_vector_store -->|"grounded context for"| node_llm_services
node_rag_pipeline -.->|"baseline for"| node_improving_rag
node_shopkart_rag -->|"retrieves from"| node_vector_store
node_shopkart_rag -->|"generates with"| node_llm_services
node_frameworks_module -->|"applied lab"| node_langchain_basics
node_langchain_basics -->|"progresses to"| node_integrated_agent
node_handbook_docs -->|"retriever context"| node_integrated_agent
node_integrated_agent -->|"retrieves through"| node_vector_store
node_integrated_agent -->|"uses"| node_llm_services
node_integrated_agent -.->|"evaluated by"| node_agent_evaluation
node_evaluation_trace -->|"evaluation input"| node_agent_evaluation
node_crewai_lab -->|"coordinates"| node_llm_services
node_automation_lesson -->|"implemented as"| node_http_automation
node_http_automation -->|"orchestrates"| node_llm_services

click node_root_readme "https://github.com/saksham20189575/generative-ai-notes/blob/main/README.md"
click node_dependencies "https://github.com/saksham20189575/generative-ai-notes/blob/main/requirements.txt"
click node_foundations_module "https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/README.md"
click node_rag_module "https://github.com/saksham20189575/generative-ai-notes/blob/main/06-Retrieval-Augmented-Generation/README.md"
click node_frameworks_module "https://github.com/saksham20189575/generative-ai-notes/blob/main/08-LLM-Frameworks-and-Local-Models/README.md"
click node_python_scripts "https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/01-Intro-to-Programming-and-Python-Basics/code/firstProgram.py"
click node_functions_lab "https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/04-Lists-and-Functions/code/04_functions.py"
click node_oop_lab "https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/05-Strings-Dictionaries-and-Classes/code/06_classes_objects.py"
click node_policy_corpus "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/rag_pipeline/policy_documents/refunds_policy.txt"
click node_rag_pipeline "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/rag_pipeline/main.py"
click node_improving_rag "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/improving_rag/main.py"
click node_shopkart_rag "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/shopkart_rag/rag.py"
click node_langchain_basics "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain/main.py"
click node_integrated_agent "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_integrated_agent/main.py"
click node_handbook_docs "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_integrated_agent/handbook_docs/leave_policy.md"
click node_agent_evaluation "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_agent_evaluation/main.py"
click node_evaluation_trace "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_agent_evaluation/trace_refund_policy.json"
click node_crewai_lab "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/multi_agent_crewai/main.py"
click node_http_automation "https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/multi_agent_http_automation/main.py"
click node_automation_lesson "https://github.com/saksham20189575/generative-ai-notes/blob/main/09-Multi-Agent-Systems-and-Automation/36-Multi-Agent-Architecture-and-HTTP-Automation/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_readme,node_dependencies,node_foundations_module,node_rag_module,node_frameworks_module toneBlue
class node_python_scripts,node_functions_lab,node_oop_lab toneAmber
class node_policy_corpus,node_rag_pipeline,node_improving_rag,node_shopkart_rag toneMint
class node_langchain_basics,node_integrated_agent,node_handbook_docs,node_agent_evaluation,node_evaluation_trace toneRose
class node_crewai_lab,node_http_automation,node_automation_lesson toneIndigo
class node_vector_store,node_llm_services toneNeutral
```

## Components

### Curriculum

Sequential learner-facing Markdown modules.

- [Course entry point](https://github.com/saksham20189575/generative-ai-notes/blob/main/README.md): Markdown · Introduces the curriculum and named integrations. · `README.md`
- [Environment setup](https://github.com/saksham20189575/generative-ai-notes/blob/main/requirements.txt): Dependencies · Centralized package and environment setup. · `requirements.txt`
- [Python foundations module](https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/README.md): Lesson module · Conceptual prerequisite for later runnable labs. · `01-Programming-Foundations/README.md`
- [RAG module](https://github.com/saksham20189575/generative-ai-notes/blob/main/06-Retrieval-Augmented-Generation/README.md): Lesson module · Conceptual boundary for retrieval-augmented generation. · `06-Retrieval-Augmented-Generation/README.md`
- [LLM frameworks module](https://github.com/saksham20189575/generative-ai-notes/blob/main/08-LLM-Frameworks-and-Local-Models/README.md): Lesson module · Covers framework and local-model concepts. · `08-LLM-Frameworks-and-Local-Models/README.md`

### Python Foundations

Standalone prerequisite exercises.

- [Standalone Python exercises](https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/01-Intro-to-Programming-and-Python-Basics/code/firstProgram.py): Python scripts · Directly runnable control-flow, functions, and OOP examples. · `01-Programming-Foundations/01-Intro-to-Programming-and-Python-Basics/code/firstProgram.py`
- [Functions exercise](https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/04-Lists-and-Functions/code/04_functions.py): Python script · `01-Programming-Foundations/04-Lists-and-Functions/code/04_functions.py`
- [Classes and objects exercise](https://github.com/saksham20189575/generative-ai-notes/blob/main/01-Programming-Foundations/05-Strings-Dictionaries-and-Classes/code/06_classes_objects.py): Python script · `01-Programming-Foundations/05-Strings-Dictionaries-and-Classes/code/06_classes_objects.py`

### RAG Labs

Document-grounded retrieval scenarios.

- [Policy document corpus](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/rag_pipeline/policy_documents/refunds_policy.txt): Local documents · Local knowledge boundary for baseline RAG. · `Coding-Examples/rag_pipeline/policy_documents/refunds_policy.txt`
- [Baseline RAG pipeline](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/rag_pipeline/main.py): Python lab · Ingests local documents and answers grounded queries. · `Coding-Examples/rag_pipeline/main.py`
- [Retrieval quality lab](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/improving_rag/main.py): Python lab · Explores retrieval improvements separately from the baseline. · `Coding-Examples/improving_rag/main.py`
- [Shopkart RAG lab](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/shopkart_rag/rag.py): Python lab · Alternative runnable RAG scenario with externalized credentials. · `Coding-Examples/shopkart_rag/rag.py`

### Agent Labs

Isolated LangChain agent scenarios.

- [LangChain composition](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain/main.py): Python lab · Introduces chains and tool-calling composition. · `Coding-Examples/langChain/main.py`
- [Integrated LangChain agent](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_integrated_agent/main.py): Python lab · Combines tools, memory, and handbook retrieval. · `Coding-Examples/langChain_integrated_agent/main.py`
- [Handbook context](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_integrated_agent/handbook_docs/leave_policy.md): Local documents · Retriever context for the integrated agent. · `Coding-Examples/langChain_integrated_agent/handbook_docs/leave_policy.md`
- [Agent evaluation lab](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_agent_evaluation/main.py): Python lab · Debugs and evaluates agents using persisted traces. · `Coding-Examples/langChain_agent_evaluation/main.py`
- [Persisted agent trace](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/langChain_agent_evaluation/trace_refund_policy.json): JSON trace · `Coding-Examples/langChain_agent_evaluation/trace_refund_policy.json`

### Automation

Multi-agent orchestration examples.

- [CrewAI role/task lab](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/multi_agent_crewai/main.py): Python lab · Coordinates role-based multi-agent tasks. · `Coding-Examples/multi_agent_crewai/main.py`
- [HTTP automation flow](https://github.com/saksham20189575/generative-ai-notes/blob/main/Coding-Examples/multi_agent_http_automation/main.py): Python lab · Webhook-driven researcher-to-writer-to-editor orchestration. · `Coding-Examples/multi_agent_http_automation/main.py`
- [HTTP automation lesson](https://github.com/saksham20189575/generative-ai-notes/blob/main/09-Multi-Agent-Systems-and-Automation/36-Multi-Agent-Architecture-and-HTTP-Automation/README.md): Lesson module · Explains multi-agent architecture and HTTP automation concepts. · `09-Multi-Agent-Systems-and-Automation/36-Multi-Agent-Architecture-and-HTTP-Automation/README.md`

### Other components

- **Vector retrieval**: Chroma/vector DB · Embedding-backed document retrieval used by RAG examples.
- **LLM models and APIs**: External models · Hosted APIs and local Ollama models supply generation.

## Connections

- Course entry point → Environment setup: setup guidance
- Course entry point → Python foundations module: starts progression
- Python foundations module → RAG module: prerequisite progression
- RAG module → LLM frameworks module: next stage
- Python foundations module → Standalone Python exercises: contains runnable lesson
- Standalone Python exercises → Functions exercise: builds toward
- Functions exercise → Classes and objects exercise: builds toward
- RAG module → Baseline RAG pipeline: applied lab
- Policy document corpus → Baseline RAG pipeline: ingested
- Baseline RAG pipeline → Vector retrieval: embeds and retrieves
- Vector retrieval → LLM models and APIs: grounded context for
- Baseline RAG pipeline → Retrieval quality lab: baseline for
- Shopkart RAG lab → Vector retrieval: retrieves from
- Shopkart RAG lab → LLM models and APIs: generates with
- LLM frameworks module → LangChain composition: applied lab
- LangChain composition → Integrated LangChain agent: progresses to
- Handbook context → Integrated LangChain agent: retriever context
- Integrated LangChain agent → Vector retrieval: retrieves through
- Integrated LangChain agent → LLM models and APIs: uses
- Integrated LangChain agent → Agent evaluation lab: evaluated by
- Persisted agent trace → Agent evaluation lab: evaluation input
- CrewAI role/task lab → LLM models and APIs: coordinates
- HTTP automation lesson → HTTP automation flow: implemented as
- HTTP automation flow → LLM models and APIs: orchestrates
