LLM-readable documentation index
Function Types

Read Memory Functions

Use saved records as additional context for Extract

Hand off to an LLM

Add Read Memory when Extract needs information outside the source document. For example, pass a supplier profile from Structured Memory to fill in a missing invoice currency. Each call chooses which entries the Extract receives.

Read Memory supplies context to Extract. It produces no output or event.

Configuration fields

A Read Memory function has no type-specific configuration.

Required fields

FieldTypeDescription
functionNamestringUnique identifier for the function (per environment)
typestringMust be "read_memory"

Optional fields

FieldTypeDefaultDescription
displayNamestring-Human-readable display name
tagsstring[]-Tags for organization

Create the function with POST /v3/functions.

{
  "functionName": "supplier-memory-read",
  "type": "read_memory"
}

Connect Read Memory to Extract

In the editor, drag a connection from Read Memory to the Extract's Context row. In the API, define the edge from Read Memory to Extract and set Extract as the main node for this workflow.

{
  "name": "supplier-invoices",
  "mainNodeName": "extract",
  "nodes": [
    { "name": "read", "function": { "name": "supplier-memory-read" } },
    { "name": "extract", "function": { "name": "invoice-extract" } }
  ],
  "edges": [{ "sourceNodeName": "read", "destinationNodeName": "extract" }]
}
  • A workflow has at most one Read Memory node.
  • The Read Memory node connects only to Extract nodes, and it needs at least one connection.
  • An Extract receives at most one Read Memory connection.
  • A Super Extract can't receive a Read Memory connection.

Call input

Send 1 to 10 Memory URIs in memory.read. The example selects all supplier profiles in bucket supplier-1042.

{
  "memory": {
    "read": ["bem://memory/buckets/supplier-1042?kind=supplier-profile"]
  }
}
SelectorReads
bem://memory/buckets/{bucketKey}Every entry in the bucket
bem://memory/buckets/{bucketKey}?kind={kindName}Every entry of the kind in the bucket
bem://memory/buckets/{bucketKey}/entries/{entryKey}?kind={kindName}One entry

Read up to 20 entries across all selectors. Every named bucket and kind must exist. If no entries match, the Extract runs without memory entries.

Read Memory returns 400 with MEMORY_SOURCE_TYPE_UNSUPPORTED for these inputs.

  • Video and xlsx input.
  • A PDF or image input to an Extract that has bounding boxes on.
  • A PDF or image input to an Extract whose model list includes a model that can't receive memory context with a PDF or image.
  • Any input other than one PDF or one image, when a selected entry holds a file.

Check the Read Capture

In the call details, expand Read Memory to see the selectors and matched entries. The API returns the same snapshot in trace.readCapture from GET /v3/calls/{callID}/trace. bem may normalize selectors and sorts entries by kind name, bucket key, then entry key.

{
  "readCapture": {
    "selectors": ["bem://memory/buckets/supplier-1042?kind=supplier-profile"],
    "entries": [
      {
        "id": "ment_3Mw7U5psoXhQtQUZvUl091r8Dro",
        "key": "profile",
        "bucketKey": "supplier-1042",
        "kindName": "supplier-profile",
        "kindVersionNum": 1,
        "attributes": {
          "currency": "EUR",
          "supplierName": "Example Packaging Ltd.",
          "paymentTermsDays": 30
        }
      }
    ]
  }
}

bem captures the entries when it accepts the call. Later changes to the bucket leave that snapshot intact.

Evaluation uses the source document alone. Values supplied by memory can receive a low score.

Errors

A call that doesn't fit the workflow returns 400 and runs no function. The error codes are on the Structured Memory page.

When the Extract can't receive the Read Capture, the call ends with an error event of kind memory_read_capture_not_delivered. One cause is entry files that are too large to send with the document.

On this page