# 7642-bot/-electronic_news architecture

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

- Interactive diagram: https://gitdiagram.com/7642-bot/-electronic_news
- Repository: https://github.com/7642-bot/-electronic_news

## Overview

Electronics Technology Intelligence ingests electronics news and dictionary PDFs, indexes them in ChromaDB, and serves grounded technical summaries through a Streamlit demo. In the main user workflow, a query enters the LangGraph RAG application, is routed to news retrieval or dictionary lookup, then receives an LLM-generated summary and quality score. Separate UI capabilities support corpus search, RSS ingestion, and a LinUCB simulator. Fine-tuning is present as scaffolding. Some links, especially dictionary indexing and orchestration internals, are documented in the README rather than shown in sampled source.

Main entry points: [`app/pipeline/daily_pipeline.py`](https://github.com/7642-bot/-electronic_news/blob/main/app/pipeline/daily_pipeline.py) (Daily pipeline), [`streamlit_app.py`](https://github.com/7642-bot/-electronic_news/blob/main/streamlit_app.py) (Demo UI), [`app/rag/graph.py`](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/graph.py) (RAG orchestrator), [`app/rag/nodes.py`](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py) (News retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User experience"]
  node_streamlit["Demo UI<br/>[streamlit_app.py]"]
end

subgraph group_ingest["Ingestion and indexing"]
  node_rss_fetch["RSS fetcher<br/>[rss_fetcher.py]"]
  node_dedup["Deduplication<br/>[deduplicator.py]"]
  node_articles[("Article corpus")]
  node_dict_load["Dictionary loader"]
  node_indexer["Vector indexer<br/>[vector_indexer.py]"]
  node_chroma[("ChromaDB")]
  node_pipeline["Daily pipeline<br/>[daily_pipeline.py]"]
end

subgraph group_rag["Grounded summaries"]
  node_rag_graph["RAG orchestrator<br/>[graph.py]"]
  node_rag_state["RAG state<br/>[state.py]"]
  node_router["Query router<br/>[nodes.py]"]
  node_news_retriever["News retrieval<br/>[nodes.py]"]
  node_dict_retriever["Dictionary lookup<br/>[nodes.py]"]
  node_summary["Summary generation<br/>[nodes.py]"]
  node_quality["Quality verification<br/>[nodes.py]"]
end

subgraph group_personalize["Personalization"]
  node_bandit["LinUCB bandit<br/>[linucb.py]"]
end

subgraph group_training["Fine-tuning"]
  node_dataset_builder["Dataset builder<br/>[dataset_builder.py]"]
  node_trainer["QLoRA trainer<br/>[train_qlora.py]"]
end

node_user(("User"))
node_feeds["RSS feeds"]
node_pdfs["Dictionary PDFs"]
node_groq["Groq LLM"]
node_settings["Application settings<br/>[settings.py]"]

node_user -->|"uses"| node_streamlit
node_streamlit -->|"submits query"| node_rag_graph
node_streamlit -->|"searches corpus"| node_chroma
node_streamlit -->|"triggers ingestion"| node_pipeline
node_streamlit -->|"simulates preferences"| node_bandit
node_feeds -->|"provides articles"| node_rss_fetch
node_pipeline -->|"fetches feeds"| node_rss_fetch
node_pipeline -->|"deduplicates articles"| node_dedup
node_dedup -->|"appends articles"| node_articles
node_pipeline -->|"reads corpus"| node_articles
node_pdfs -->|"loads PDFs"| node_dict_load
node_dict_load -->|"chunks documents"| node_indexer
node_pipeline -->|"indexes news"| node_indexer
node_indexer -->|"writes vectors"| node_chroma
node_pipeline -->|"summarizes articles"| node_rag_graph
node_rag_graph -->|"routes queries"| node_router
node_router -->|"routes news"| node_news_retriever
node_router -->|"routes definitions"| node_dict_retriever
node_news_retriever -->|"retrieves news"| node_chroma
node_dict_retriever -->|"retrieves definitions"| node_chroma
node_news_retriever -->|"provides context"| node_summary
node_dict_retriever -->|"provides context"| node_summary
node_summary -->|"generates summary"| node_groq
node_quality -->|"rates summary"| node_groq
node_rag_graph -->|"verifies output"| node_quality
node_rag_graph -.->|"passes state"| node_rag_state
node_settings -->|"configures feeds"| node_rss_fetch
node_settings -->|"configures index"| node_indexer
node_settings -->|"configures retrieval"| node_news_retriever
node_dataset_builder -->|"loads dictionary pages"| node_dict_load
node_dataset_builder -.->|"creates training data"| node_trainer

click node_streamlit "https://github.com/7642-bot/-electronic_news/blob/main/streamlit_app.py"
click node_rss_fetch "https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/rss_fetcher.py"
click node_dedup "https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/deduplicator.py"
click node_articles "https://github.com/7642-bot/-electronic_news/tree/main/data/processed"
click node_dict_load "https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/dictionary_loader.py"
click node_indexer "https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/vector_indexer.py"
click node_chroma "https://github.com/7642-bot/-electronic_news/tree/main/chroma_db"
click node_pipeline "https://github.com/7642-bot/-electronic_news/blob/main/app/pipeline/daily_pipeline.py"
click node_rag_graph "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/graph.py"
click node_rag_state "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/state.py"
click node_router "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py"
click node_news_retriever "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py"
click node_dict_retriever "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py"
click node_summary "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py"
click node_quality "https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py"
click node_bandit "https://github.com/7642-bot/-electronic_news/blob/main/app/bandit/linucb.py"
click node_dataset_builder "https://github.com/7642-bot/-electronic_news/blob/main/app/finetuning/dataset_builder.py"
click node_trainer "https://github.com/7642-bot/-electronic_news/blob/main/app/finetuning/train_qlora.py"
click node_settings "https://github.com/7642-bot/-electronic_news/blob/main/app/config/settings.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_streamlit,node_user toneBlue
class node_rss_fetch,node_dedup,node_articles,node_dict_load,node_indexer,node_chroma,node_pipeline toneAmber
class node_rag_graph,node_rag_state,node_router,node_news_retriever,node_dict_retriever,node_summary,node_quality toneMint
class node_bandit toneRose
class node_dataset_builder,node_trainer,node_feeds,node_pdfs,node_groq toneIndigo
class node_settings toneTeal
```

## Components

### User experience

- [Demo UI](https://github.com/7642-bot/-electronic_news/blob/main/streamlit_app.py): `streamlit_app.py`

### Ingestion and indexing

- [RSS fetcher](https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/rss_fetcher.py): `app/ingestion/rss_fetcher.py`
- [Deduplication](https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/deduplicator.py): `app/ingestion/deduplicator.py`
- [Article corpus](https://github.com/7642-bot/-electronic_news/tree/main/data/processed): `data/processed`
- [Dictionary loader](https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/dictionary_loader.py): `app/ingestion/dictionary_loader.py`
- [Vector indexer](https://github.com/7642-bot/-electronic_news/blob/main/app/ingestion/vector_indexer.py): `app/ingestion/vector_indexer.py`
- [ChromaDB](https://github.com/7642-bot/-electronic_news/tree/main/chroma_db): `chroma_db`
- [Daily pipeline](https://github.com/7642-bot/-electronic_news/blob/main/app/pipeline/daily_pipeline.py): `app/pipeline/daily_pipeline.py`

### Grounded summaries

- [RAG orchestrator](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/graph.py): `app/rag/graph.py`
- [RAG state](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/state.py): `app/rag/state.py`
- [Query router](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py): `app/rag/nodes.py`
- [News retrieval](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py): `app/rag/nodes.py`
- [Dictionary lookup](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py): `app/rag/nodes.py`
- [Summary generation](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py): `app/rag/nodes.py`
- [Quality verification](https://github.com/7642-bot/-electronic_news/blob/main/app/rag/nodes.py): `app/rag/nodes.py`

### Personalization

- [LinUCB bandit](https://github.com/7642-bot/-electronic_news/blob/main/app/bandit/linucb.py): `app/bandit/linucb.py`

### Fine-tuning

- [Dataset builder](https://github.com/7642-bot/-electronic_news/blob/main/app/finetuning/dataset_builder.py): `app/finetuning/dataset_builder.py`
- [QLoRA trainer](https://github.com/7642-bot/-electronic_news/blob/main/app/finetuning/train_qlora.py): `app/finetuning/train_qlora.py`

### Other components

- **User**
- **RSS feeds**
- **Dictionary PDFs**
- **Groq LLM**
- [Application settings](https://github.com/7642-bot/-electronic_news/blob/main/app/config/settings.py): `app/config/settings.py`

## Connections

- User → Demo UI: uses (evidence: `README.md`)
- Demo UI → RAG orchestrator: submits query (evidence: `streamlit_app.py`)
- Demo UI → ChromaDB: searches corpus (evidence: `streamlit_app.py`)
- Demo UI → Daily pipeline: triggers ingestion (evidence: `streamlit_app.py`)
- Demo UI → LinUCB bandit: simulates preferences (evidence: `streamlit_app.py`)
- RSS feeds → RSS fetcher: provides articles (evidence: `app/ingestion/rss_fetcher.py`)
- Daily pipeline → RSS fetcher: fetches feeds (evidence: `app/pipeline/daily_pipeline.py`)
- Daily pipeline → Deduplication: deduplicates articles (evidence: `app/pipeline/daily_pipeline.py`)
- Deduplication → Article corpus: appends articles (evidence: `app/ingestion/deduplicator.py`)
- Daily pipeline → Article corpus: reads corpus (evidence: `app/pipeline/daily_pipeline.py`)
- Dictionary PDFs → Dictionary loader: loads PDFs (evidence: `README.md`)
- Dictionary loader → Vector indexer: chunks documents (evidence: `README.md`)
- Daily pipeline → Vector indexer: indexes news (evidence: `app/pipeline/daily_pipeline.py`)
- Vector indexer → ChromaDB: writes vectors (evidence: `app/ingestion/vector_indexer.py`)
- Daily pipeline → RAG orchestrator: summarizes articles (evidence: `app/pipeline/daily_pipeline.py`)
- RAG orchestrator → Query router: routes queries (evidence: `README.md`)
- Query router → News retrieval: routes news (evidence: `README.md`)
- Query router → Dictionary lookup: routes definitions (evidence: `README.md`)
- News retrieval → ChromaDB: retrieves news (evidence: `app/rag/nodes.py`)
- Dictionary lookup → ChromaDB: retrieves definitions (evidence: `app/rag/nodes.py`)
- News retrieval → Summary generation: provides context (evidence: `README.md`)
- Dictionary lookup → Summary generation: provides context (evidence: `README.md`)
- Summary generation → Groq LLM: generates summary (evidence: `app/rag/nodes.py`)
- Quality verification → Groq LLM: rates summary (evidence: `app/rag/nodes.py`)
- RAG orchestrator → Quality verification: verifies output (evidence: `README.md`)
- RAG orchestrator → RAG state: passes state
- Application settings → RSS fetcher: configures feeds (evidence: `app/ingestion/rss_fetcher.py`)
- Application settings → Vector indexer: configures index (evidence: `app/ingestion/vector_indexer.py`)
- Application settings → News retrieval: configures retrieval (evidence: `app/rag/nodes.py`)
- Dataset builder → Dictionary loader: loads dictionary pages (evidence: `app/finetuning/dataset_builder.py`)
- Dataset builder → QLoRA trainer: creates training data
