Skip to main content
Search through your memories and documents with a single API call. Each search runs inside one namespace (what v3/v4 called a container tag).
searchMode: "hybrid" is the default and gives the best results. It searches both memories and document chunks, returning the most relevant content.
TypeScript SDK: one call, supermemory.search(namespace, { query, searchMode }). searchMode ("memories", "chunks", or "hybrid") picks what comes back. There is no v5 Python SDK yet; the Python tab shows the legacy client.

Quick start

Response:
In hybrid mode, results contain either a memory field (extracted facts) or a chunk field (document content), depending on the source. Branch on field presence.

Parameters

namespace is the URL path. Every other option goes in the JSON body (the second argument in the SDKs).
Defaults changed from v4: searchMode was memories and is now hybrid; threshold was 0.6 and is now 0.3. Set both explicitly if you are comparing against v4 results.

Search modes

  • hybrid (default, recommended) — Searches both memories and document chunks, and returns both in the response
  • memories — Only searches extracted memories
  • chunks — Only searches raw document/chunk content, skipping extracted memories

Filtering

The namespace scopes results to a user or project. Use filter for metadata-based filtering inside that namespace:
  • Equality: { field: "status", operator: "eq", value: "active" } (also neq; strings, numbers, booleans)
  • String contains: { field: "title", operator: "contains", value: "react" } (also notContains; optional caseSensitive)
  • Numeric: { field: "priority", operator: "gte", value: 5 } (gt, gte, lt, lte)
  • Array contains: { field: "tags", operator: "arrayContains", value: "important" } (also arrayNotContains)
  • Logic: { operator: "and" | "or", operands: [...] }, nested up to 5 levels
Keys are literal: customer.plan is one field name, not a nested path. See Organizing & Filtering for full syntax.

Query optimization

Reranking

Re-scores results for better relevance. Adds ~100ms latency.

Threshold

Control result quality vs quantity:

Attachments

  • attach.documents adds the most relevant source document to each result.
  • attach.related adds parent, child, and sibling memories (see graph memory).
  • attach.forgotten allows forgotten memories in related context. By default, search excludes memories that have been forgotten or have passed their forgetAfter expiration.
Attached context arrives under result.included (included.document, included.related.{parents,children,siblings}).

Chatbot example

Optimal configuration for conversational AI:

Next steps