garden.engram.searchMemories

hailey.at

Documentation

Vector search over a space's memories. The caller embeds its query with the space's model and query prefix. Requires a space credential for the space, presented with an HTTP message signature whose audience is this service's DID.

main query

Vector search over a space's memories. The caller embeds its query with the space's model and query prefix. Requires a space credential for the space, presented with an HTTP message signature whose audience is this service's DID.

Parameters

author string did Optional

Only memories written by this DID.

limit integer Optional

No description available.

model string Required

Must match the space's model.

modelDigest string Required

Must match the space's model digest.

q string Optional

The query's text. Optional and not used for ranking yet; kept for keyword search later.

since string datetime Optional

Only memories created at or after this time.

space string Required

The space URI.

tags array of string Optional

Only memories carrying every one of these tags.

vector string Required

The query's vector: little-endian IEEE half precision, base64url-encoded without padding.

Output

Encodingapplication/json
approximate boolean Optional

Set when the index couldn't re-rank in time, so results are ranked by a coarser comparison and may be less precise.

memories array Required

No description available.

Errors

UnknownSpace This service does not index the space.
NoModel The space's authority hasn't declared an embedding model.
ModelMismatch The query's model isn't the space's model. Re-read the space's config.
IndexLoading The space's index is loading. Retry shortly.
RateLimitExceeded Too many searches for this space.
Try It

Requests are sent directly from your browser. Some servers may block requests due to CORS.

Base URL for XRPC calls (e.g., https://api.bsky.social)
Parameters
Only memories written by this DID.
Must match the space's model.
Must match the space's model digest.
The query's text. Optional and not used for ranking yet; kept for keyword search later.
Only memories created at or after this time.
The space URI.
Only memories carrying every one of these tags.
The query's vector: little-endian IEEE half precision, base64url-encoded without padding.
View raw schema
{
  "description": "Vector search over a space's memories. The caller embeds its query with the space's model and query prefix. Requires a space credential for the space, presented with an HTTP message signature whose audience is this service's DID.",
  "errors": [
    {
      "description": "This service does not index the space.",
      "name": "UnknownSpace"
    },
    {
      "description": "The space's authority hasn't declared an embedding model.",
      "name": "NoModel"
    },
    {
      "description": "The query's model isn't the space's model. Re-read the space's config.",
      "name": "ModelMismatch"
    },
    {
      "description": "The space's index is loading. Retry shortly.",
      "name": "IndexLoading"
    },
    {
      "description": "Too many searches for this space.",
      "name": "RateLimitExceeded"
    }
  ],
  "output": {
    "encoding": "application/json",
    "schema": {
      "properties": {
        "approximate": {
          "description": "Set when the index couldn't re-rank in time, so results are ranked by a coarser comparison and may be less precise.",
          "type": "boolean"
        },
        "memories": {
          "items": {
            "ref": "garden.engram.defs#memoryView",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "memories"
      ],
      "type": "object"
    }
  },
  "parameters": {
    "properties": {
      "author": {
        "description": "Only memories written by this DID.",
        "format": "did",
        "type": "string"
      },
      "limit": {
        "default": 10,
        "maximum": 50,
        "minimum": 1,
        "type": "integer"
      },
      "model": {
        "description": "Must match the space's model.",
        "type": "string"
      },
      "modelDigest": {
        "description": "Must match the space's model digest.",
        "type": "string"
      },
      "q": {
        "description": "The query's text. Optional and not used for ranking yet; kept for keyword search later.",
        "maxLength": 4000,
        "type": "string"
      },
      "since": {
        "description": "Only memories created at or after this time.",
        "format": "datetime",
        "type": "string"
      },
      "space": {
        "description": "The space URI.",
        "type": "string"
      },
      "tags": {
        "description": "Only memories carrying every one of these tags.",
        "items": {
          "type": "string"
        },
        "maxLength": 16,
        "type": "array"
      },
      "vector": {
        "description": "The query's vector: little-endian IEEE half precision, base64url-encoded without padding.",
        "maxLength": 43000,
        "type": "string"
      }
    },
    "required": [
      "space",
      "vector",
      "model",
      "modelDigest"
    ],
    "type": "params"
  },
  "type": "query"
}

Lexicon Garden

@