Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Figma 10 min read Case study easyNovice

How we built AI search in Figma

Figma pivoted from an AI design-autocomplete prototype to shipping visual and semantic search after research showed 75% of objects added to the canvas come from other files and designers struggle to find mid-level frames. To keep indexing tractable on an infinite canvas, the team indexed only UI-like frames found via dimension heuristics, deduplicated copied designs and unaltered file copies, and delayed indexing until a file was idle for four hours. Search quality was measured with evals built as a Figma plugin for labeling results, and the UI landed in the Actions panel with previews and filters to serve both exploration and execution workflows.

Related posts

  • The infrastructure behind AI search in Figma

    Figma mediumAdept

    Figma's AI search embeds frames and published components with a CLIP-based multimodal model, so screenshots, layer selections and text all query one vector space. Text queries are embedded directly, while selections are rendered to images first, which worked better than embedding JSON. Indexing runs as chained async jobs: a headless C++ editor enumerates frames, metadata goes to DynamoDB, thumbnails go to S3, SageMaker produces embeddings in batches, and OpenSearch kNN serves faceted vector search. Component search runs lexical and vector queries in parallel and merges them with min-max score normalization. Costs were cut by porting Ruby to C++, CPU rendering with llvmpipe, a four-hour indexing debounce (only 12% of data processed), dropping duplicates and drafts (index halved) and vector quantization; the post also covers an OpenSearch replica bug and a pitfall where excluding embeddings from _source wiped them on document updates.

  • Behind the feature: Find and replace

    Figma easyNovice

    Find and replace in Figma and FigJam turned out to be far harder than a search bar because canvas content is multi-directional, so result ordering had to be designed rather than inherited. The team first reused the prototyping engine's row-by-row sort, then moved to sorting by FigJam sections, a proximity-based spatial grouping algorithm, and heuristics where tall sections sort left-to-right and wide ones top-to-bottom. Zooming targets an 'effective font size' range (font size × zoom), and panning only happens when a match leaves an invisible central box. In Figma, search moved into the layers pane to favor layer and page search over consistency with FigJam, Enter-key behaviour was settled through internal testing, and smarter casing rules replaced the plugin's 'Keep original case' setting.

  • Image replacement in Canva designs using reverse image search

    Canva Engineering mediumAdept

    Canva built a reverse image search system to replace IP-restricted images in templates, after ruling out its recommendation engine, perceptual hashing, metadata text search and AI-generated images. Five embedding models (DINOv2, CLIP, ViTMAE, DreamSim, CaiT) plus a GPT-4o-description-to-CLIP approach were compared qualitatively on 50,000 images using Faiss and a subject/color/composition similarity hierarchy, and DINOv2 won. Embeddings for 150M+ images live in a third-party external vector database instead of in memory, which keeps up with library changes and supports aspect-ratio filtering. Results are strong for photos but weak for text, symbols and cartoons, yet pilots showed designers replacing images 4.5x faster.

  • The search for speed in Figma

    Figma mediumAdept

    Figma's search slowness traced mostly to its own stack, not OpenSearch: OpenSearch's headline 8 ms metric was per-shard time, and only the "took" field in responses reveals overall query latency, which accounted for under 30% of API time. Fixes included reordering and slimming Ruby permission checks, repairing a database connection setup bug that also sped up the rest of Figma, and trimming index size by 50% and then 90% so the data fit in the OS page cache. Load tests with a custom Go benchmark showed AWS sizing guidance suited log workloads, not latency-sensitive search. Cutting shards from 450 to 180 and moving to nodes with less CPU and more RAM paid off, while concurrent segment search hurt. Overall API latency fell about 60%, peak QPS rose over 50%, and cost dropped more than 50%.

  • Image search with 🤗 datasets

    Hugging Face mediumAdept

    A text-to-image search over 10,000 British Library book embellishments can be built by loading the images with the 🤗 datasets ImageFolder loader and embedding them with the CLIP ViT-B/32 model via sentence_transformers. The embeddings are indexed with datasets' built-in add_faiss_index, and text prompts are queried with get_nearest_examples. push_to_hub stores intermediate datasets so work can move between machines, such as a laptop and a Colab GPU. Results for prompts like "a steam engine" or "a musical instrument" are not always correct but are usually reasonable, which is enough to search images by semantic content.

The quest for software engineering knowledge.

Look:
Layout: