Skip to content

feat: cross-channel topic deduplication (dedup_topics)#30

Merged
belaytzev merged 2 commits into
mainfrom
feat/dedup-topics
May 5, 2026
Merged

feat: cross-channel topic deduplication (dedup_topics)#30
belaytzev merged 2 commits into
mainfrom
feat/dedup-topics

Conversation

@belaytzev

Copy link
Copy Markdown
Owner

Summary

Adds a new dedup_topics boolean setting (default: false) that instructs the AI grouper to deduplicate bullet points when multiple channels cover the same real-world event or story.

  • src/config_loader.py — new dedup_topics: bool = False field on Settings; parsed from config.yaml via settings_dict.get("dedup_topics", False)
  • src/grouper.py — when dedup_topics is enabled, a deduplication rule is injected into the grouper system prompt: keep only the most informative bullet point across all groups, merge contributing channel names into a comma-separated source field
  • config.yaml.example — commented-out dedup_topics: false entry with explanation, placed next to digest_mode and digest_groups
  • README.md — new ### dedup_topics — cross-channel deduplication subsection under Digest Modes with a config example and a concrete before/after explanation

Motivation

In digest mode (digest_mode: "digest"), the same breaking news or product launch can be reported by several monitored channels. Without deduplication each channel contributes its own bullet point, resulting in repetitive entries inside the same topic group — or worse, near-identical points scattered across different groups (e.g. Tech and Science). dedup_topics delegates the deduplication judgment to the AI, which already has full context of all channel summaries in a single prompt, making semantic similarity detection natural and free of extra API calls.

Behaviour

dedup_topics Result
false (default) Each channel contributes its own bullet point — existing behaviour, no change
true AI keeps one bullet per real-world event; source lists all contributing channels (e.g. "TechCrunch, HackerNews")

The setting has no effect in digest_mode: "channel".

Test plan

  • uv run pytest tests/ -x -q — 382 passed, 7 skipped
  • uv tool run ruff check src/ tests/ — no issues
  • uv run mypy src/ — no issues (20 source files)
  • Manual: enable dedup_topics: true with a real multi-channel digest and verify merged source attribution in output

🤖 Generated with Claude Code

…t points

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@belaytzev belaytzev self-assigned this May 5, 2026
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@belaytzev belaytzev merged commit 45010f9 into main May 5, 2026
5 checks passed
@belaytzev belaytzev deleted the feat/dedup-topics branch May 5, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant