Skip to main content

Endpoint

POST /v1/memory/vector-search

Request Body

{
  "embedding": [0.85, 0.15, 0.25, 0.1, 0.75],
  "threshold": 0.5,
  "type": "embedding",
  "limit": 5
}
ParameterTypeRequiredDescription
embeddingnumber[]Query vector (max 4096 dimensions)
thresholdnumberMinimum cosine similarity (default 0.0)
typestringFilter by memory type
limitnumberMax results (default 5, cap 50)

Response (200)

{
  "results": [
    {
      "id": "...",
      "key": "facts/blockchain",
      "score": 0.9965,
      "content": "Blockchain provides decentralized storage",
      "metadata": { "tags": ["tech"] }
    }
  ],
  "count": 1
}
Results are sorted by score (highest first). Uses pgvector native cosine distance (<=> operator) for fast, indexed search. Falls back to in-memory cosine similarity if pgvector is not installed.

Credit Cost

This operation costs 1 credit (search).