Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sdk/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Search for memories matching a natural language query, scoped to `owner + namesp

- Preferred form: `recall({ query, limit?, topK?, namespace?, maxDistance? })`
- `limit` defaults to `10`; `topK` is an alias and wins when both are set

> ⚠️ **Truncation is silent.** The response carries no *more results* indicator. If `results.length === limit`, assume more matches exist and retry with a higher `limit`. Reads that need completeness (leaderboards, accuracy computations, deduplication) should not rely on the default of 10.
- Legacy positional forms still work: `recall(query)`, `recall(query, limit)`, `recall(query, limit, namespace)`, and `recall(query, options)`
- `maxDistance` filters weak matches client-side by dropping results where `distance >= maxDistance`

Expand Down
9 changes: 8 additions & 1 deletion packages/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ export interface RecallResult {

/** Options for recall(). */
export interface RecallOptions {
/** Max number of nearest memories to request from the relayer (default: 10). */
/**
* Max number of nearest memories to request from the relayer (default: 10).
*
* NOTE: results are silently capped at this value — the response carries no
* "truncated" flag. If `results.length === limit`, more matches likely exist:
* raise the limit for completeness-critical reads (leaderboards, accuracy
* computations, deduplication passes).
*/
limit?: number;
/** Alias for limit, useful when describing top-K search behaviour. */
topK?: number;
Expand Down