Domain Entities

Overview

This module defines the core data structures used throughout the application: image/video file references, thumbnails, and ChromaDB record metadata.

Vault File

A single file in the vault/ directory. Can be an image or video.

AttributeTypeDescription
full_pathPathAbsolute filesystem path
rel_pathstrPath relative to the vault root (used as ChromaDB ID)
suffixstrFile extension (e.g., .jpg, .mp4)
mtimefloatLast modification timestamp
is_videoboolWhether the file is a video format

ChromaDB Record

When indexed, each file becomes a record in the images collection.

AttributeTypeDescription
idstrRelative path to the file (e.g., vault/IMG.jpg)
embeddingList[float]2048-dim vector from Qwen3-VL model
full_pathstrAbsolute path to the original file
thumbnail_pathstrPath to the generated .webp thumbnail
filenamestrOriginal filename
mtimefloatModification time at index time
file_typestr"image" or "video"

Thumbnail

Generated by the indexer for every media file.

AttributeTypeDescription
pathPathLocation in .cache/thumbnails/
filenamestrMD5 hash of relative path + .webp
sizestr300x300 pixels
formatstrWEBP with quality 80

Image Embedding

The vector representation generated by Qwen3VLEmbedder.

AttributeTypeDescription
last_hidden_statetorch.FloatTensorHidden states from the model
attention_masktorch.TensorMask for valid tokens in the sequence

Search Result

Returned by the API /search endpoint.

{
  "id": "vault/IMG.jpg",
  "score": 0.92,
  "metadata": {
    "full_path": "D:\\...\\vault\\IMG.jpg",
    "thumbnail_path": ".cache/thumbnails/abc.webp",
    "filename": "IMG.jpg",
    "mtime": 1747228800.0,
    "file_type": "image"
  }
}

Qwen3VLForEmbeddingOutput

Custom Pydantic dataclass extending ModelOutput.

@dataclass
class Qwen3VLForEmbeddingOutput(ModelOutput):
    last_hidden_state: Optional[torch.FloatTensor] = None
    attention_mask: Optional[torch.Tensor] = None

Last Updated: 2026-06-17