Skip to main content
The news pipeline runs four sequential steps: fetch → extract → cluster → summarize. You can run all steps together, run individual steps to reprocess data, check run status, and manage the branch configurations that control pipeline behavior.

Pipeline steps

1

Fetch

Retrieves articles from your configured sources for the date range defined in the branch’s fetch_config. Articles are deduplicated by URL within a branch — re-fetching the same date range is safe.
2

Extract

Scores each unscored article for relevance (1–10) and extracts structured fields: event_type, primary_entity, and a short event_summary. Articles that meet the relevance threshold go into the relevant bucket; the rest go to discard.
3

Cluster

Groups relevant articles into events based on semantic similarity. New articles are matched against events from the last 72 hours so that ongoing stories accumulate articles across daily runs rather than creating duplicate events.
4

Summarize

Generates a headline label and a structured intelligence brief for each event that does not yet have one. The brief includes sections for “The news”, “Why it matters”, and “Context”.

Running the pipeline

Run the full pipeline

Run all four steps against the production branch:
Run against a specific branch:

Run specific steps

Pass a steps list to run only certain steps. This is useful when you want to re-score or re-cluster without re-fetching.
Valid step names are fetch, extract, cluster, and summarize. When you run a subset of steps, each step operates on whatever data is already in the branch — for example, running extract without fetch scores articles already stored from a prior fetch.

Backfills with date ranges

Use date_from and date_to to fetch articles for a specific date range. This overrides the branch’s days_back setting.
date_to defaults to today if omitted. Both values use YYYY-MM-DD format.

Checking run status

The response includes the latest run’s status (pending, running, completed, or failed), the current step if still running, and counts for articles fetched, articles scored, and events created.

Managing branches

List all branches

The production branch is marked [PRODUCTION] in the output.

Get branch details

Returns the branch name, schedule status, description, and fetch_config.

Create a branch

You can pass a config dict with any branch fields:

Clone the production branch

Cloning copies the production branch’s full configuration — including its fetch_config, prompts, and clustering settings — into a new branch. This is the recommended way to start a new experiment.

Update a branch

You can update the branch name by passing name directly:

Enable a schedule

Custom branches can run on their own schedule using standard cron syntax. The schedule_timezone field defaults to America/New_York.

Delete a branch

You cannot delete the production branch. Deleting a branch removes all articles and events stored under it.

Branch config reference


Viewing events

Events are clusters of related articles that the pipeline has grouped around a single real-world occurrence. Each event has a label, a structured summary, and an article count.

List events

Filter by status:
Limit results and target a specific branch:
The output shows each event’s label, article count, and a truncated preview of its summary.

Viewing articles

Articles are individual news items with a relevance score and bucket classification.

List articles

Filter by bucket:
Limit results and target a specific branch:
Each article in the output shows its relevance score (e.g. [8]), bucket, title, source name, and URL.
Use bucket="discard" with a custom extraction_prompt on a test branch to tune your scoring threshold. Run news_pipeline(action="run", steps=["extract"]) after updating the prompt to re-score existing articles without re-fetching.

Production schedule

The production branch runs automatically on its configured schedule. You do not need to trigger it manually. After each scheduled run, if newsletter_audience_ids are configured on the branch, Soria automatically sends a newsletter with the latest events. To check when the production branch last ran: