# belikejishu/ai-news-summarizer architecture

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

- Interactive diagram: https://gitdiagram.com/belikejishu/ai-news-summarizer
- Repository: https://github.com/belikejishu/ai-news-summarizer

## Overview

#### Purpose and Entry Points
This is a Python agentic-AI chatbot project built around LangGraph-style workflows. The primary application entry point is `app.py`; package-level orchestration is likely exposed through `src/langgraphagenticai/main.py`. It supports basic chat, tool-enabled chat, and AI-news generation flows.

#### Application and UI Boundary
The user-facing runtime is Streamlit-oriented, with UI loading and result rendering separated from agent logic:
- `src/langgraphagenticai/ui/streamlitui/loadui.py`
- `src/langgraphagenticai/ui/streamlitui/display_result.py`
- `src/langgraphagenticai/ui/uiconfigfile.py`

UI configuration is sourced from `src/langgraphagenticai/ui/uiconfigfile.ini`. The UI should invoke graph/application APIs rather than directly own LLM or tool decisions.

#### Graph Orchestration
Workflow construction is centralized in:
- `src/langgraphagenticai/graph/graph_builder.py`
- `src/langgraphagenticai/main.py`

This layer is the principal control-flow boundary: it assembles nodes into one or more chatbot/news workflows, routes state between stages, and provides the runnable graph consumed by the UI or top-level app.

#### Shared Agent State
Cross-node conversation and workflow data is defined in:
- `src/langgraphagenticai/state/state.py`

This state contract is the primary data boundary between graph stages. Nodes should read incoming messages/request context from it and return state updates, allowing the graph builder—not individual nodes—to manage sequencing and persistence of workflow context.

#### Agent Nodes and Modes
Distinct behavior is implemented as graph nodes:
- `src/langgraphagenticai/nodes/basic_chatbot_node.py`
- `src/langgraphagenticai/nodes/chatbot_with_Tool_node.py`
- `src/langgraphagenticai/nodes/ai_news_node.py`

The basic chatbot node represents direct LLM response generation. The tool-enabled node adds an agent/tool execution branch. The AI-news node produces curated news-oriented output, likely intended for scheduled or manually triggered summaries.

#### LLM and Search Integration
External-model access is isolated in:
- `src/langgraphagenticai/LLMS/groqllm.py`

This is the key provider boundary for Groq-hosted LLM inference. Search capability is encapsulated separately in:
- `src/langgraphagenticai/tools/search_tool.py`

The expected tool-enabled flow is: user input enters shared state, the graph routes to the chatbot/tool node, that node invokes the Groq LLM and may call the search tool, then the final response is returned through the UI.

#### Generated News Artifacts and Runtime Dependencies
The repository stores generated or maintained AI-news outputs under:
- `AINews/daily_summary.md`
- `AINews/weekly_summary.md`
- `AINews/monthly_summary.md`

These artifacts form an output boundary for the AI-news workflow, separate from interactive chat responses. Material runtime dependencies are declared in `requirements.txt`; the core stack implied by the structure includes Python, Streamlit, LangGraph, an LLM provider via Groq, and an external search service/tool.

