Set medoids and clear thresholds in Qdrant to spot outliers in crop clusters. This helps data teams build stable anomaly rules without hand tuning every group. It works for image or text embeddings stored in a vector database.
The run starts on click. It gathers total points and crop counts, then splits by each crop name. For each group, it calls the Qdrant distance matrix, builds a sparse matrix in Python, picks the medoid, marks it in Qdrant, gets its vector, then measures distances to set a threshold using the Nth furthest point. A second branch embeds simple text crop descriptions with Voyage AI, finds a medoid by text, and sets a matching threshold. Results from both paths are merged to keep numeric and text logic aligned.
You need Qdrant with a collection that has a crop_name field and vectors indexed for voyage. You also need a Voyage AI key for the text step. Expect faster rollout of anomaly checks, fewer manual reviews, and reliable limits per cluster. Good for quality control on farm imagery, dataset cleanup, and watching for changes over time in data.