Retrieving memories
Memory search
The memory search endpoint lets you search through your stored memories using hybrid semantic and keyword search. We also apply a recency bias to favor more recent memories.
Retrieved results are ranked by relevance to the query and include a score indicating the strength of the match.
import { Fabric } from "@fbrc/sdk";
const api = new Fabric({
apiKey: process.env.FABRIC_API_KEY,
});
const memoryJob = await api.memories.search({
query: 'my favourite ice cream flavor',
});
curl https://api.fabric.so/v2/memories/search \
-X POST \
-H 'X-Api-Key: <FABRIC_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"query": "my favourite ice cream flavor"
}'
Response:
{
"hits": [{
"id": "e51681e7-18c9-4067-b40b-94196915e34a",
"name": "Favorite ice cream",
"content": "User likes pistachio ice cream.",
"createdAt": "2026-02-03 10:16:19.057+00",
"modifiedAt": "2026-02-03 10:16:19.057+00",
"score": 0.42,
}],
"total": 6,
"hasMore": false
}
Individual memories
You can also retrieve individual memories by their IDs.
const memoryJob = await api.memories.get({
id: 'e51681e7-18c9-4067-b40b-94196915e34a',
});
curl https://api.fabric.so/v2/memories/e51681e7-18c9-4067-b40b-94196915e34a \
-H 'X-Api-Key: <FABRIC_API_KEY>'
Response:
{
"id": "e51681e7-18c9-4067-b40b-94196915e34a",
"name": "Favorite ice cream",
"content": "User likes pistachio ice cream.",
"createdAt": "2026-02-03 10:16:19.057+00",
"modifiedAt": "2026-02-03 10:16:19.057+00"
}