How kwu5/finnews-rag works
FinNews-RAG ingests financial news, builds a chunk-level vector index, and serves grounded Q&A with citations and abstention. Its main workflow runs through the pipeline: fetch news, normalize and deduplicate articles, persist them, then chunk and index them. The Q&A interface retrieves from that index and passes evidence to the answer generator. A separate evaluation branch measures retrieval and generation quality and compares configurations; scheduled jobs and an API expose the daily briefing capability. Edges reflect README statements and shown source references; unsampled subsystem details are limited to documented capabilities.
Main entry points: pipeline.py Ingestion pipeline · harness.py Evaluation harness · app.py Q&A demo · qa.py Grounded QA engine
Components 28
News ingestion
- Ingestion pipeline
src/pipeline.py - RSS reader
src/ingestion/rss_reader.py - News API client
src/ingestion/world_news_api.py - Article extractor
src/ingestion/extractor.py
Article indexing
- Text cleaner
src/processing/cleaner.py - URL canonicalizer
src/processing/url_canon.py - Content hashing
src/processing/content_hash.py - Article deduplicator
src/processing/deduplicator.py - Article database
src/storage/database.py - Article chunker
src/rag/chunker.py - Embedding generator
src/processing/embeddings.py - Chunk vector store
src/storage/vector_store.py
Grounded Q&A
- Q&A demo
app.py - Chunk retriever
src/rag/retriever.py - Grounded QA engine
src/rag/qa.py - LLM client
src/summarization/llm_client.py
Briefing delivery
- Briefing generator
src/summarization/report_generator.py - Briefing API
src/api/main.py - Daily scheduler
src/scheduler/jobs.py
Quality evaluation
- Evaluation harness
src/evaluation/harness.py - Configuration sweep
src/evaluation/sweep.py - Labeled test set
src/evaluation/testset.py - Generation judge
src/evaluation/judge.py - Retrieval metrics
src/evaluation/metrics.py
Other components
- User
- RSS feeds
- World News API
- OpenAI
Connections 39
- User → Q&A demo: asks
app.py - Q&A demo → Grounded QA engine: submits query
app.py - Ingestion pipeline → RSS reader: fetches feeds
src/pipeline.py - RSS reader → RSS feeds: reads feeds
README.md - RSS reader → Article extractor: extracts articles
src/ingestion/rss_reader.py - Ingestion pipeline → News API client: falls back
src/pipeline.py - News API client → World News API: fetches news
README.md - Ingestion pipeline → URL canonicalizer: canonicalizes URLs
src/pipeline.py - Ingestion pipeline → Text cleaner: cleans text
src/pipeline.py - Ingestion pipeline → Content hashing: hashes content
src/pipeline.py - Ingestion pipeline → Article deduplicator: deduplicates articles
src/pipeline.py - Article deduplicator → Embedding generator: compares similarity
src/processing/deduplicator.py - Ingestion pipeline → Article database: saves articles
src/pipeline.py - Ingestion pipeline → Article chunker: chunks articles
src/pipeline.py - Ingestion pipeline → Article database: loads unindexed
src/pipeline.py - Ingestion pipeline → Embedding generator: embeds chunks
src/pipeline.py - Ingestion pipeline → Chunk vector store: indexes chunks
src/pipeline.py - Q&A demo → Embedding generator: initializes
app.py - Q&A demo → Chunk vector store: initializes
app.py - Q&A demo → LLM client: initializes
app.py - Grounded QA engine → Chunk retriever: retrieves context
src/rag/qa.py - Chunk retriever → Embedding generator: embeds query
src/rag/retriever.py - Chunk retriever → Chunk vector store: searches chunks
src/rag/retriever.py - Grounded QA engine → LLM client: generates answer
src/rag/qa.py - LLM client → OpenAI: calls model
src/summarization/llm_client.py - Grounded QA engine → Q&A demo: returns citations
app.py - Ingestion pipeline → Briefing generator: generates briefing
src/pipeline.py - Briefing generator → LLM client: summarizes news
README.md - User → Briefing API: requests briefing
src/api/main.py - Briefing API → Ingestion pipeline: runs pipeline
src/api/main.py - Daily scheduler → Ingestion pipeline: runs daily
src/scheduler/jobs.py - Evaluation harness → Chunk retriever: measures retrieval
src/evaluation/harness.py - Evaluation harness → Grounded QA engine: evaluates answers
src/evaluation/harness.py - Evaluation harness → Labeled test set: loads queries
src/evaluation/harness.py - Evaluation harness → Retrieval metrics: computes scores
src/evaluation/harness.py - Evaluation harness → Generation judge: judges generations
src/evaluation/harness.py - Configuration sweep → Evaluation harness: compares configurations
src/evaluation/sweep.py - Configuration sweep → Article chunker: varies chunking
src/evaluation/sweep.py - Configuration sweep → Chunk vector store: builds indexes
src/evaluation/sweep.py