{"id":15361402,"url":"https://github.com/muhd-umer/news-llm","last_synced_at":"2026-03-10T07:01:30.771Z","repository":{"id":251348550,"uuid":"836780646","full_name":"muhd-umer/news-llm","owner":"muhd-umer","description":"NewsLLM is a RAG-based LLM application designed to analyze and summarize news articles","archived":false,"fork":false,"pushed_at":"2024-12-10T11:44:22.000Z","size":23887,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T08:53:03.763Z","etag":null,"topics":["gemini","generative-ai","llm","news","rag"],"latest_commit_sha":null,"homepage":"https://news-llm.streamlit.app","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhd-umer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-01T14:41:01.000Z","updated_at":"2025-01-04T12:25:27.000Z","dependencies_parsed_at":"2024-12-10T12:34:09.250Z","dependency_job_id":null,"html_url":"https://github.com/muhd-umer/news-llm","commit_stats":{"total_commits":36,"total_committers":3,"mean_commits":12.0,"dds":0.4722222222222222,"last_synced_commit":"ff5cbd8068c5e5622186d3c5631eb49095852882"},"previous_names":["muhd-umer/news-llm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muhd-umer/news-llm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Fnews-llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Fnews-llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Fnews-llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Fnews-llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhd-umer","download_url":"https://codeload.github.com/muhd-umer/news-llm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhd-umer%2Fnews-llm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini","generative-ai","llm","news","rag"],"created_at":"2024-10-01T12:54:54.826Z","updated_at":"2026-03-10T07:01:30.709Z","avatar_url":"https://github.com/muhd-umer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/banner.png\" width=\"60%\"\u003e\n\u003c/p\u003e\n\nNewsLLM is a RAG-based LLM application designed to analyze and summarize news articles. It uses [Groq](https://groq.com/) API to generate summaries and insights for different countries and different topics. The application is built using Streamlit and Python.\n\n## How NewsLLM Works\n\nNewsLLM follows a robust workflow to provide accurate and insightful news summaries:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"resources/block.png\" width=\"90%\"\u003e\n\u003c/p\u003e\n\n1. **Data Acquisition**\n    - NewsLLM utilizes a custom web scraper (`scraper.py`) to gather news articles from various sources.\n    - The scraper targets specific countries and topics.\n    - For each topic and country combination, it scrapes up to _10 relevant news articles_ from Google Search results to ensure a diverse range of perspectives are considered.\n\n2. **Database** (ChromaDB)\n    - Scraped news articles are processed and stored in a vector database using the `Chroma` library.\n    - This database allows for efficient storage and retrieval of news articles based on their semantic similarity.\n    - Each article is represented as a vector embedding, capturing its core meaning and context.\n    - Database is updated automatically every 24 hours to ensure the information remains current.\n\n3. **Context Retrieval**\n    - When a user submits a query (country and topic), NewsLLM retrieves the most relevant articles from the database.\n    - User query is transformed into a vector embedding and compared against the embeddings of the stored articles.\n    - Top _k=7_ most similar articles are selected as the context for generating the summary and analysis.\n\n4. **Output Generation**\n    - NewsLLM utilizes the `Groq` API and uses the `llama-3.1-70b-versatile` model for output generation.\n    - Formed context is fed to the LLM, along with carefully constructed prompts designed to elicit a comprehensive summary and analysis.\n    - LLM generates a structured response covering key points, trends, context, impacts, controversies, statistical insights, global relevance, and future outlook.\n    - Users are also giving the option to continue asking follow-up questions, if desired.\n\n\n## Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/muhd-umer/news-llm.git\n    ```\n\n2. Install dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n    \n3. Obtain an API key for Groq and store it in a `.env` file as `GROQ_API_KEY=\"\u003cyour_api_key\u003e\"`.\n\n## Usage\n\n1. Create initial database as:\n    ```bash\n    python database.py\n    ```\n    \n2. Run the application using:\n    ```bash\n    streamlit run app.py\n    ```\n\n3. Select a country and topic from the sidebar.\n4. Click _\"Analyze news\"_ to generate a summary and analysis.\n5. Ask follow-up questions in the chat interface.\n\n## Tech Stack\n\n- **Streamlit:** For building the user interface.\n- **Python:** The primary programming language.\n- **Groq API:** For LLM-powered summary and analysis generation.\n- **Chroma:** For vector database storage and retrieval.\n- **Beautiful Soup:** For web scraping.\n- **Google Search:** For finding relevant news articles.\n- **LangChain:** For LLM orchestration and prompt management.\n\n## Contributing\n\nContributions are welcome! Please feel free to open issues and submit pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhd-umer%2Fnews-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhd-umer%2Fnews-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhd-umer%2Fnews-llm/lists"}