Creating memories

Currently there are two ways to create memories:

  1. Inferred memories: These are created automatically by the system from the text data you provide. The system analyzes the input and extracts relevant pieces of information to form memories, which are then associated with appropriate concepts.

  2. Verbatim memories: These are created by you providing exact snippets of text that you want to store as memories. Verbatim memories give you more control over the information stored in the memory system.

Creating inferred memories

After creating an inferred memory, you will receive an inferrence job ID. You can use this ID to check the status of the job and get a list of created memories once the inference process is complete.

import { Fabric } from "@fbrc/sdk";

const api = new Fabric({
  apiKey: process.env.FABRIC_API_KEY,
});

const memoryJob = await api.memory.create({
  source: 'text',
  content: 'My favourite ice cream flavor is pistachio.',
});

Response:

{
  "id": "bb6810e8-8363-43db-9b80-713b167015e3",
  "status": "pending",
  "memories": {
    "created": [
      "e51681e7-18c9-4067-b40b-94196915e34a"
    ]
  }
}

Creating verbatim memories

To create verbatim memories, you can use set infer: false when creating a memory. This will allow you to provide exact text snippets that you want to store as memories and will bypass the inference process.

The created memories will be returned immediately in the response.

const memoryResponse = await api.memory.create({
  source: 'text',
  infer: false,
  content: 'User likes pistachio ice cream.',
});