Main entry points: [`src/langgraphagenticai/graph/graph_builder.py`](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/graph/graph_builder.py) (Graph builder), [`src/langgraphagenticai/nodes/ai_news_node.py`](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/ai_news_node.py) (AI news node), [`src/langgraphagenticai/main.py`](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/main.py) (Application API), [`src/langgraphagenticai/ui/streamlitui/loadui.py`](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/streamlitui/loadui.py) (UI loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; UI"]
  node_app["App entry point<br/>Python entry<br/>[app.py]"]
  node_main["Application API<br/>Python orchestration<br/>[main.py]"]
  node_load_ui["UI loader<br/>Streamlit UI<br/>[loadui.py]"]
  node_display_result["Result renderer<br/>Streamlit UI<br/>[display_result.py]"]
  node_ui_config["UI config loader<br/>UI configuration<br/>[uiconfigfile.py]"]
  node_ui_ini["UI settings<br/>INI config<br/>[uiconfigfile.ini]"]
end

subgraph group_workflow["Workflow Core"]
  node_graph_builder{{"Graph builder<br/>LangGraph workflow<br/>[graph_builder.py]"}}
  node_agent_state["Shared agent state<br/>State contract<br/>[state.py]"]
end

subgraph group_agents["Agent Nodes"]
  node_basic_chat["Basic chat node<br/>Graph node"]
  node_tool_chat["Tool-enabled chat node<br/>Graph node"]
  node_ai_news["AI news node<br/>Graph node<br/>[ai_news_node.py]"]
end

subgraph group_integrations["Integrations &amp; Outputs"]
  node_groq_llm{{"Groq LLM provider<br/>LLM integration<br/>[groqllm.py]"}}
  node_search_tool{{"Search tool<br/>External search<br/>[search_tool.py]"}}
  node_daily_news["Daily summary<br/>Generated news artifact<br/>[daily_summary.md]"]
  node_weekly_news["Weekly summary<br/>Generated news artifact<br/>[weekly_summary.md]"]
  node_monthly_news["Monthly summary<br/>Generated news artifact<br/>[monthly_summary.md]"]
  node_requirements["Runtime dependencies<br/>Python dependencies<br/>[requirements.txt]"]
end

node_app -->|"launches"| node_load_ui
node_app -->|"uses"| node_main
node_load_ui -->|"loads"| node_ui_config
node_ui_config -->|"reads"| node_ui_ini
node_load_ui -->|"submits requests"| node_main
node_main -->|"builds/runs"| node_graph_builder
node_graph_builder -->|"routes state"| node_agent_state
node_graph_builder -->|"direct chat route"| node_basic_chat
node_graph_builder -->|"tool chat route"| node_tool_chat
node_graph_builder -->|"news route"| node_ai_news
node_basic_chat -->|"inference"| node_groq_llm
node_tool_chat -->|"agent inference"| node_groq_llm
node_tool_chat -.->|"optional search"| node_search_tool
node_ai_news -->|"summary generation"| node_groq_llm
node_ai_news -->|"writes"| node_daily_news
node_ai_news -->|"writes"| node_weekly_news
node_ai_news -->|"writes"| node_monthly_news
node_main -->|"returns response"| node_display_result
node_display_result -->|"renders in UI"| node_load_ui
node_app -.->|"runtime environment"| node_requirements

click node_app "https://github.com/belikejishu/ai-news-summarizer/blob/main/app.py"
click node_main "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/main.py"
click node_load_ui "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/streamlitui/loadui.py"
click node_display_result "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/streamlitui/display_result.py"
click node_ui_config "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/uiconfigfile.py"
click node_ui_ini "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/uiconfigfile.ini"
click node_graph_builder "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/graph/graph_builder.py"
click node_agent_state "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/state/state.py"
click node_basic_chat "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/basic_chatbot_node.py"
click node_tool_chat "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/chatbot_with_Tool_node.py"
click node_ai_news "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/ai_news_node.py"
click node_groq_llm "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/LLMS/groqllm.py"
click node_search_tool "https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/tools/search_tool.py"
click node_daily_news "https://github.com/belikejishu/ai-news-summarizer/blob/main/AINews/daily_summary.md"
click node_weekly_news "https://github.com/belikejishu/ai-news-summarizer/blob/main/AINews/weekly_summary.md"
click node_monthly_news "https://github.com/belikejishu/ai-news-summarizer/blob/main/AINews/monthly_summary.md"
click node_requirements "https://github.com/belikejishu/ai-news-summarizer/blob/main/requirements.txt"

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_app,node_main,node_load_ui,node_display_result,node_ui_config,node_ui_ini toneBlue
class node_graph_builder,node_agent_state toneAmber
class node_basic_chat,node_tool_chat,node_ai_news toneMint
class node_groq_llm,node_search_tool,node_daily_news,node_weekly_news,node_monthly_news,node_requirements toneRose
```

## Components

### Entry & UI

- [App entry point](https://github.com/belikejishu/ai-news-summarizer/blob/main/app.py): Python entry · Starts the Streamlit-oriented application. · `app.py`
- [Application API](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/main.py): Python orchestration · Exposes application-level workflow access. · `src/langgraphagenticai/main.py`
- [UI loader](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/streamlitui/loadui.py): Streamlit UI · `src/langgraphagenticai/ui/streamlitui/loadui.py`
- [Result renderer](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/streamlitui/display_result.py): Streamlit UI · `src/langgraphagenticai/ui/streamlitui/display_result.py`
- [UI config loader](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/uiconfigfile.py): UI configuration · `src/langgraphagenticai/ui/uiconfigfile.py`
- [UI settings](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/ui/uiconfigfile.ini): INI config · `src/langgraphagenticai/ui/uiconfigfile.ini`

### Workflow Core

- [Graph builder](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/graph/graph_builder.py): LangGraph workflow · Assembles and routes chatbot and news workflows. · `src/langgraphagenticai/graph/graph_builder.py`
- [Shared agent state](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/state/state.py): State contract · Carries messages, request context, and node updates. · `src/langgraphagenticai/state/state.py`

### Agent Nodes

- [Basic chat node](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/basic_chatbot_node.py): Graph node · Generates direct LLM chat responses. · `src/langgraphagenticai/nodes/basic_chatbot_node.py`
- [Tool-enabled chat node](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/chatbot_with_Tool_node.py): Graph node · Runs LLM-driven chat with optional search. · `src/langgraphagenticai/nodes/chatbot_with_Tool_node.py`
- [AI news node](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/nodes/ai_news_node.py): Graph node · Produces curated AI-news summaries. · `src/langgraphagenticai/nodes/ai_news_node.py`

### Integrations & Outputs

- [Groq LLM provider](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/LLMS/groqllm.py): LLM integration · Isolates hosted model inference. · `src/langgraphagenticai/LLMS/groqllm.py`
- [Search tool](https://github.com/belikejishu/ai-news-summarizer/blob/main/src/langgraphagenticai/tools/search_tool.py): External search · `src/langgraphagenticai/tools/search_tool.py`
- [Daily summary](https://github.com/belikejishu/ai-news-summarizer/blob/main/AINews/daily_summary.md): Generated news artifact · `AINews/daily_summary.md`
- [Weekly summary](https://github.com/belikejishu/ai-news-summarizer/blob/main/AINews/weekly_summary.md): Generated news artifact · `AINews/weekly_summary.md`
- [Monthly summary](https://github.com/belikejishu/ai-news-summarizer/blob/main/AINews/monthly_summary.md): Generated news artifact · `AINews/monthly_summary.md`
- [Runtime dependencies](https://github.com/belikejishu/ai-news-summarizer/blob/main/requirements.txt): Python dependencies · Declares Streamlit, LangGraph, Groq, and related runtime packages. · `requirements.txt`

## Connections

- App entry point → UI loader: launches
- App entry point → Application API: uses
- UI loader → UI config loader: loads
- UI config loader → UI settings: reads
- UI loader → Application API: submits requests
- Application API → Graph builder: builds/runs
- Graph builder → Shared agent state: routes state
- Graph builder → Basic chat node: direct chat route
- Graph builder → Tool-enabled chat node: tool chat route
- Graph builder → AI news node: news route
- Basic chat node → Groq LLM provider: inference
- Tool-enabled chat node → Groq LLM provider: agent inference
- Tool-enabled chat node → Search tool: optional search
- AI news node → Groq LLM provider: summary generation
- AI news node → Daily summary: writes
- AI news node → Weekly summary: writes
- AI news node → Monthly summary: writes
- Application API → Result renderer: returns response
- Result renderer → UI loader: renders in UI
- App entry point → Runtime dependencies: runtime environment
