~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
Remove unused simple_feed.py placeholder module
LearningCircuit3b77f31fc217
diff --git a/src/local_deep_research/news/recommender/simple_feed.py b/src/local_deep_research/news/recommender/simple_feed.pydeleted file mode 100644index e6fc0558f5..0000000000--- a/src/local_deep_research/news/recommender/simple_feed.py+++ /dev/null@@ -1,300 +0,0 @@-"""-Simple news feed generator that doesn't require search operations.-Used for quick feed generation and testing.-"""--from loguru import logger-from typing import Dict, Any, List, Optional-from datetime import datetime, timezone-import uuid--from ..core.base_card import NewsCard---def generate_simple_news_feed(- user_id: str = "anonymous", limit: int = 10, focus: Optional[str] = None-) -> List[Dict[str, Any]]:- """- Generate a simple news feed without performing searches.- Returns mock/cached news items for quick display.-- Args:- user_id: User identifier- limit: Number of items to return- focus: Optional focus area-- Returns:- List of news item dictionaries- """- # Default news categories and templates- news_templates = [- {- "category": "Technology",- "headlines": [- "AI Model Achieves Breakthrough in Natural Language Understanding",- "Major Tech Company Announces Revolutionary Quantum Computing Advance",- "New Cybersecurity Threat Discovered Affecting Millions",- "Open Source Project Transforms Software Development",- "Breakthrough in Battery Technology Promises Longer Device Life",- ],- "impact_scores": [8, 9, 7, 6, 7],- },- {- "category": "Science",- "headlines": [- "Scientists Discover New Method for Carbon Capture",- "Medical Researchers Announce Progress in Cancer Treatment",- "Space Telescope Reveals Unexpected Cosmic Phenomenon",- "Climate Study Shows Accelerating Environmental Changes",- "New Material Discovery Could Revolutionize Electronics",- ],- "impact_scores": [8, 9, 7, 8, 6],- },- {- "category": "Business",- "headlines": [- "Global Markets React to New Economic Policy Changes",- "Major Corporation Announces Strategic Merger",- "Startup Ecosystem Shows Record Growth in Key Sectors",- "Supply Chain Innovations Transform Global Trade",- "Financial Technology Breakthrough Disrupts Traditional Banking",- ],- "impact_scores": [7, 8, 6, 7, 8],- },- ]-- # Generate news items- news_items = []- item_count = 0-- for template in news_templates:- if item_count >= limit:- break-- # Apply focus filter if specified- if focus and focus.lower() not in template["category"].lower():- continue-- for i, headline in enumerate(template["headlines"]):- if item_count >= limit:- break-- # Create news item with findings in markdown format- findings_markdown = f"""## {headline}--### Key Findings--Recent developments in the **{template["category"].lower()}** sector demonstrate significant progress:--- **Primary Impact**: {headline} represents a major advancement affecting multiple stakeholders-- **Industry Implications**: This development could reshape how organizations approach {template["category"].lower()} challenges-- **Timeline**: Changes expected to roll out over the coming months--### Analysis--This breakthrough addresses several critical areas:--1. **Innovation Factor**: Breaking new ground in established practices-2. **Market Response**: Early indicators show positive reception from key players-3. **Future Outlook**: Experts predict continued evolution in this space--### What This Means--> "{headline}" - This development signals a shift in how we understand and interact with {template["category"].lower()} innovations.--**Impact Assessment**: Rated {template["impact_scores"][i]}/10 based on potential industry transformation and stakeholder benefits.--### Next Steps--- Monitor implementation progress-- Track industry adoption rates-- Assess competitive responses-"""-- news_item = {- "id": f"news-{uuid.uuid4().hex[:8]}",- "headline": headline,- "category": template["category"],- "summary": f"Recent developments in {template['category'].lower()} "- f"sector show significant progress. {headline} represents "- f"a major advancement that could impact various industries "- f"and stakeholders. Experts are closely monitoring the situation "- f"for further developments.",- "findings": findings_markdown,- "impact_score": template["impact_scores"][i],- "time_ago": f"{(i + 1) * 2} hours ago",- "upvotes": 0,- "downvotes": 0,- "source_url": None,- "topics": [- template["category"],- "Breaking News",- "Latest Updates",- ],- }-- news_items.append(news_item)- item_count += 1-- # If no items match focus, provide general feed- if not news_items and focus:- logger.info(f"No items for focus '{focus}', providing general feed")- return generate_simple_news_feed(user_id, limit, None)-- return news_items---def create_placeholder_card(- headline: str, category: str, summary: str, impact_score: int = 5-) -> NewsCard:- """- Create a placeholder news card for testing.-- Args:- headline: News headline- category: News category- summary: Brief summary- impact_score: Impact rating (1-10)-- Returns:- NewsCard instance- """- card = NewsCard(headline=headline, summary=summary, card_type="news")-- # Set additional attributes- card.category = category- card.impact_score = impact_score- card.created_at = datetime.now(timezone.utc)- card.source = "placeholder"-- # Initialize interaction data- if not hasattr(card, "interaction"):- card.interaction = {- "votes_up": 0,- "votes_down": 0,- "views": 0,- "shares": 0,- }-- return card---def get_cached_news_feed(- storage_manager, user_id: str, limit: int-) -> List[NewsCard]:- """- Get cached news feed from storage.-- Args:- storage_manager: Storage manager instance- user_id: User identifier- limit: Maximum items to return-- Returns:- List of NewsCard instances- """- try:- # Try to get cached cards- cached_cards = storage_manager.get_user_feed(- user_id=user_id, limit=limit, card_types=["news"]- )-- if cached_cards:- logger.info(- f"Found {len(cached_cards)} cached news items for user {user_id}"- )- return cached_cards-- except Exception as e:- logger.error(f"Error getting cached feed: {e}")-- return []---def generate_welcome_feed() -> List[Dict[str, Any]]:- """- Generate a welcome feed for new users.-- Returns:- List of welcome news items- """- welcome_items = [- {- "id": "welcome-1",- "headline": "Welcome to LDR News - Your AI-Powered Research Feed",- "category": "Introduction",- "summary": "LDR News aggregates and analyzes breaking news from across "- "the web, providing you with personalized, real-time updates "- "on topics that matter to you. Get started by searching for "- "topics or creating subscriptions.",- "findings": """## Welcome to LDR News--### What is LDR News?--LDR News is your **personalized AI-powered research assistant** that transforms how you consume and understand news:--- **Smart Curation**: Automatically finds and analyzes breaking news based on your interests-- **Deep Insights**: Goes beyond headlines to provide comprehensive analysis with markdown-formatted findings-- **Learning System**: Adapts to your preferences through votes and interactions-- **Research Integration**: Seamlessly connects with LDR's powerful research capabilities--### Getting Started--1. **Search for Topics**: Use the search bar to find news on any topic-2. **Subscribe**: Click subscribe on interesting topics for automatic updates-3. **Vote**: Use thumbs up/down to train the system-4. **Research**: Click "Research" on any item for deeper analysis--### Key Features--- **Real-time Updates**: Fresh news from trusted sources-- **Markdown Rendering**: Beautiful formatting for easy reading (just like research results)-- **Impact Scoring**: Understand the significance of each story-- **Category Filtering**: Focus on what matters to you--> "Turn information overload into actionable insights with LDR News"--### Try It Now!--Search for any topic in the search bar above to see LDR News in action. Each news card displays findings in a clean, readable format similar to research results pages.-""",- "impact_score": 10,- "time_ago": "Just now",- "upvotes": 0,- "downvotes": 0,- "source_url": None,- "topics": ["Getting Started", "LDR News", "Tutorial"],- },- {- "id": "welcome-2",- "headline": "Create Personalized News Subscriptions",- "category": "Features",- "summary": "Stay updated on your interests by creating custom subscriptions. "- "Choose between search-based subscriptions for specific queries "- "or topic-based subscriptions for broader areas of interest. "- "Click 'Create Subscription' to get started.",- "impact_score": 8,- "time_ago": "Just now",- "upvotes": 0,- "downvotes": 0,- "source_url": None,- "topics": ["Subscriptions", "Personalization", "Features"],- },- {- "id": "welcome-3",- "headline": "Search for Breaking News and Analysis",- "category": "Features",- "summary": "Use the search bar to find the latest news on any topic. "- "Our AI analyzes multiple sources to provide comprehensive "- "coverage and insights. Try searching for 'technology breakthroughs' "- "or click 'Today's Breaking News' for a curated table.",- "impact_score": 8,- "time_ago": "Just now",- "upvotes": 0,- "downvotes": 0,- "source_url": None,- "topics": ["Search", "Analysis", "Features"],- },- ]-- return welcome_items