← Back to docs
agents.md

Pipeline Architecture

Design

Single Python script (scripts/run.py) with sequential steps. No agent framework — just Anthropic API calls with structured prompts. Prompts live in prompts/*.md and are loaded at runtime for easy iteration.

Pipeline Steps

1. Ingest (no API call)

Fetches 16 RSS feeds via feedparser. Deduplicates by URL and content hash. Stores new headlines in SQLite.

2. Filter + Rank (1 Haiku 4.5 call)

Prompt: prompts/filter.md

Bulk filters ~100-300 headlines down to top 20 structural trends. Rejects breaking news, one-off events, political actions, price movements. Includes trend-level dedup via active cluster list.

3. Decay (no API call)

Applies time decay (-3 points/day) to scored headlines. Expires those below threshold.

4. Score (1-4 Opus 4.6 calls)

Prompt: prompts/score.md

Scores headlines on trend strength, relatability, novelty, and company mapping. Assigns trend_cluster labels and suggests tickers. Context-aware: sees recent tickers and clusters to avoid repetition.

5. Write (3 Opus 4.6 calls)

Prompt: prompts/write.md

Selects top 3 candidates with diversity constraints (no trend/ticker overlap). Writes sequentially — each article sees the previous ones. Produces markdown articles with company picks and sources.

Models

| Step | Model | Why |

|---|---|---|

| Filter | Haiku 4.5 | Cheap bulk filtering, doesn't need deep judgment |

| Score | Opus 4.6 | Editorial judgment on ticker quality, trend classification |

| Write | Opus 4.6 | Prose quality, style adherence, context handling |

Future Agents (not built yet)