Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
surrealdb avatar

Surrealdb Vector

  • 253 installs
  • 21 repo stars
  • Updated June 16, 2026
  • surrealdb/agent-skills

Helps with ai & agent building tasks.

About

surrealdb-vector is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • surrealdb-vector
  • AI & Agent Building
  • AI-coding skill

Surrealdb Vector by the numbers

  • 253 all-time installs (skills.sh)
  • +12 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #2,545 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/surrealdb/agent-skills --skill surrealdb-vector

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs253
repo stars21
Last updatedJune 16, 2026
Repositorysurrealdb/agent-skills

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

SurrealDB Vector Search

HNSW Index

Create a basic HNSW index:

DEFINE INDEX hnsw_idx ON pts FIELDS point HNSW DIMENSION 4;

With specific distance function and type:

DEFINE INDEX hnsw_idx ON pts FIELDS point HNSW DIMENSION 4 DIST EUCLIDEAN TYPE F64;

Available types: F64, F32, I64, I32, I16.

Full Table Example

DEFINE TABLE OVERWRITE document SCHEMALESS;
DEFINE FIELD OVERWRITE embedding ON document TYPE array<float>;
DEFINE INDEX OVERWRITE hnsw_idx_document ON document
    FIELDS embedding
    HNSW DIMENSION 384
    DIST COSINE
    TYPE F32
    EFC 150 M 12 M0 24;

HNSW Parameters

ParameterDescription
DIMENSIONVector dimensionality (must match your embeddings)
DISTDistance function: COSINE, EUCLIDEAN, etc.
TYPENumeric type: F64, F32, I64, I32, I16
EFCConstruction search effort (higher = better index)
MMax connections per node
M0Max connections at layer 0

Querying Vectors

The <|K, EF|> operator performs KNN search. K is the number of results, EF is the search effort (higher = more accurate, slower).

Recommended effort values:

  • 40 — default, good accuracy
  • 17 — fast but may miss some results

Basic KNN Query

SELECT
    *,
    vector::distance::knn() AS dist
FROM document
WHERE embedding <|10, 40|> $vector;

vector::distance::knn() uses the distance function defined by the index.

Scored Results with Threshold

SELECT *, score
FROM (
    SELECT *, (1 - vector::distance::knn()) AS score
    FROM document
    WHERE embedding <|20, 40|> $vector
)
WHERE score >= $threshold
ORDER BY score DESC;

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.