feat: cross-channel topic deduplication (dedup_topics)#30
Merged
Conversation
…t points Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
dedup_topicsboolean 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— newdedup_topics: bool = Falsefield onSettings; parsed fromconfig.yamlviasettings_dict.get("dedup_topics", False)src/grouper.py— whendedup_topicsis 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-separatedsourcefieldconfig.yaml.example— commented-outdedup_topics: falseentry with explanation, placed next todigest_modeanddigest_groupsREADME.md— new### dedup_topics — cross-channel deduplicationsubsection under Digest Modes with a config example and a concrete before/after explanationMotivation
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.TechandScience).dedup_topicsdelegates 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_topicsfalse(default)truesourcelists 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 skippeduv tool run ruff check src/ tests/— no issuesuv run mypy src/— no issues (20 source files)dedup_topics: truewith a real multi-channel digest and verify merged source attribution in output🤖 Generated with Claude Code