Similar — Quickstart
Three moves. If your lens already has searchable fields, you can ship
similar() in under a minute.
Three moves
Grant similar
Drop a similar entry under grants on the lens:
similar reuses the vectors search already computed from your
searchable fields — nothing extra to declare, nothing extra to embed.
Push
No ingest re-run required if the fields were already searchable. No new
embeddings — similar shares vectors with search.
Call from your app
React pattern
No dedicated hook — the simplest wrapper is a useEffect:
For feeds (paginated, live, scored), reach for useFeed with a
recordVector feed instead.
Tuning
Two knobs, both optional:
limit— start with 6 for a sidebar panel, 10 for a dedicated page. More than 20 rarely helps; similarity scores tail off fast.minScore— set to0.7if you want to hide "technically the nearest but still unrelated" results. The tradeoff: on sparse indexes the panel can come back empty.
Errors
| Code | Meaning |
|---|---|
400 | id missing from the body |
403 | grants.similar blocks the calling key |
404 | Lens not found, or seed id has no stored vector (never ingested, or has no searchable fields) |
409 | Lens is in error state — check semilayer status |