Docs

Vector search and compositional embeddings

Use Scry vector helpers and current academic-paper chunk embeddings together with source-native SQL filters.

Enabled vectors

The live schema exposes current academic-paper chunk embeddings with their paper key, source identity, embedding model, chunk specification, and exact embedding dimension.

Composition

The live helper catalog includes cosine similarity, norm, unit-vector, scaling, projection, debiasing, contrast-axis, pairwise-matrix, and centroid operations. Inspect /v1/scry/schema for the current catalog before composing.

SELECT scry_cosine_similarity(@interp, @safety) AS similarity,
       scry_debias_removed_fraction(@interp, @safety) AS removed_fraction
LIMIT 1;

Mint a named query vector

Create the named vector before using @interp in SQL. This request needs a key with scry plus embed or write scope; a console session token also works.

curl -X POST https://api.scry.io/v1/scry/embed \
  -H "Authorization: Bearer $SCRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "alignment via debate", "name": "interp"}'

ANN search over an indexed relation

scry_vector_topk_distance ranks one HNSW-indexed relation by cosine distance to a @handle. It must appear as an aliased projection, ordered ascending on that alias, with LIMIT at most 100.

SELECT post_key, chunk_index,
       scry_vector_topk_distance(embedding_voyage4, @interp) AS dist
FROM embeddings.forum_posts
WHERE model_name = 'voyage-4-lite' AND post_key LIKE 'lesswrong%'
ORDER BY dist ASC
LIMIT 10;

Use with SQL

Keep source and embedding specifications visible, narrow a relation before scanning it (unfiltered ORDER BY over a full embedding corpus exceeds the query timeout), and use only helpers listed by /v1/scry/schema. Current academic-paper chunk embeddings remain queryable with their paper key, source identity, embedding model, and chunk specification.

Related docs