apps/docs/search/parameters.mdx
Complete parameter reference for all three search endpoints: document search, memory search, and execute search.
These parameters work across all search endpoints:
<ParamField query="q" type="string" required> **Search query string**The text you want to search for. Can be natural language, keywords, or questions.
q: "machine learning neural networks"
q: "What are the applications of quantum computing?"
q: "python tutorial beginner"
Controls how many results you get back. Higher limits increase response time and size.
limit: 5 // Fast, focused results
limit: 20 // Comprehensive results
limit: 100 // Maximum recommended
Organizational tags for filtering results. Uses exact array matching - must match all tags in the same order.
containerTags: ["user_123"] // Single tag
containerTags: ["user_123", "project_ai"] // Multiple tags (exact match)
JSON string containing AND/OR logic for filtering by metadata fields. Uses the same structure as memory listing filters.
filters: JSON.stringify({
AND: [
{ key: "category", value: "tutorial", negate: false },
{ key: "difficulty", value: "beginner", negate: false }
]
})
Applies a secondary ranking algorithm to improve result quality. Adds ~100-200ms latency but increases accuracy.
rerank: true // Better accuracy, slower
rerank: false // Faster, standard accuracy
Rewrites your query to find more relevant results. Particularly useful for abbreviations and domain-specific terms. Adds ~400ms latency.
// Query rewriting examples:
"ML" → "machine learning artificial intelligence"
"JS" → "JavaScript programming language"
"API" → "application programming interface REST"
/v3/search)These parameters are specific to client.search.documents():
Controls which text chunks are included in results:
chunkThreshold: 0.2 // Broad search, many chunks
chunkThreshold: 0.8 // Precise search, only relevant chunks
Controls which documents are considered for search:
documentThreshold: 0.1 // Cast wide net
documentThreshold: 0.9 // Only very relevant documents
Limit search to chunks within a single document. Useful for finding content in large documents.
docId: "doc_abc123" // Only search this document
By default, Supermemory includes surrounding chunks for context. Set to true to get only the exact matching text.
onlyMatchingChunks: false // Include context chunks (default)
onlyMatchingChunks: true // Only matching chunks
Adds the full document text to each result. Useful for chatbots that need complete context.
includeFullDocs: true // Full document in response
includeFullDocs: false // Only chunks and metadata
Adds AI-generated document summaries to results. Good middle-ground between chunks and full documents.
includeSummary: true // Include document summaries
includeSummary: false // No summaries
// Use this instead:
filters: JSON.stringify({
OR: [
{ key: "category", value: "technology", negate: false },
{ key: "category", value: "science", negate: false }
]
})
/v4/search)These parameters are specific to client.search.memories():
Controls which memories are returned based on similarity:
threshold: 0.3 // Broader memory search
threshold: 0.8 // Only very similar memories
Controls whether to search only memories or also include document chunks:
"memories" (default): Searches only memory entries. Returns results with memory field."hybrid": Searches memories first, then falls back to document chunks if needed. Returns mixed results with either memory field (for memory results) or chunk field (for chunk results).searchMode: "memories" // Only search memories (default)
searchMode: "hybrid" // Search memories + fallback to chunks
When to use hybrid mode:
Note: Memory search uses containerTag (singular) while document search uses containerTags (plural array).
containerTag: "user_123" // Single tag for memory search
Object specifying what contextual information to include with memory results.
<ParamField query="include.documents" type="boolean" default="false"> Include associated documents for each memory </ParamField> <ParamField query="include.relatedMemories" type="boolean" default="false"> Include parent and child memories (contextual relationships) </ParamField> <ParamField query="include.summaries" type="boolean" default="false"> Include memory summaries </ParamField>include: {
documents: true, // Show related documents
relatedMemories: true, // Show parent/child memories
summaries: true // Include summaries
}