Docs menu · Semantic search
Language English

Optional semantic search

Experimental. figlens search <file> <query> --mode semantic|hybrid ranks layers by meaning with a local model. The default --mode text is unchanged and needs no model.

  • Set up once. Download BAAI/bge-m3 at revision 5617a9f61b028005a4858fdac845db406aefb181 (MIT; config.json, pytorch_model.bin, tokenizer.json) yourself: figlens never downloads. figlens models configure bge-m3 --model DIR [--runtime FILE] checks the files by SHA-256, starts the figlens-embed runtime once offline (looked up next to the figlens executable unless --runtime is given) and records the profile in models.json in the config directory. models list|status show it, models remove bge-m3 forgets it and keeps the files.
  • Visual profile. figlens models configure siglip-base --model DIR checks google/siglip-base-patch16-224 at revision 7fd15f0689c79d79e38b1c2e2e2370a7bf2761ed (Apache-2.0; config.json, preprocessor_config.json, model.safetensors) the same way and records the image model for visual search.
  • Image queries (experimental). figlens search --workspace DIR --image shot.png ranks a workspace's units by how they look; --image-ref '{"sourceId":…,"snapshotId":…,"nodeId":…}' uses a result's stored render instead, --crop x,y,w,h cuts either. Adding query text makes it hybrid. Visual layers are built by figlens index visual (a search builds none, and a single .fig search refuses an image). Without the vision profile, or when it fails, results rank by pixel hash alone and query.usedModes says so. The query image is never stored. The ranking policy is still being validated, so treat results as hints. MCP: search image (a path inside the roots), imageRef, crop.
  • Modes. semantic ranks each layer by its best chunk of name, text, component properties or scope. hybrid fuses the text and semantic rankings (Reciprocal Rank Fusion). Without a profile semantic fails with mode_unavailable and hybrid returns the text results and says why. coverage.layers.semantic reports ready, partial or unavailable; a partial page has no nextCursor. Models run on the CPU; Ctrl-C stops the active request. An MCP/viewer process can keep one text and one image model resident after use: text alone measured about 2.5 GiB, the two models' peak RSS summed to about 3.5 GiB in one Linux ARM diagnostic, excluding the core and index workers. These are measurements, not memory caps.
  • Limits. Embedded: layer names, effective text, an instance's component property values (a value that cannot be resolved exactly is skipped and counted) and each layer's page and container names. --workspace/--id search reads each source's stored model layer and never embeds design text; build it with figlens index embed (the MCP server queues it after a text build). A source without it is pending, and the page is partial. On the frozen test suite for this feature the model missed the quality gate for synonym and purpose queries (wrong top-1 rate 0.25, gate 0.20), so treat results as hints.
  • MCP. The models tool (list, status, configure, remove) and search mode; configure runs only the figlens-embed beside figlens, and the model directory and files must lie inside the server's roots. Cancelling the call stops a running search or setup.

This page is built from docs/README.md in the repository.