import Supermemory from 'supermemory';
const client = new Supermemory({
apiKey: 'My API Key',
});
const response = await client.search.documents({ q: 'machine learning concepts' });
console.log(response.results);
{
"results": [
{
"chunks": [
{
"content": "Machine learning is a subset of artificial intelligence...",
"isRelevant": true,
"score": 0.85
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"documentId": "doc_xyz789",
"metadata": {
"category": "technology",
"isPublic": true,
"readingTime": 5,
"source": "web",
"tag_1": "ai",
"tag_2": "machine-learning"
},
"score": 0.95,
"summary": "A comprehensive guide to understanding the basics of machine learning and its applications.",
"content": "This is the complete content of the document about machine learning concepts...",
"title": "Introduction to Machine Learning",
"updatedAt": "1970-01-01T00:00:00.000Z",
"type": "web"
}
],
"timing": 123,
"total": 123
}
Search memories with advanced filtering
import Supermemory from 'supermemory';
const client = new Supermemory({
apiKey: 'My API Key',
});
const response = await client.search.documents({ q: 'machine learning concepts' });
console.log(response.results);
{
"results": [
{
"chunks": [
{
"content": "Machine learning is a subset of artificial intelligence...",
"isRelevant": true,
"score": 0.85
}
],
"createdAt": "1970-01-01T00:00:00.000Z",
"documentId": "doc_xyz789",
"metadata": {
"category": "technology",
"isPublic": true,
"readingTime": 5,
"source": "web",
"tag_1": "ai",
"tag_2": "machine-learning"
},
"score": 0.95,
"summary": "A comprehensive guide to understanding the basics of machine learning and its applications.",
"content": "This is the complete content of the document about machine learning concepts...",
"title": "Introduction to Machine Learning",
"updatedAt": "1970-01-01T00:00:00.000Z",
"type": "web"
}
],
"timing": 123,
"total": 123
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Search results
The response is of type object
.
Was this page helpful?