🧩 Embeddings Auto-Updater is a system-level microservice designed to enhance the AI Search feature in Supervisely by automatically generating and updating embeddings for project images.
Key features:
- Instance-level service: Runs as a system container for the entire Supervisely instance.
- Automatic embeddings generation: For all projects with AI Search enabled.
- Scheduled updates: Configurable intervals for embedding updates.
- Integration with Qdrant: Efficient vector database for embedding storage.
- CLIP Service integration: High-quality image embeddings.
- Smart update logic: Processes only new or modified images.
- Zero-downtime operation: Runs continuously in the background.
The service ensures synchronization between Supervisely and Qdrant by:
- Generating embeddings for new images.
- Updating embeddings for modified images.
- Removing embeddings for deleted images.
The application uses a scheduler-based architecture to periodically check for projects requiring embedding updates:
- Containerized Service: Runs as a Docker container at the instance level.
- Scheduler: Uses
AsyncIOScheduler
for configurable update intervals. - CLIP Service: Generates high-quality embeddings using CLIP models.
- Qdrant Integration: Efficiently stores and manages vector embeddings.
- Smart Filtering: Processes only images needing updates based on timestamps.
- Multi-project Support: Handles multiple projects concurrently.
- Supervisely instance with admin access.
- Docker environment for container deployment.
- Running CLIP as Service instance (task ID or service endpoint).
- Qdrant vector database instance (URL).
Configure the service using the environment variables in docker-compose.yml
.
- Qdrant DB: Full URL including protocol (https/http) and port (e.g.,
https://192.168.1.1:6333
). - CLIP Service: Task ID for CLIP as Service session or its host including port (e.g.,
1234
orhttps://192.168.1.1:51000
). - Update Interval: Set the interval in minutes for updating embeddings (1-1440 minutes, default: 10).
The service starts automatically on instance startup and continuously monitors all projects with AI Search enabled.
The service provides robust logging and monitoring capabilities:
- Health checks: Built-in health check endpoint.
- Detailed logging: Configurable log levels for debugging and monitoring.
- Error handling: Robust error handling with retry mechanisms.
The service exposes several API endpoints for monitoring and management:
Health check endpoint that verifies the status of all connected services (Qdrant, CLIP, Generator).
Stop embeddings update task for a specific project only if it's currently the active task.
Parameters:
project_id
(path parameter): ID of the project to stop
Response when project is current task:
{
"project_id": 12345,
"is_current_task": true,
"success": true,
"message": "Stopped auto update task successfully",
"details": {
"cancel_task": "success",
"clear_current_task": "success",
"clear_in_progress_flag": "success",
"clear_update_flag": "success",
"clear_autorestart": "success"
}
}
Response when project is not current task:
{
"project_id": 12345,
"is_current_task": false,
"success": true,
"message": "[Project: 12345] Is not the current active task in the auto-updater.",
"details": {}
}
For technical support and questions, join our Supervisely Ecosystem Slack community.