Search documents
client.search.execute(SearchExecuteParams { q, categoriesFilter, chunkThreshold, 12 more } body, RequestOptionsoptions?): SearchExecuteResponse { results, timing, total }
POST/v3/search
Search documents
import Supermemory from 'supermemory';
const client = new Supermemory({
apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
});
const response = await client.search.execute({ q: 'what are the API rate limits' });
console.log(response.results);{
"results": [
{
"chunks": [
{
"content": "Rate limit headers are included in every response. Clients should implement exponential backoff when receiving 429 responses.",
"isRelevant": true,
"position": 3,
"score": 0.85
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"documentId": "doc_xyz789",
"metadata": {
"source": "bar",
"language": "bar"
},
"score": 0.95,
"title": "API Rate Limiting Policy",
"type": "web",
"updatedAt": "1970-01-01T00:00:00.000Z",
"content": "Our API rate limits are 100 req/min on free and 1000 on pro. Clients should use exponential backoff on 429s.",
"summary": "API rate limit policy: 100 req/min free, 1000 req/min pro."
}
],
"timing": 0,
"total": 0
}Returns Examples
{
"results": [
{
"chunks": [
{
"content": "Rate limit headers are included in every response. Clients should implement exponential backoff when receiving 429 responses.",
"isRelevant": true,
"position": 3,
"score": 0.85
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"documentId": "doc_xyz789",
"metadata": {
"source": "bar",
"language": "bar"
},
"score": 0.95,
"title": "API Rate Limiting Policy",
"type": "web",
"updatedAt": "1970-01-01T00:00:00.000Z",
"content": "Our API rate limits are 100 req/min on free and 1000 on pro. Clients should use exponential backoff on 429s.",
"summary": "API rate limit policy: 100 req/min free, 1000 req/min pro."
}
],
"timing": 0,
"total": 0
}