Skip to main content

deduplicate_topics

Function
This function is defined in the manager module.
Programmatic deduplication of topics/items before agent processing. This helps prevent duplicate content from being passed to downstream agents, reducing token waste and improving quality.

Signature

def deduplicate_topics(topics: list, key: str, similarity_threshold: float) -> list

Parameters

topics
list
required
List of topic dicts or strings
key
str
default:"'title'"
Key to use for comparison if topics are dicts (default: “title”)
similarity_threshold
float
default:"0.8"
Similarity threshold for fuzzy matching (0.0-1.0)

Returns

Returns
list
Deduplicated list of topics