garden.engram.searchMemories
Search over a space's memories, by meaning and exact words. The caller embeds its query with the space's model and query prefix and sends vector, model and modelDigest, plus q: once the space has a keyword index, the results rank by both (hybrid). A service that runs the space's model may instead embed q itself when no vector is sent; one that can't (it doesn't embed queries, doesn't run the space's model, or doesn't embed for the space's authority) searches by keyword alone instead, unless mode asks otherwise. The response's mode says what ran. Requires a space credential for the space, presented with an HTTP message signature whose audience is this service's DID.
Details · query
| Kind | query |
|---|---|
| Authority | engram.garden |
| Indexed |
Query
query · GETParameters
query stringauthor
string · didOnly memories written by this DID.
limit
integerminimum: 1maximum: 50default: 10
mode
stringhybrid (the default with q and a vector) ranks by meaning and exact words; vector ignores q for ranking; keyword ranks by q's words alone, needs no vector, and answers KeywordIndexBuilding until the space has a keyword index. An explicit mode never falls back.
knownValues: hybrid | vector | keyword
model
stringMust match the space's model.
modelDigest
stringMust match the space's model digest.
q
stringThe query's text. With a vector, it makes the search hybrid once the space has a keyword index. Sent alone, a service that embeds queries (at most 1000 characters) embeds it with the space's model and query prefix; otherwise the search is by keyword alone.
maxLength: 4000
since
string · datetimeOnly memories created at or after this time.
The space URI.
tags
arrayOnly memories carrying every one of these tags.
maxLength: 16
vector
stringThe query's vector: little-endian IEEE half precision, base64url-encoded without padding.
maxLength: 43000
Output
application/jsonapproximate
booleanSet when the index couldn't re-rank in time, so results are ranked by a coarser comparison and may be less precise.
mode
stringWhat ran: hybrid, vector (no q, mode vector, or a space whose keyword index is still being built), or keyword (mode keyword, or a fallback when q couldn't be embedded).
knownValues: hybrid | vector | keyword
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.
ModelNotHosted
q was sent without a vector, this service doesn't run the space's model, and keyword search couldn't run instead (mode hybrid, or the space has no keyword index yet). Embed the query with the space's model and send the vector.
TextSearchNotAllowed
This service doesn't embed queries for this space's authority, and keyword search couldn't run instead (mode hybrid, or the space has no keyword index yet).
KeywordIndexBuilding
mode keyword, and the space's keyword index is still being built. Search with a vector meanwhile.
EmbedderBusy
Too many queries are being embedded. Retry shortly.
IndexLoading
The space's index is loading. Retry shortly.
RateLimitExceeded
Too many searches for this space.
Similar lexicons
semantic matchLexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
List a space's memories, newest first. Same authentication as garden.engram.searchMemories.
-
A UTF-8 byte range in a snippet's text, like a rich-text facet's index.
-
A space's newest memories and links between the ones that mean similar things, for drawing the space as a graph. Only memories indexed with the space's model are included. Each memory links to its nearest neighbors among the memories returned. Same authentication as garden.engram.searchMemories.