Building Topic Discovery into the Hex Context Agent

This post details the evolution and rebuilding of the topic discovery system within the Hex Context Agent. Initially, a complex ML approach using embeddings and HDBSCAN was considered but deemed too infrastructure-heavy. The system was then rebuilt using a simpler, two-stage LLM approach: first, an LLM proposes topics based on thread summaries, and second, another LLM classifies threads into these proposed topics. This approach was refined by splitting discovery and classification into separate LLM calls, significantly improving topic quality and enabling stable, recurring topic generation. The current system runs topic discovery every 2-3 days for organizations with sufficient thread activity, classifying new threads and incorporating them into an incremental discovery pool for potential reclassification. Future work includes hierarchical clustering, upfront topic classification for proactive context injection, and topic-specific eval suites.