# moseskakuno/ai-news-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/moseskakuno/ai-news-assistant
- Repository: https://github.com/moseskakuno/ai-news-assistant

## Overview

AI News Assistant is a Streamlit application for discovering international news, summarizing articles and daily digests in supported languages, saving results, and downloading digests as PDFs. The principal workflow runs from country and language selection through RSS discovery, article processing, and persistence; users can then summarize an article or generate a digest, retrieve saved material, and export a PDF. The sampled code shows discovery helpers and AI integration, while some app orchestration is excerpted only in part; README-supported capabilities are retained where implementation details are not shown.

Main entry points: [`app.py`](https://github.com/moseskakuno/ai-news-assistant/blob/main/app.py) (Streamlit app), [`news_discovery.py`](https://github.com/moseskakuno/ai-news-assistant/blob/main/news_discovery.py) (News discovery), [`ai_summarizer.py`](https://github.com/moseskakuno/ai-news-assistant/blob/main/ai_summarizer.py) (AI summaries), [`news_database.py`](https://github.com/moseskakuno/ai-news-assistant/blob/main/news_database.py) (SQLite store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Application"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_discovery["News discovery"]
  node_countries["Country settings<br/>[country_service.py]"]
  node_sources["RSS sources<br/>[source_manager.py]"]
  node_discovery_service["News discovery<br/>[news_discovery.py]"]
  node_dedup["Article deduplication<br/>[deduplicator.py]"]
  node_processor["Article processing"]
  node_extractor["Article extraction"]
end

subgraph group_summaries["Summarization"]
  node_language["Language rules"]
  node_summarizer["AI summaries<br/>[ai_summarizer.py]"]
end

subgraph group_persistence["Persistence and export"]
  node_database[("SQLite store<br/>[news_database.py]")]
  node_pdf["PDF generation<br/>[pdf_generator.py]"]
end

node_reader(("News reader"))
node_publishers["RSS and publishers"]
node_openai["OpenAI API"]

node_reader -->|"uses"| node_app
node_app -->|"selects country"| node_countries
node_app -->|"fetches news"| node_discovery_service
node_discovery_service -->|"loads feeds"| node_sources
node_discovery_service -->|"gets locale"| node_countries
node_discovery_service -->|"requests RSS"| node_publishers
node_discovery_service -->|"deduplicates"| node_dedup
node_app -->|"processes articles"| node_processor
node_app -->|"saves and loads"| node_database
node_app -->|"extracts article text"| node_extractor
node_app -->|"generates summaries"| node_summarizer
node_summarizer -->|"gets instructions"| node_language
node_summarizer -->|"requests generation"| node_openai
node_app -->|"generates downloads"| node_pdf
node_app -->|"saves digests"| node_database
node_app -->|"loads saved digests"| node_database

click node_app "https://github.com/moseskakuno/ai-news-assistant/blob/main/app.py"
click node_countries "https://github.com/moseskakuno/ai-news-assistant/blob/main/country_service.py"
click node_sources "https://github.com/moseskakuno/ai-news-assistant/blob/main/source_manager.py"
click node_discovery_service "https://github.com/moseskakuno/ai-news-assistant/blob/main/news_discovery.py"
click node_dedup "https://github.com/moseskakuno/ai-news-assistant/blob/main/deduplicator.py"
click node_processor "https://github.com/moseskakuno/ai-news-assistant/blob/main/article_processor.py"
click node_extractor "https://github.com/moseskakuno/ai-news-assistant/blob/main/content_extractor.py"
click node_language "https://github.com/moseskakuno/ai-news-assistant/blob/main/language_service.py"
click node_summarizer "https://github.com/moseskakuno/ai-news-assistant/blob/main/ai_summarizer.py"
click node_database "https://github.com/moseskakuno/ai-news-assistant/blob/main/news_database.py"
click node_pdf "https://github.com/moseskakuno/ai-news-assistant/blob/main/pdf_generator.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_app toneBlue
class node_countries,node_sources,node_discovery_service,node_dedup,node_processor,node_extractor toneAmber
class node_language,node_summarizer,node_openai toneMint
class node_database,node_pdf toneRose
class node_reader,node_publishers toneIndigo
```

## Components

### Application

- [Streamlit app](https://github.com/moseskakuno/ai-news-assistant/blob/main/app.py): `app.py`

### News discovery

- [Country settings](https://github.com/moseskakuno/ai-news-assistant/blob/main/country_service.py): `country_service.py`
- [RSS sources](https://github.com/moseskakuno/ai-news-assistant/blob/main/source_manager.py): `source_manager.py`
- [News discovery](https://github.com/moseskakuno/ai-news-assistant/blob/main/news_discovery.py): `news_discovery.py`
- [Article deduplication](https://github.com/moseskakuno/ai-news-assistant/blob/main/deduplicator.py): `deduplicator.py`
- [Article processing](https://github.com/moseskakuno/ai-news-assistant/blob/main/article_processor.py): `article_processor.py`
- [Article extraction](https://github.com/moseskakuno/ai-news-assistant/blob/main/content_extractor.py): `content_extractor.py`

### Summarization

- [Language rules](https://github.com/moseskakuno/ai-news-assistant/blob/main/language_service.py): `language_service.py`
- [AI summaries](https://github.com/moseskakuno/ai-news-assistant/blob/main/ai_summarizer.py): `ai_summarizer.py`

### Persistence and export

- [SQLite store](https://github.com/moseskakuno/ai-news-assistant/blob/main/news_database.py): `news_database.py`
- [PDF generation](https://github.com/moseskakuno/ai-news-assistant/blob/main/pdf_generator.py): `pdf_generator.py`

### Other components

- **News reader**
- **RSS and publishers**
- **OpenAI API**

## Connections

- News reader → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Country settings: selects country (evidence: `README.md`)
- Streamlit app → News discovery: fetches news (evidence: `README.md`)
- News discovery → RSS sources: loads feeds (evidence: `news_discovery.py`)
- News discovery → Country settings: gets locale (evidence: `news_discovery.py`)
- News discovery → RSS and publishers: requests RSS (evidence: `news_discovery.py`)
- News discovery → Article deduplication: deduplicates (evidence: `news_discovery.py`)
- Streamlit app → Article processing: processes articles (evidence: `app.py`)
- Streamlit app → SQLite store: saves and loads (evidence: `app.py`)
- Streamlit app → Article extraction: extracts article text (evidence: `README.md`)
- Streamlit app → AI summaries: generates summaries (evidence: `README.md`)
- AI summaries → Language rules: gets instructions (evidence: `ai_summarizer.py`)
- AI summaries → OpenAI API: requests generation (evidence: `ai_summarizer.py`)
- Streamlit app → PDF generation: generates downloads (evidence: `app.py`)
- Streamlit app → SQLite store: saves digests (evidence: `README.md`)
- Streamlit app → SQLite store: loads saved digests (evidence: `README.md`)
