# sachinchaurasia/python-ai-learning architecture

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

- Interactive diagram: https://gitdiagram.com/sachinchaurasia/python-ai-learning
- Repository: https://github.com/sachinchaurasia/python-ai-learning

## Overview

This repository is a week-by-week Python and AI learning collection, not one integrated application. Its independent lessons progress from programming and data handling through machine learning, deep learning, and LLM topics. The clearest runnable user-to-result flow in the sampled code is the Week 9 retrieval-augmented generation script: it loads text documents, chunks and embeds them, searches for context for a question, then requests and displays an LLM answer. Other scripts demonstrate separate prompt modes, JSON-oriented responses, and ML pipelines. The tree and samples do not establish shared runtime wiring between lessons.

Main entry points: [`Week 9/week9_Day7/rag2_app.py`](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py) (RAG Application), [`Week1/Basics/Functions_examples.py`](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week1/Basics/Functions_examples.py) (Python Lessons), [`Week1/mini_projects/Student_management.py`](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week1/mini_projects/Student_management.py) (Student Manager), [`Week5/MachineLearningPipeLinesD4/MLPipelines.py`](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week5/MachineLearningPipeLinesD4/MLPipelines.py) (ML Pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["Python Foundations"]
  node_python_lessons["Python Lessons"]
  node_student_project["Student Manager"]
end

subgraph group_ml["Machine Learning"]
  node_ml_pipeline["ML Pipeline<br/>[MLPipelines.py]"]
  node_feature_engineering["Feature Engineering"]
end

subgraph group_llm["LLM Applications"]
  node_prompt_lesson["Prompt Engineering"]
  node_llm_question["LLM Q&amp;A<br/>[week9_day3_llm.py]"]
  node_multi_mode["Multi-Mode LLM"]
  node_json_response["JSON Response"]
end

subgraph group_retrieval["Retrieval"]
  node_rag_app["RAG Application<br/>[rag2_app.py]"]
  node_chunking["Chunk Documents<br/>[rag2_app.py]"]
  node_embedding["Embed Text<br/>[rag2_app.py]"]
  node_semantic_search["Semantic Search<br/>[rag2_app.py]"]
  node_context_prompt["Build Context Prompt<br/>[rag2_app.py]"]
end

node_learner(("Learner"))
node_text_files["Text Documents"]
node_question(("Question"))
node_openai{{"OpenAI API"}}
node_answer["Displayed Answer"]

node_learner -->|"studies"| node_python_lessons
node_learner -->|"runs"| node_student_project
node_learner -->|"runs"| node_ml_pipeline
node_learner -->|"runs"| node_feature_engineering
node_learner -->|"studies"| node_prompt_lesson
node_learner -->|"asks"| node_llm_question
node_learner -->|"selects mode"| node_multi_mode
node_learner -->|"enters topic"| node_json_response
node_text_files -->|"loads"| node_rag_app
node_rag_app -->|"chunks"| node_chunking
node_chunking -->|"encodes chunks"| node_embedding
node_learner -->|"runs"| node_rag_app
node_learner -->|"enters"| node_question
node_rag_app -->|"encodes question"| node_embedding
node_embedding -->|"compares vectors"| node_semantic_search
node_semantic_search -->|"selects context"| node_context_prompt
node_rag_app -->|"formats prompt"| node_context_prompt
node_rag_app -->|"requests answer"| node_openai
node_openai -->|"returns response"| node_answer

click node_python_lessons "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week1/Basics/Functions_examples.py"
click node_student_project "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week1/mini_projects/Student_management.py"
click node_ml_pipeline "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week5/MachineLearningPipeLinesD4/MLPipelines.py"
click node_feature_engineering "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week5/Feature%20EngineeringD5/FeatureEngineering.py"
click node_prompt_lesson "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week8/D7-Prompt_Engineering%2BLLM%20App.py"
click node_llm_question "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/Week9_Day3/week9_day3_llm.py"
click node_multi_mode "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/WEEK9_DAY4/week9_day4_MultiMode_LLM_Application.py"
click node_json_response "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/Week9_Day5/week9_day5_LLM_JSON2.py"
click node_rag_app "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py"
click node_chunking "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py"
click node_embedding "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py"
click node_semantic_search "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py"
click node_context_prompt "https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py"

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_python_lessons,node_student_project toneBlue
class node_ml_pipeline,node_feature_engineering toneAmber
class node_prompt_lesson,node_llm_question,node_multi_mode,node_json_response,node_openai toneMint
class node_rag_app,node_chunking,node_embedding,node_semantic_search,node_context_prompt toneRose
class node_learner,node_text_files,node_question,node_answer toneIndigo
```

## Components

### Python Foundations

- [Python Lessons](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week1/Basics/Functions_examples.py): `Week1/Basics/Functions_examples.py`
- [Student Manager](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week1/mini_projects/Student_management.py): `Week1/mini_projects/Student_management.py`

### Machine Learning

- [ML Pipeline](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week5/MachineLearningPipeLinesD4/MLPipelines.py): `Week5/MachineLearningPipeLinesD4/MLPipelines.py`
- [Feature Engineering](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week5/Feature%20EngineeringD5/FeatureEngineering.py): `Week5/Feature EngineeringD5/FeatureEngineering.py`

### LLM Applications

- [Prompt Engineering](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week8/D7-Prompt_Engineering%2BLLM%20App.py): `Week8/D7-Prompt_Engineering+LLM App.py`
- [LLM Q&A](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/Week9_Day3/week9_day3_llm.py): `Week 9/Week9_Day3/week9_day3_llm.py`
- [Multi-Mode LLM](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/WEEK9_DAY4/week9_day4_MultiMode_LLM_Application.py): `Week 9/WEEK9_DAY4/week9_day4_MultiMode_LLM_Application.py`
- [JSON Response](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/Week9_Day5/week9_day5_LLM_JSON2.py): `Week 9/Week9_Day5/week9_day5_LLM_JSON2.py`

### Retrieval

- [RAG Application](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py): `Week 9/week9_Day7/rag2_app.py`
- [Chunk Documents](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py): `Week 9/week9_Day7/rag2_app.py`
- [Embed Text](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py): `Week 9/week9_Day7/rag2_app.py`
- [Semantic Search](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py): `Week 9/week9_Day7/rag2_app.py`
- [Build Context Prompt](https://github.com/sachinchaurasia/python-ai-learning/blob/main/Week%209/week9_Day7/rag2_app.py): `Week 9/week9_Day7/rag2_app.py`

### Other components

- **Learner**
- **Text Documents**
- **Question**
- **OpenAI API**
- **Displayed Answer**

## Connections

- Learner → Python Lessons: studies
- Learner → Student Manager: runs
- Learner → ML Pipeline: runs
- Learner → Feature Engineering: runs
- Learner → Prompt Engineering: studies
- Learner → LLM Q&A: asks
- Learner → Multi-Mode LLM: selects mode
- Learner → JSON Response: enters topic
- Text Documents → RAG Application: loads
- RAG Application → Chunk Documents: chunks
- Chunk Documents → Embed Text: encodes chunks
- Learner → RAG Application: runs
- Learner → Question: enters
- RAG Application → Embed Text: encodes question
- Embed Text → Semantic Search: compares vectors
- Semantic Search → Build Context Prompt: selects context
- RAG Application → Build Context Prompt: formats prompt
- RAG Application → OpenAI API: requests answer
- OpenAI API → Displayed Answer: returns response
