# akarshvyas/agentic-ai-youtube architecture

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

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

## Overview

This repository contains several standalone LangGraph examples rather than one integrated application. Its primary user-facing product is a college assistant: a student selects a programme and asks a question; the app classifies it, optionally retrieves academic or fee-document passages, and generates a programme-aware answer. Other scripts demonstrate iterative and human-reviewed writing, parallel safety analysis, and sequential text transformation. The graph follows calls and documented graph routing; the examples do not import one another.

Main entry points: [`app.py`](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py) (Query classifier), [`parallel_reducers.py`](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py) (Safety analysis graph), [`iterative_tools.py`](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py) (Post writer), [`humanintheloop.py`](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py) (Human-review graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_college["College assistant"]
  node_chat_ui["Chat interface<br/>[app.py]"]
  node_assistant_graph["Assistant graph<br/>[app.py]"]
  node_classifier["Query classifier<br/>[app.py]"]
  node_academic_retrieval["Academic retrieval<br/>[app.py]"]
  node_fee_retrieval["Fee retrieval<br/>[app.py]"]
  node_general_route["General response route<br/>[app.py]"]
  node_answer_generator["Answer generator<br/>[app.py]"]
  node_knowledge_setup["Knowledge-base setup<br/>[app.py]"]
  node_academic_handbook["Academic handbook"]
  node_fee_document["Fee structure<br/>[fee_structure.pdf]"]
  node_college_llm["College language model<br/>[app.py]"]
end

subgraph group_writing["Writing workflows"]
  node_post_graph["Post generator graph<br/>[iterative_tools.py]"]
  node_post_writer["Post writer<br/>[iterative_tools.py]"]
  node_tool_runner["Search tool runner<br/>[iterative_tools.py]"]
  node_web_search["Web search"]
  node_draft_extractor["Draft extractor<br/>[iterative_tools.py]"]
  node_post_reviewer["Automated reviewer<br/>[iterative_tools.py]"]
  node_human_graph["Human-review graph<br/>[humanintheloop.py]"]
  node_human_writer["Post writer<br/>[humanintheloop.py]"]
  node_human_review["Human review pause<br/>[humanintheloop.py]"]
  node_memory_checkpoint[("Memory checkpoint<br/>[humanintheloop.py]")]
end

subgraph group_analysis["Text analysis"]
  node_safety_graph["Safety analysis graph"]
  node_toxicity_check["Toxicity check"]
  node_copyright_check["Copyright check"]
  node_culture_check["Culture check"]
  node_scores["Merged safety scores"]
end

subgraph group_examples["Graph examples"]
  node_text_pipeline["Text transformation graph<br/>[sequential_base.py]"]
  node_editor["Text editor<br/>[sequential_base.py]"]
  node_scriptwriter["Script writer<br/>[sequential_base.py]"]
  node_translator["Hinglish translator<br/>[sequential_base.py]"]
end

node_student(("Student"))
node_post_user(("Topic submitter"))
node_human_user(("Human reviewer"))
node_text_input(("Text input"))

node_student -->|"asks question"| node_chat_ui
node_chat_ui -->|"invokes graph"| node_assistant_graph
node_assistant_graph -->|"starts at"| node_classifier
node_classifier -->|"classifies with"| node_college_llm
node_classifier -->|"routes academic"| node_academic_retrieval
node_classifier -->|"routes fee"| node_fee_retrieval
node_classifier -->|"routes general"| node_general_route
node_academic_retrieval -->|"retrieves from"| node_academic_handbook
node_fee_retrieval -->|"retrieves from"| node_fee_document
node_academic_retrieval -->|"passes context"| node_answer_generator
node_fee_retrieval -->|"passes context"| node_answer_generator
node_general_route -->|"passes query"| node_answer_generator
node_answer_generator -->|"generates with"| node_college_llm
node_answer_generator -->|"returns answer"| node_chat_ui
node_knowledge_setup -->|"loads document"| node_academic_handbook
node_knowledge_setup -->|"loads document"| node_fee_document
node_post_user -->|"provides topic"| node_post_graph
node_post_graph -->|"starts at"| node_post_writer
node_post_writer -->|"dispatches tools"| node_tool_runner
node_tool_runner -->|"searches web"| node_web_search
node_post_writer -->|"routes without tools"| node_draft_extractor
node_tool_runner -->|"continues to review"| node_post_reviewer
node_draft_extractor -->|"submits draft"| node_post_reviewer
node_post_reviewer -->|"revises if rejected"| node_post_writer
node_post_user -->|"provides topic"| node_human_graph
node_human_graph -->|"starts at"| node_human_writer
node_human_writer -->|"submits draft"| node_human_review
node_human_user -->|"approves or comments"| node_human_review
node_human_review -->|"rewrites if rejected"| node_human_writer
node_human_graph -->|"checkpoints state"| node_memory_checkpoint
node_text_input -->|"supplies text"| node_safety_graph
node_safety_graph -->|"runs in parallel"| node_toxicity_check
node_safety_graph -->|"runs in parallel"| node_copyright_check
node_safety_graph -->|"runs in parallel"| node_culture_check
node_toxicity_check -->|"merges score"| node_scores
node_copyright_check -->|"merges score"| node_scores
node_culture_check -->|"merges score"| node_scores
node_text_input -->|"supplies text"| node_text_pipeline
node_text_pipeline -->|"starts at"| node_editor
node_editor -->|"passes edited text"| node_scriptwriter
node_scriptwriter -->|"passes script"| node_translator

click node_chat_ui "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_assistant_graph "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_classifier "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_academic_retrieval "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_fee_retrieval "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_general_route "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_answer_generator "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_knowledge_setup "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_academic_handbook "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/academics_handbook.pdf"
click node_fee_document "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/fee_structure.pdf"
click node_college_llm "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py"
click node_post_graph "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py"
click node_post_writer "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py"
click node_tool_runner "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py"
click node_draft_extractor "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py"
click node_post_reviewer "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py"
click node_human_graph "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py"
click node_human_writer "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py"
click node_human_review "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py"
click node_memory_checkpoint "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py"
click node_safety_graph "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py"
click node_toxicity_check "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py"
click node_copyright_check "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py"
click node_culture_check "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py"
click node_scores "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py"
click node_text_pipeline "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py"
click node_editor "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py"
click node_scriptwriter "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py"
click node_translator "https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.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_chat_ui,node_assistant_graph,node_classifier,node_academic_retrieval,node_fee_retrieval,node_general_route,node_answer_generator,node_knowledge_setup,node_academic_handbook,node_fee_document,node_college_llm,node_human_user toneBlue
class node_post_graph,node_post_writer,node_tool_runner,node_web_search,node_draft_extractor,node_post_reviewer,node_human_graph,node_human_writer,node_human_review,node_memory_checkpoint toneAmber
class node_safety_graph,node_toxicity_check,node_copyright_check,node_culture_check,node_scores toneMint
class node_text_pipeline,node_editor,node_scriptwriter,node_translator toneRose
class node_student,node_post_user,node_text_input toneIndigo
```

## Components

### College assistant

- [Chat interface](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Assistant graph](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Query classifier](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Academic retrieval](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Fee retrieval](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [General response route](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Answer generator](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Knowledge-base setup](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`
- [Academic handbook](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/academics_handbook.pdf): `academics_handbook.pdf`
- [Fee structure](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/fee_structure.pdf): `fee_structure.pdf`
- [College language model](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/app.py): `app.py`

### Writing workflows

- [Post generator graph](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py): `iterative_tools.py`
- [Post writer](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py): `iterative_tools.py`
- [Search tool runner](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py): `iterative_tools.py`
- **Web search**
- [Draft extractor](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py): `iterative_tools.py`
- [Automated reviewer](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/iterative_tools.py): `iterative_tools.py`
- [Human-review graph](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py): `humanintheloop.py`
- [Post writer](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py): `humanintheloop.py`
- [Human review pause](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py): `humanintheloop.py`
- [Memory checkpoint](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/humanintheloop.py): `humanintheloop.py`

### Text analysis

- [Safety analysis graph](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py): `parallel_reducers.py`
- [Toxicity check](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py): `parallel_reducers.py`
- [Copyright check](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py): `parallel_reducers.py`
- [Culture check](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py): `parallel_reducers.py`
- [Merged safety scores](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/parallel_reducers.py): `parallel_reducers.py`

### Graph examples

- [Text transformation graph](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py): `sequential_base.py`
- [Text editor](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py): `sequential_base.py`
- [Script writer](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py): `sequential_base.py`
- [Hinglish translator](https://github.com/akarshvyas/agentic-ai-youtube/blob/main/sequential_base.py): `sequential_base.py`

### Other components

- **Student**
- **Topic submitter**
- **Human reviewer**
- **Text input**

## Connections

- Student → Chat interface: asks question (evidence: `app.py`)
- Chat interface → Assistant graph: invokes graph (evidence: `app.py`)
- Assistant graph → Query classifier: starts at (evidence: `app.py`)
- Query classifier → College language model: classifies with (evidence: `app.py`)
- Query classifier → Academic retrieval: routes academic (evidence: `app.py`)
- Query classifier → Fee retrieval: routes fee (evidence: `app.py`)
- Query classifier → General response route: routes general (evidence: `app.py`)
- Academic retrieval → Academic handbook: retrieves from (evidence: `app.py`)
- Fee retrieval → Fee structure: retrieves from (evidence: `app.py`)
- Academic retrieval → Answer generator: passes context (evidence: `app.py`)
- Fee retrieval → Answer generator: passes context (evidence: `app.py`)
- General response route → Answer generator: passes query (evidence: `app.py`)
- Answer generator → College language model: generates with (evidence: `app.py`)
- Answer generator → Chat interface: returns answer (evidence: `app.py`)
- Knowledge-base setup → Academic handbook: loads document (evidence: `app.py`)
- Knowledge-base setup → Fee structure: loads document (evidence: `app.py`)
- Topic submitter → Post generator graph: provides topic (evidence: `iterative_tools.py`)
- Post generator graph → Post writer: starts at (evidence: `iterative_tools.py`)
- Post writer → Search tool runner: dispatches tools (evidence: `iterative_tools.py`)
- Search tool runner → Web search: searches web (evidence: `iterative_tools.py`)
- Post writer → Draft extractor: routes without tools (evidence: `iterative_tools.py`)
- Search tool runner → Automated reviewer: continues to review (evidence: `iterative_tools.py`)
- Draft extractor → Automated reviewer: submits draft (evidence: `iterative_tools.py`)
- Automated reviewer → Post writer: revises if rejected (evidence: `iterative_tools.py`)
- Topic submitter → Human-review graph: provides topic (evidence: `humanintheloop.py`)
- Human-review graph → Post writer: starts at (evidence: `humanintheloop.py`)
- Post writer → Human review pause: submits draft (evidence: `humanintheloop.py`)
- Human reviewer → Human review pause: approves or comments (evidence: `humanintheloop.py`)
- Human review pause → Post writer: rewrites if rejected (evidence: `humanintheloop.py`)
- Human-review graph → Memory checkpoint: checkpoints state (evidence: `humanintheloop.py`)
- Text input → Safety analysis graph: supplies text (evidence: `parallel_reducers.py`)
- Safety analysis graph → Toxicity check: runs in parallel (evidence: `parallel_reducers.py`)
- Safety analysis graph → Copyright check: runs in parallel (evidence: `parallel_reducers.py`)
- Safety analysis graph → Culture check: runs in parallel (evidence: `parallel_reducers.py`)
- Toxicity check → Merged safety scores: merges score (evidence: `parallel_reducers.py`)
- Copyright check → Merged safety scores: merges score (evidence: `parallel_reducers.py`)
- Culture check → Merged safety scores: merges score (evidence: `parallel_reducers.py`)
- Text input → Text transformation graph: supplies text (evidence: `sequential_base.py`)
- Text transformation graph → Text editor: starts at (evidence: `sequential_base.py`)
- Text editor → Script writer: passes edited text (evidence: `sequential_base.py`)
- Script writer → Hinglish translator: passes script (evidence: `sequential_base.py`)
