Engineering Intelligent News Filtering: Practical Challenges Beyond Plugin Infrastructure

    This article explains what a plugin host handles for a news filtering app, including model access, data storage, scheduled execution, UI integration, and lifecycle management. It then covers the harder problems that remain: noise in information sources, scoring stability and cost, ranking and deduplication, and scheduled delivery. It ends with a checklist for production use.

    1. What the Infrastructure Solves and What It Leaves Behind

    The value of a plugin host lies in consolidating repetitive work in one place. For a news filtering app, developers typically need to handle the following tasks at first:

    • Model access: managing endpoint addresses, access credentials, quotas, and retry policies;
    • Data persistence: choosing a storage format, planning file paths, and handling read and write permissions;
    • Scheduled execution: triggering tasks at fixed times and recovering after a process restart;
    • UI integration: finding a suitable place for action entry points and keeping them consistent with the host’s visual style;
    • Lifecycle management: deciding how data should be kept or cleaned up during installation, upgrade, and uninstallation.

    When the host provides these capabilities as standard services, plugin code can focus on business logic. This division of labor brings two direct benefits. First, credentials do not reside in plugin code or logs, which reduces the risk of leakage. Second, data is stored in a dedicated directory allocated by the host and is removed with the plugin, leaving no leftover files.

    However, the infrastructure only solves the question of whether the app can run. Whether a news app actually saves users time depends on several harder stages.

    2. A Typical Plugin Structure

    The following sample code shows how a plugin interacts with the host. All interface names are for illustration only and do not correspond to any real product’s API.

    1. # Sample code: interface names are chosen for illustration only
    2. class NewsFeedPlugin:
    3. def __init__(self, context):
    4. self.llm = context.get_service("llm") # Model service hosted by the host
    5. self.store = context.get_storage("news-feed") # Dedicated storage directory allocated by the host
    6. self.scheduler = context.get_service("schedule")
    7. def register(self):
    8. # Register action buttons at the UI location reserved by the host
    9. self.scheduler.add_job("morning_digest", cron="0 8 * * *", handler=self.run_digest)
    10. self.scheduler.add_job("evening_digest", cron="0 20 * * *", handler=self.run_digest)
    11. def run_digest(self):
    12. items = self.fetch_candidates()
    13. scored = [self.score(item) for item in items]
    14. ranked = self.rank(scored)
    15. self.store.save("latest.json", ranked)
    16. return ranked

    This structure has three key points. First, the plugin never touches raw credentials and only invokes capabilities through service handles. Second, storage is referenced by name, so the plugin does not need to know absolute paths. Third, scheduled tasks are decoupled from business functions, which makes them easier to test in isolation.

    3. Challenge One: Managing Noise in Information Sources

    The first problem in news crawling is input quality. The same event is often reposted across multiple sites, with similar headlines but very different body text. A large amount of marketing content is also mixed in. Sending all candidate content directly to the model wastes call quota and lets noise distort the results.

    Common processing steps include:

    1. Removing templated content, such as navigation text, copyright notices, and promotional blocks;
    2. Normalizing timestamp and source information into a comparable structure;
    3. Computing vector or keyword fingerprints for titles and body summaries, and merging highly similar items;
    4. Assigning source credibility weights, and lowering the priority of sources that consistently provide low-quality content.

    Source weights should be based on observable metrics, such as the historical accuracy of updates and users’ click and feedback records. Scoring sources on subjective impressions introduces bias and makes the results hard to explain later.

    4. Challenge Two: Scoring Stability and Cost

    Scoring is the core of the pipeline, and it is the stage most often underestimated. Asking a model to output a single number directly produces unstable results. The same article may receive different scores across two calls, and the score distribution can shift significantly with small prompt changes.

    Several approaches can improve stability.

    Fix the scoring dimensions. Break “value” down into dimensions such as relevance, freshness, information gain, and credibility. Have the model produce a structured result for each dimension separately, then combine the results by weight. When a result looks wrong, this makes it possible to identify which dimension caused the problem.

    Constrain the output format. Require the model to return data in a fixed structure, and retry or fall back when parsing fails. Keep parsing logic in its own function so it can be tested.

    Control call volume. Filter out clearly irrelevant items with rules first, then send the remaining candidates to the model. Cache results for identical content so that the morning and evening digests do not recompute them.

    1. def score(self, item):
    2. if item.cache_key in self.cache:
    3. return self.cache[item.cache_key]
    4. prompt = build_prompt(item, dimensions=["relevance", "freshness", "novelty", "credibility"])
    5. raw = self.llm.complete(prompt)
    6. result = parse_scores(raw) # Raise a clear exception on parse failure, and let the caller decide whether to retry or skip
    7. result.total = weighted_sum(result, WEIGHTS)
    8. self.cache[item.cache_key] = result
    9. return result

    For cost, log the latency and consumption of each call and aggregate them daily. When the cost of a particular task is clearly high, adjust the number of candidates or reduce the execution frequency instead of simply cutting features.

    5. Challenge Three: Ranking and Deduplication

    Items with equal scores need a deterministic order. Otherwise, each generated list shifts, and users lose trust in the results. The recommended approach is a primary score plus secondary rules. When primary scores tie, compare publication time, source weight, and title in lexicographic order, in that sequence, so the output is reproducible.

    Deduplication must distinguish two levels. Multiple reports on the same event should be merged into one item, keeping the most authoritative source link. Different events on related topics should be kept and presented in groups to help users browse. Treating the two the same way causes users to miss differentiated information within a single topic.

    After ranking, consider display density. The number of items and the category mix should differ between the morning and evening digests. The morning digest focuses on events that happened overnight, while the evening digest focuses on in-depth content from the day. These rules should be written into configuration rather than hard-coded in the ranking function.

    6. Scheduled Delivery and User Rhythm

    Scheduled task design should account for three kinds of exceptions: the host not running, task execution timing out, and the previous run not yet finishing. A sound approach is to generate a unique identifier for each execution, record start and end times, and check the status before the next trigger. If the previous run is still active, skip the current trigger and log it.

    Message delivery also needs restraint. Pushing too many messages in a row reduces users’ attention quality. Set a daily maximum number of items, and let users turn off certain categories. Each push should include a brief explanation of why the item ranked high, so users understand the reasoning behind the score and build trust in the results.

    7. Production Readiness Checklist

    Before putting this type of application into daily use, confirm the following items one by one:

    • Credentials are managed centrally by the host, and no keys appear in code or logs;
    • Storage paths are referenced by host-provided names, and the uninstall process has been verified;
    • Scoring dimensions and weights are documented, and historical results are kept for traceability;
    • Repeated calls for identical content are avoided through caching;
    • Ranking follows a deterministic ordering rule, so identical input produces identical output;
    • Scheduled tasks have protection against re-entry and timeout handling;
    • Daily call volume and latency are monitored, with alert thresholds set.

    8. Summary

    The host platform handles general work such as model access, data storage, scheduled execution, and UI mounting, so developers can focus on business judgment. Once the infrastructure is stable, three things determine the user experience: noise management for information sources, stable and explainable scoring, and well-paced ranking and delivery. These stages have no ready-made answers and need repeated calibration against specific users and content types. From an engineering standpoint, the most valuable step is to establish evaluation samples and a feedback mechanism early, and to judge every change by data rather than intuition.