Retrieving memories

Ask memories

The ask endpoint answers a natural language question using your stored memories as context. Exabase retrieves relevant memories, passes them to the AI, and returns a generated answer.

Endpoint: POST /v2/memories/ask

import { Exabase } from "@exabase/sdk";

const api = new Exabase({
  apiKey: process.env.EXABASE_API_KEY,
});

const result = await api.memories.ask({
  query: "what does the user need to finish onboarding",
});

console.log(result.answer);
curl 'https://api.exabase.io/v2/memories/ask?query=what+does+the+user+need+to+finish+onboarding' \
  -H 'X-Api-Key: <EXABASE_API_KEY>'

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.

Endpoint: POST /v2/memories/search

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.

Endpoint: GET /v2/memories/{memoryId}

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"
}