const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({q: 'what are the API rate limits'})
};
fetch('https://api.supermemory.ai/v4/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.supermemory.ai/v4/search"
payload = { "q": "what are the API rate limits" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.supermemory.ai/v4/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"q": "what are the API rate limits"
}
'{
"results": [
{
"id": "mem_abc123",
"metadata": {
"source": "conversation",
"confidence": 0.9
},
"updatedAt": "<string>",
"similarity": 0.89,
"memory": "The user prefers detailed API responses over minimal ones.",
"chunk": "This is a chunk of content from a document...",
"filepath": "<string>",
"version": 3,
"context": {
"parents": [
{
"relation": "updates",
"memory": "Earlier version: API rate limit is 50 req/min on the free tier.",
"updatedAt": "<string>",
"version": -1,
"metadata": {}
}
],
"children": [
{
"relation": "extends",
"memory": "Later version: API rate limit increased to 100 req/min on the free tier.",
"updatedAt": "<string>",
"version": 1,
"metadata": {}
}
],
"related": [
{
"relation": "extends",
"memory": "<string>",
"updatedAt": "<string>",
"metadata": {}
}
]
},
"documents": [
{
"id": "doc_xyz789",
"createdAt": "<string>",
"updatedAt": "<string>",
"title": "API Rate Limiting Policy",
"type": "web",
"metadata": {
"source": "upload",
"language": "en"
},
"summary": "API rate limit policy: 100 req/min free, 1000 req/min pro."
}
],
"chunks": [
{
"content": "This is a chunk of content from the document...",
"score": 0.85,
"position": 0,
"documentId": "doc_xyz789"
}
],
"isAggregated": false
}
],
"timing": 245,
"total": 5
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}Search memory entries
Search memory entries - Low latency for conversational
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({q: 'what are the API rate limits'})
};
fetch('https://api.supermemory.ai/v4/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.supermemory.ai/v4/search"
payload = { "q": "what are the API rate limits" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.supermemory.ai/v4/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"q": "what are the API rate limits"
}
'{
"results": [
{
"id": "mem_abc123",
"metadata": {
"source": "conversation",
"confidence": 0.9
},
"updatedAt": "<string>",
"similarity": 0.89,
"memory": "The user prefers detailed API responses over minimal ones.",
"chunk": "This is a chunk of content from a document...",
"filepath": "<string>",
"version": 3,
"context": {
"parents": [
{
"relation": "updates",
"memory": "Earlier version: API rate limit is 50 req/min on the free tier.",
"updatedAt": "<string>",
"version": -1,
"metadata": {}
}
],
"children": [
{
"relation": "extends",
"memory": "Later version: API rate limit increased to 100 req/min on the free tier.",
"updatedAt": "<string>",
"version": 1,
"metadata": {}
}
],
"related": [
{
"relation": "extends",
"memory": "<string>",
"updatedAt": "<string>",
"metadata": {}
}
]
},
"documents": [
{
"id": "doc_xyz789",
"createdAt": "<string>",
"updatedAt": "<string>",
"title": "API Rate Limiting Policy",
"type": "web",
"metadata": {
"source": "upload",
"language": "en"
},
"summary": "API rate limit policy: 100 req/min free, 1000 req/min pro."
}
],
"chunks": [
{
"content": "This is a chunk of content from the document...",
"score": 0.85,
"position": 0,
"documentId": "doc_xyz789"
}
],
"isAggregated": false
}
],
"timing": 245,
"total": 5
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}{
"error": "Invalid request parameters",
"details": "Query must be at least 1 character long"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Search query string
1"what are the API rate limits"
Optional tag this search should be containerized by. This can be an ID for your user, a project ID, or any other identifier you wish to use to filter memories.
100^[a-zA-Z0-9_:-]+$"user_alex"
Threshold / sensitivity for memories selection. 0 is least sensitive (returns most memories, more results), 1 is most sensitive (returns lesser memories, accurate results)
0 <= x <= 10.5
Optional filters to apply to the search. Can be a JSON string or Query object.
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum number of results to return
1 < x <= 10010
If true, rerank the results based on the query. This is helpful if you want to ensure the most relevant results are returned.
false
If true, aggregates information from multiple memories to create new synthesized memories. The result will be a mix of aggregated and non-aggregated memories, reranked by relevance to the query. Works in conjunction with reranking.
false
If true, rewrites the query to make it easier to find documents. This increases the latency by about 400ms
false
Search mode. 'memories' searches only memory entries (default). 'hybrid' searches both memories and document chunks. 'documents' searches only document chunks.
memories, hybrid, documents "memories"
Filter search results by filepath. Exact match for full paths, prefix match if ending with /
Response
Memory search results
Array of matching memory entries and chunks with similarity scores. Contains memory results when searchMode='memories', both memory and chunk results when searchMode='hybrid', or only chunk results when searchMode='documents'. Memory results have 'memory' field, chunk results have 'chunk' field. BACKWARD COMPATIBILITY: When using deprecated include.chunks=true, only memory results are returned with chunks embedded in them (old format).
Show child attributes
Show child attributes
Search execution time in milliseconds
245
Total number of results returned
5
Was this page helpful?