Interface ImageIndexOptions

Options for indexing an image into the vector store.

The image is described by a vision-capable LLM, then the description is embedded and stored alongside the original image reference.

Example

const result = await indexer.indexImage({
image: fs.readFileSync('./photo.jpg'),
metadata: { source: 'user-upload', fileName: 'photo.jpg' },
collection: 'user-images',
});
interface ImageIndexOptions {
    image: string | Buffer<ArrayBufferLike>;
    metadata?: Record<string, unknown>;
    collection?: string;
}

Properties

image: string | Buffer<ArrayBufferLike>

Image data as a URL string (file:// or https://) or a raw Buffer.

  • URL: Passed directly to the vision LLM for description.
  • Buffer: Converted to a base64 data URL before passing to the LLM.
metadata?: Record<string, unknown>

Optional metadata to attach to the indexed document. Stored alongside the embedding for filtering during search.

Example

{ source: 'upload', tags: ['landscape', 'nature'] }
collection?: string

Vector store collection to index into.

Default

'multimodal'