Skip to main content
POST
/
v4
/
search
Search memory entries
const url = 'https://api.supermemory.ai/v4/search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"q":"machine learning concepts"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "results": [
    {
      "id": "mem_abc123",
      "memory": "John prefers machine learning over traditional programming",
      "metadata": {
        "source": "conversation",
        "confidence": 0.9
      },
      "updatedAt": "<string>",
      "similarity": 0.89,
      "version": 3,
      "context": {
        "parents": [
          {
            "relation": "updates",
            "version": -1,
            "memory": "Earlier version: Dhravya is working on a patent at Cloudflare.",
            "metadata": {},
            "updatedAt": "<string>"
          }
        ],
        "children": [
          {
            "relation": "extends",
            "version": 1,
            "memory": "Later version: Dhravya has filed the patent successfully.",
            "metadata": {},
            "updatedAt": "<string>"
          }
        ]
      },
      "documents": [
        {
          "id": "doc_xyz789",
          "title": "Introduction to Machine Learning",
          "type": "web",
          "metadata": {
            "category": "technology",
            "isPublic": true,
            "readingTime": 5,
            "source": "web",
            "tag_1": "ai",
            "tag_2": "machine-learning"
          },
          "summary": "A comprehensive guide to understanding the basics of machine learning and its applications.",
          "createdAt": "<string>",
          "updatedAt": "<string>"
        }
      ],
      "chunks": [
        {
          "content": "This is a chunk of content from the document...",
          "score": 0.85,
          "position": 0,
          "documentId": "doc_xyz789"
        }
      ]
    }
  ],
  "timing": 245,
  "total": 5
}

Authorizations

Authorization
string
header
required

Body

application/json
q
string
required
Minimum length: 1
Example:
containerTag
string
Example:
threshold
number
default:0.6
Required range: 0 <= x <= 1
Example:
filters
object
  • Option 1
  • Option 2
include
object
limit
integer
default:10
Required range: 1 <= x <= 100
Example:
rerank
boolean
default:false
Example:
rewriteQuery
boolean
default:false
Example:

Response

results
object[]
required
timing
number
required
Example:
total
number
required
Example: