Skip to main content
Add a photo to a collection and find it by caption, by describing what it shows, or with another image. Quivr can match a photo using its caption, a description of the scene, or a similar image.
Flow diagram showing how to add a photo and search by caption, scene description or a similar image.Flow diagram showing how to add a photo and search by caption, scene description or a similar image.

Prerequisites

  • A running Quivr and a collection ID in CORPUS_ID. If you need to create a collection, use a key with corpora:write and access to all collections.
  • Set QUIVR_API_URL and QUIVR_API_KEY. The key needs blobs:write to upload the image, content:write to add it to the collection, and content:read and search:query to find it.
  • A deployment that routes your image media type to Image metadata. For scene and similar-image search, the collection also needs an active vector space that indexes images, served by EmbeddingGemma 2 through an image-capable endpoint. The Single Machine text-only encoder cannot run this path. See Vector model.
  • Bash, curl, jq and sha256sum. Run command -v curl jq sha256sum to check them. Have a JPEG named ferry.jpg showing a ferry docking. For the caption example, embed a caption with the word “ferry” in the file.

Find the ferry photo

1

Upload the photo

These requests use your JPEG and image-enabled deployment. Quivr verifies the length and checksum before returning a Blob ID, which identifies the stored bytes.
Confirm the upload and poll while verification is in progress. The command exports BLOB_ID only after Quivr reports verified.
If verification is still in progress after the last attempt, run this confirmation block again. If the session is rejected or expired, check error and upload a corrected file or a fresh export of the image. Sending the same bytes with the same media type reuses the existing session.
2

Add the photo to your collection

Submit a Record that refers to the Blob. The source label and Record Key identify this photo within the collection.
Export the returned ID as RECEIPT_ID and poll until the receipt reports that the photo is searchable.
When availability.searchable is true, you can search indexed captions by keyword. If the photo is still processing after the last poll, run the polling block again. If it shows a conflict, quarantine or blocked processing, check the diagnostics and the media type route. A ready Version with is_current: false is no longer the one search can return.
3

Describe the scene

Search the gallery source for a description. Check the returned Record IDs and thumbnails. Scene and similar-image search rely on image enrichment. The receipt can already report availability.searchable: true while enrichment is running or blocked. When processing.phase is enrichment, wait if it is queued, running or retrying. If processing.state is blocked, check the diagnostics and fix the cause before running either image search.
To match the embedded caption instead, use "query": "ferry" with "mode": "lexical" and remove the modalities filter so Quivr can match indexed caption text. To find similar images, replace query with "query_blob_id": "$BLOB_ID" and keep semantic mode. You can upload and verify a different photo as the query without adding it to a collection.

What happened

Image metadata read the embedded text and prepared a thumbnail. EmbeddingGemma 2 encoded the picture for meaning search. Core search can rank photo matches from a text or image query when the deployment serves an image-capable space. With include_media: true, hits with thumbnails can return a signed media.thumbnail_url that works until media.thumbnail_expires_at, even if the photo is withdrawn in the meantime. If an image query returns 422 unsupported_search, check that your collection serves an image-capable space and your retrieval plugin accepts image queries. If Quivr returns 422 unverified_blob, upload and confirm the query file before searching. If it returns 422 invalid_query for a verified non-image file, upload an image instead. Pass either query or query_blob_id. If 422 modality_filter_unavailable appears, ask the operator to rebuild the collection’s search index once to enable the image filter. To clean up, withdraw the photo using gallery and ferry as its source label and key. This removes it from future search results. You can delete the local upload.json after confirming the upload.

Next