Simple memory retrieval examples for getting started with the list memories endpoint.
Basic Usage
import Supermemory from 'supermemory';
const client = new Supermemory({
apiKey: process.env.SUPERMEMORY_API_KEY!
});
const response = await client.memories.list({ limit: 10 });
console.log(response);
from supermemory import Supermemory
import os
client = Supermemory(api_key=os.environ.get("SUPERMEMORY_API_KEY"))
response = client.memories.list(limit=10)
print(response)
curl -X POST "https://api.supermemory.ai/v3/documents/list" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit": 10}'
With Custom Parameters
const response = await client.memories.list({
containerTags: ["user_123"],
limit: 20,
sort: "updatedAt",
order: "desc"
});
console.log(`Found ${response.memories.length} memories`);
response = client.memories.list(
container_tags=["user_123"],
limit=20,
sort="updatedAt",
order="desc"
)
print(f"Found {len(response.memories)} memories")
curl -X POST "https://api.supermemory.ai/v3/documents/list" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"containerTags": ["user_123"],
"limit": 20,
"sort": "updatedAt",
"order": "desc"
}'
Start with small limit values (10-20) when testing to avoid overwhelming responses.