Overview
CLIP models learn to associate images with text descriptions, enabling:- Text-to-image search: Find images using natural language (“sustainability charts”, “team photos”)
- Visual document search: Search PDF pages by their visual content, not just text
- Cross-modal retrieval: Query with text, retrieve visual content
Quick Start
Python SDK
Node.js SDK
Providers
Local CLIP (MobileCLIP-S2)
The default provider uses MobileCLIP-S2, a lightweight CLIP model optimized for mobile and edge devices. Characteristics:- Dimensions: 512
- Size: ~200 MB (downloaded on first use)
- Inference: CPU-based, no GPU required
- Privacy: All processing happens locally
- Offline: Works without internet after initial download
Local CLIP is supported in
memvid-core and the Python SDK. In Node.js, LocalClip requires a native build that exports ClipModel (the prebuilt npm binaries may not include it). Cloud providers work out of the box.OpenAI CLIP
OpenAI’s embedding models provide excellent quality for visual search queries. Setup:Gemini CLIP
Google’s Gemini provides multimodal embeddings for visual search. Setup:Complete Example
Here’s a full workflow for visual document search:API Reference
ClipProvider Interface
All CLIP providers implement this interface:Factory Function
Environment Variables
Use Cases
Visual Document Search
Search PDFs by their visual content (charts, diagrams, tables):Image Gallery Search
Build searchable image galleries with natural language:Multimodal RAG
Combine visual and text search for richer retrieval:Best Practices
- Choose the right provider: Use local CLIP for privacy/offline, OpenAI for quality
- Batch embeddings: Use
embed_images()for multiple images to reduce API calls - Cache embeddings: Store visual embeddings in metadata for reuse
- Consistent models: Use the same model for indexing and querying
- Dimension matching: Ensure query and document embeddings have same dimensions
Limitations
- Local CLIP (Node.js): Requires a native build with CLIP support; prebuilt npm binaries may be cloud-only
- Image formats: Supports JPEG, PNG, WebP, GIF
- PDF visual search: Requires extracting page images first
- Model size: Local CLIP downloads ~200 MB on first use
Next Steps
Embedding Models
Configure text embedding models for semantic search
Entity Extraction
Extract entities and build knowledge graphs
Indexes and Tracks
Learn about lexical, vector, and time indices
Python SDK
Complete Python SDK reference