Library / AI Agents & Assistants
AI Agents & Assistants
Classify Images with a Qdrant KNN Vector Classifier
When another workflow calls it with an image URL, it embeds the image, queries Qdrant for neighbors and decides the class by majority vote.
What it does
## KNN classification workflow-tool ### This n8n template takes an image URL (as anomaly detection tool does), and as output, it returns a class of the object on the image (out of land types list) * An image URL is received via the Execute Workflow Trigger, which is then sent to the Voyage.ai Multimodal Embeddings API to fetch its embedding. * The image's embedding vector is then used to query Qdrant, returning a set of X similar images with pre-labeled classes. * Majority voting is done for classes of neighbouring images. * A loop is used to resolve scenarios where there is a tie in Majority Voting (for example, we have 5 "forest" and 5 "beach"), and we increase the number of neighbours to retrieve. * When the loop finally resolves, the identified class is returned to the calling workflow.
The steps
- Embed image
- Query Qdrant
- Majority Vote
- Increase limitKNN
- Propagate loop variables
- Image Test URL
- Return class
- Check tie
- Qdrant variables + embedding + KNN neigbours
- Execute Workflow Trigger
- Error Handler
- Stopanderror 1
- Error Handler for 33373ccb
- Error Handler for 58adecfa
29 steps in total.
Similar automations
AI Agents & AssistantsClassify Images with a Qdrant KNN Vector Classifier29 stepsAI Agents & AssistantsClassify Land Images with a Qdrant KNN Tool10 stepsRAG & Knowledge BasesClassify Land Images with a KNN Qdrant Tool10 stepsRAG & Knowledge BasesEmbed Image Datasets into Qdrant for Anomaly Detection60 steps