GoodMemGoodMem
ReferenceSdkV2.NET

Memories

Memory CRUD + retrieval (streaming) + file upload + batch ops.

Namespace: Goodmem.Client.Api · Class: MemoriesApi

Reach this surface as client.Memories on a GoodmemClient. Every network method is asynchronous — it returns a Task<T> (or an IAsyncEnumerable<T> for pagination and streaming) and accepts a CancellationToken; the Async suffix marks the standard .NET Task-based async pattern.

Methods

MethodSummary
CreateAsyncCreate a new memory.
CreateFromFileAsyncCreate a memory from a local file via a multipart upload. The file is the content, so any OriginalContent/OriginalContentB64 on is ignored; when ContentType is unset it is inferred from the file extension. supplies optional metadata (labels, chunking, …) and is never mutated.
RetrieveAsyncRuns a retrieval from the flat convenience parameters: SpaceIds expand into SpaceKeys and the flat post-processor keys assemble into a ChatPostProcessor.
RetrieveRawAsyncAdvanced semantic memory retrieval with JSON.
GetAsyncGet a memory by ID.
ContentAsyncDownload memory content.
PagesAsyncList memory page images.
PagesImageAsyncDownload memory page image content.
ListAsyncList memories in a space.
DeleteAsyncDelete a memory.
BatchCreateAsyncCreate multiple memories in a batch.
BatchGetAsyncGet multiple memories by ID.
BatchDeleteAsyncDelete memories in batch.
CreateFromStreamAsyncCreate a memory by streaming an arbitrary as the multipart file part — the .NET analog of Go's CreateFromReader, so a large upload is never fully buffered in memory. The stream is read to completion but NOT disposed (the caller owns it). Content type is inferred from when doesn't set one; the file part carries the content, so any OriginalContent/ OriginalContentB64 on the request is ignored and the caller's request is never mutated.

CreateAsync

Create a memory from text content or base64-encoded binary content. Content must be provided via exactly one of originalContent or originalContentB64. When using originalContentB64, contentType is required (the server cannot infer MIME type from base64 bytes). originalContentRef is a metadata pointer (URL) attached to the memory; it does NOT supply content and may accompany originalContent/originalContentB64.

Declaration

public Task<Memory> CreateAsync(JsonMemoryCreationRequest request, CancellationToken ct = default)

HTTPPOST /v1/memories

Parameters

TypeNameDescription
JsonMemoryCreationRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<Memory> — an awaitable that resolves to Memory.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Examples

Example 1:

var memory = await client.Memories.CreateAsync(
    new JsonMemoryCreationRequest
    {
        SpaceId = "your-space-id",
        OriginalContent = "GoodMem stores and retrieves vectorized memories for RAG.",
        ContentType = "text/plain",
        Metadata = new Dictionary<string, object> { ["source"] = "sdk-doc-test" },
    }
);
Console.WriteLine(memory.MemoryId);

Example 2:

// Send base64-encoded bytes; contentType is required so the server knows the MIME type.
var b64 = Convert.ToBase64String(
    Encoding.UTF8.GetBytes("Base64-encoded memory content.")
);
var memory = await client.Memories.CreateAsync(
    new JsonMemoryCreationRequest
    {
        SpaceId = "your-space-id",
        OriginalContentB64 = b64,
        ContentType = "text/plain",
    }
);
Console.WriteLine(memory.MemoryId);

Example 3:

// Upload a file directly: the SDK reads it and sends a multipart request, inferring
// the content type from the file extension.
var memory = await client.Memories.CreateFromFileAsync(
    "your-space-id",
    "example.txt"
);
Console.WriteLine(memory.MemoryId);


CreateFromFileAsync

Create a memory from text content or base64-encoded binary content. Content must be provided via exactly one of originalContent or originalContentB64. When using originalContentB64, contentType is required (the server cannot infer MIME type from base64 bytes). originalContentRef is a metadata pointer (URL) attached to the memory; it does NOT supply content and may accompany originalContent/originalContentB64.

File overload: reads filePath from disk (memory-create uploads it as a multipart file part; OCR base64-encodes it into the JSON body) — the content type is inferred from the extension.

Declaration

public Task<Memory> CreateFromFileAsync(string spaceId, string filePath, JsonMemoryCreationRequest? request = null, CancellationToken ct = default)

HTTPPOST /v1/memories

Parameters

TypeNameDescription
stringspaceIdID of the space where this memory will be stored
stringfilePathPath to a local file; it is read into memory and (for OCR) base64-encoded, with the content type inferred from the extension.
JsonMemoryCreationRequestrequestThe request payload; the linked model lists every field and its JSON wire name. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<Memory> — an awaitable that resolves to Memory.

Exceptions

TypeCondition
ArgumentExceptionspaceId is null or empty.
ArgumentExceptionfilePath is null or empty.
GoodmemExceptionThe local file could not be read (I/O error, missing file, or access denied).
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var result = await client.Memories.CreateFromFileAsync("your-space-id", "/path/to/document.pdf", new JsonMemoryCreationRequest { SpaceId = "your-space-id", ContentType = "..." });


RetrieveAsync

Performs a streaming semantic search across one or more memory spaces and returns matching chunks ranked by relevance as well as LLM-postprocessed results (like summarization, question-answering, etc.).

Declaration

public IAsyncEnumerable<RetrieveMemoryEvent> RetrieveAsync(string message, RetrieveOptions? options = null, CancellationToken ct = default)

HTTPPOST /v1/memories:retrieve

Parameters

TypeNameDescription
stringmessageThe natural-language query.
RetrieveOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

IAsyncEnumerable<RetrieveMemoryEvent> — an async stream; await foreach yields each RetrieveMemoryEvent across pages / events.

Exceptions

TypeCondition
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Examples

Example 1:

await foreach (
    var ev in client.Memories.RetrieveAsync(
        "What is GoodMem?",
        new RetrieveOptions { SpaceIds = new[] { "your-space-id" }, RequestedSize = 5 }
    )
)
{
    // Each event is one kind of result; a retrieved chunk carries the ranked text.
    if (ev.RetrievedItem?.Chunk is { } chunk)
        Console.WriteLine($"score={chunk.RelevanceScore:F3}");
}

Example 2:

// RetrieveRawAsync takes a fully-formed request for advanced control.
await foreach (
    var ev in client.Memories.RetrieveRawAsync(
        new RetrieveMemoryRequest
        {
            Message = "What is GoodMem?",
            SpaceKeys = new[] { new SpaceKey { SpaceId = "your-space-id" } },
            RequestedSize = 5,
        }
    )
)
{
    if (ev.AbstractReply is { } reply)
        Console.WriteLine(reply.Text);
}


RetrieveRawAsync

Performs a streaming semantic search across one or more memory spaces and returns matching chunks ranked by relevance as well as LLM-postprocessed results (like summarization, question-answering, etc.).

Lower-level variant: takes a fully-formed request and returns the raw stream without the flat-parameter convenience layer. Use the non-Raw form for the ergonomic call shape.

Declaration

public IAsyncEnumerable<RetrieveMemoryEvent> RetrieveRawAsync(RetrieveMemoryRequest request, CancellationToken ct = default)

HTTPPOST /v1/memories:retrieve

Parameters

TypeNameDescription
RetrieveMemoryRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

IAsyncEnumerable<RetrieveMemoryEvent> — an async stream; await foreach yields each RetrieveMemoryEvent across pages / events.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

await foreach (var item in client.Memories.RetrieveRawAsync(new RetrieveMemoryRequest { Message = "...", SpaceKeys = default! }))
{
    // handle each streamed event
}


GetAsync

Retrieves a single memory by its ID. PERMISSION CLARIFICATION: With READ_MEMORY_OWN permission, access is granted if you own the parent space OR if the parent space is public (public_read=true). With READ_MEMORY_ANY permission, you can access any memory regardless of ownership. This is a read-only operation with no side effects and is safe to retry. Returns NOT_FOUND if the memory or its parent space does not exist.

Declaration

public Task<Memory> GetAsync(string id, MemoriesGetOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/memories/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe UUID of the memory to retrieve
MemoriesGetOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<Memory> — an awaitable that resolves to Memory.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var memory = await client.Memories.GetAsync("your-memory-id");
Console.WriteLine(memory.ProcessingStatus);


ContentAsync

Returns the original binary payload for a memory. The response uses the memory's stored content type when available. Returns 404 when the memory does not have inline content; clients can check originalContentRef from the metadata endpoint to locate external content.

Declaration

public Task<byte[]> ContentAsync(string id, CancellationToken ct = default)

HTTPGET /v1/memories/&#123;id&#125;/content

Parameters

TypeNameDescription
stringidThe UUID of the memory to download
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<byte[]> — an awaitable that resolves to byte[].

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var content = await client.Memories.ContentAsync("your-memory-id");
Console.WriteLine($"{content.Length} bytes");


PagesAsync

Lists extracted page-image metadata for a memory with optional filters and pagination.

Declaration

public IAsyncEnumerable<MemoryPageImage> PagesAsync(string id, MemoriesPagesOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/memories/&#123;id&#125;/pages

Parameters

TypeNameDescription
stringidMemory UUID
MemoriesPagesOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

IAsyncEnumerable<MemoryPageImage> — an async stream; await foreach yields each MemoryPageImage across pages / events.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

// Auto-paginate page-image metadata for a memory.
await foreach (var pageImage in client.Memories.PagesAsync("your-memory-id"))
    Console.WriteLine(pageImage.PageIndex);


PagesImageAsync

Downloads inline bytes for one page image. The page index is required. The optional dpi and content type query parameters act as rendition filters; if omitted, the server returns the unique rendition for that page or rejects ambiguous matches.

Declaration

public Task<byte[]> PagesImageAsync(string id, string pageIndex, MemoriesPagesImageOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/memories/&#123;id&#125;/pages/&#123;pageIndex&#125;/image

Parameters

TypeNameDescription
stringidMemory UUID
stringpageIndex0-based page index
MemoriesPagesImageOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<byte[]> — an awaitable that resolves to byte[].

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
ArgumentExceptionpageIndex is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var imageBytes = await client.Memories.PagesImageAsync("your-memory-id", "0");
Console.WriteLine($"{imageBytes.Length} bytes");


ListAsync

Lists memories within a given space. Results are paginated; pass the response's nextToken back as a query parameter to fetch subsequent pages.

Declaration

public IAsyncEnumerable<Memory> ListAsync(string spaceId, MemoriesListOptions? options = null, CancellationToken ct = default)

HTTPGET /v1/spaces/&#123;spaceId&#125;/memories

Parameters

TypeNameDescription
stringspaceIdThe UUID of the space containing the memories
MemoriesListOptionsoptionsOptions bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

IAsyncEnumerable<Memory> — an async stream; await foreach yields each Memory across pages / events.

Exceptions

TypeCondition
ArgumentExceptionspaceId is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Examples

Example 1:

await foreach (var memory in client.Memories.ListAsync("your-space-id"))
    Console.WriteLine($"{memory.MemoryId} {memory.ProcessingStatus}");

Example 2:

// Resume from a pagination token you saved from an earlier page.
var savedToken = "your-saved-token";
await foreach (
    var memory in client.Memories.ListAsync(
        "your-space-id",
        new MemoriesListOptions { NextToken = savedToken }
    )
)
    Console.WriteLine(memory.MemoryId);


DeleteAsync

Permanently deletes a memory and its associated chunks. This operation cannot be undone and immediately removes the memory record from the database. IDEMPOTENCY: This operation is safe to retry - may return NOT_FOUND if the memory was already deleted or never existed. Requires DELETE_MEMORY_OWN permission for memories in spaces you own (or DELETE_MEMORY_ANY for admin users to delete any memory). Side effects include permanent removal of the memory record and all associated chunk data.

Declaration

public Task DeleteAsync(string id, CancellationToken ct = default)

HTTPDELETE /v1/memories/&#123;id&#125;

Parameters

TypeNameDescription
stringidThe UUID of the memory to delete
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task — completes when the operation finishes; there is no response body.

Exceptions

TypeCondition
ArgumentExceptionid is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

await client.Memories.DeleteAsync("your-memory-id");


BatchCreateAsync

Create multiple memories in a single batch. Each item in requests follows the same per-call shape as memories.create: provide exactly one of originalContent or originalContentB64; originalContentB64 requires contentType (auto-inferred to text/plain for plain-text originalContent); originalContentRef is a metadata pointer that may accompany the content source. Per-item failures are reported individually and do NOT abort the batch.

Declaration

public Task<BatchMemoryResponse> BatchCreateAsync(JsonBatchMemoryCreationRequest request, CancellationToken ct = default)

HTTPPOST /v1/memories:batchCreate

Parameters

TypeNameDescription
JsonBatchMemoryCreationRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<BatchMemoryResponse> — an awaitable that resolves to BatchMemoryResponse.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var result = await client.Memories.BatchCreateAsync(
    new JsonBatchMemoryCreationRequest
    {
        Requests = new[]
        {
            new JsonMemoryCreationRequest
            {
                SpaceId = "your-space-id",
                OriginalContent = "Batch memory one.",
                ContentType = "text/plain",
            },
            new JsonMemoryCreationRequest
            {
                SpaceId = "your-space-id",
                OriginalContent = "Batch memory two.",
                ContentType = "text/plain",
            },
        },
    }
);
foreach (var r in result.Results)
    if (r.Memory is not null)
        Console.WriteLine(r.Memory.MemoryId);


BatchGetAsync

Retrieves multiple memories in a single operation, with individual success/failure results.

Declaration

public Task<BatchMemoryResponse> BatchGetAsync(BatchMemoryRetrievalRequest request, CancellationToken ct = default)

HTTPPOST /v1/memories:batchGet

Parameters

TypeNameDescription
BatchMemoryRetrievalRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<BatchMemoryResponse> — an awaitable that resolves to BatchMemoryResponse.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var result = await client.Memories.BatchGetAsync(
    new BatchMemoryRetrievalRequest { MemoryIds = new[] { "your-batch-memory-id" } }
);
foreach (var r in result.Results)
    if (r.Memory is not null)
        Console.WriteLine(r.Memory.ProcessingStatus);


BatchDeleteAsync

Deletes memories using selector entries. Each selector can target either a specific memory ID or a filtered subset scoped to a specific space.

Declaration

public Task<BatchMemoryResponse> BatchDeleteAsync(BatchMemoryDeletionRequest request, CancellationToken ct = default)

HTTPPOST /v1/memories:batchDelete

Parameters

TypeNameDescription
BatchMemoryDeletionRequestrequestThe request payload; the linked model lists every field and its JSON wire name.
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<BatchMemoryResponse> — an awaitable that resolves to BatchMemoryResponse.

Exceptions

TypeCondition
ArgumentNullExceptionrequest is null.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var result = await client.Memories.BatchDeleteAsync(
    new BatchMemoryDeletionRequest
    {
        Requests = new[]
        {
            new BatchDeleteMemorySelectorRequest { MemoryId = "your-batch-memory-id" },
        },
    }
);
Console.WriteLine(result.TotalDeleted);


CreateFromStreamAsync

Declaration

public Task<Memory> CreateFromStreamAsync(string spaceId, Stream content, string fileName, JsonMemoryCreationRequest? request = null, CancellationToken ct = default)

Parameters

TypeNameDescription
stringspaceId
Streamcontent
stringfileName
JsonMemoryCreationRequestrequestThe request payload; the linked model lists every field and its JSON wire name. (optional)
CancellationTokenctCancellation / deadline signal for the call. (optional)

Returns

Task<Memory> — an awaitable that resolves to Memory.

Exceptions

TypeCondition
ArgumentExceptionspaceId is null or empty.
ArgumentNullExceptioncontent is null.
ArgumentExceptionfileName is null or empty.
NetworkExceptionThe request could not reach the server (DNS, connection, or TLS failure).
ApiExceptionThe server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409).

Example

var result = await client.Memories.CreateFromStreamAsync("your-space-id", File.OpenRead("/path/to/document.pdf"), "document.pdf", new JsonMemoryCreationRequest { SpaceId = "your-space-id", ContentType = "..." });

Data Models

Types in the Goodmem.Client.Models namespace. Each row lists the C# property, its type, the JSON wire name, and a description.

JsonBatchMemoryCreationRequest

Request body for creating multiple memories via application/json.

PropertyTypeJSON (wire)Description
RequestsIReadOnlyList<JsonMemoryCreationRequest>requestsArray of memory creation requests.

JsonMemoryCreationRequest

Request body for creating a new Memory. A Memory represents content stored in a space.

PropertyTypeJSON (wire)Description
MemoryIdstringmemoryIdOptional client-provided UUID for the memory. If omitted, the server generates one. Returns ALREADY_EXISTS if the ID is already in use. (optional)
SpaceIdstringspaceIdID of the space where this memory will be stored
OriginalContentstringoriginalContentOriginal content as plain text (use either this or originalContentB64) (optional)
OriginalContentB64stringoriginalContentB64Original content as base64-encoded binary data (use either this or originalContent) (optional)
OriginalContentRefstringoriginalContentRefReference to external content location (optional)
ContentTypestringcontentTypeMIME type of the content
MetadataIReadOnlyDictionary<string, object>metadataAdditional metadata for the memory (optional)
ChunkingConfigChunkingConfigurationchunkingConfigChunking strategy for this memory (if not provided, uses space default) (optional)
ExtractPageImagesboolextractPageImagesOptional hint to extract page images for eligible document types (for example, PDFs) (optional)
FileFieldstringfileFieldOptional multipart file field name to bind binary content; required when multiple files are uploaded in a batch multipart request. (optional)

BatchMemoryResponse

Response containing per-item results for a batch memories operation

PropertyTypeJSON (wire)Description
ResultsIReadOnlyList<BatchMemoryResult>resultsArray of per-item results

BatchMemoryResult

Individual item result for a batch memories operation

PropertyTypeJSON (wire)Description
SuccessboolsuccessWhether this individual operation succeeded
MemoryIdstringmemoryIdMemory ID associated with this result (present for batchGet errors and batchDelete results) (optional)
MemoryMemorymemoryCreated or retrieved memory (present when the operation returns a memory on success) (optional)
ErrorErrorDetailerrorError details when success is false (optional)

Memory

Memory object containing stored content and metadata

PropertyTypeJSON (wire)Description
MemoryIdstringmemoryIdUnique identifier of the memory
SpaceIdstringspaceIdID of the space containing this memory
OriginalContentbyte[]originalContentOriginal content (only included if requested) (optional)
OriginalContentLengthlongoriginalContentLengthSize in bytes of the inline original content (optional)
OriginalContentSha256stringoriginalContentSha256SHA-256 digest of the inline original content, hex encoded (optional)
OriginalContentRefstringoriginalContentRefReference to external content location (optional)
ContentTypestringcontentTypeMIME type of the content
ProcessingStatusstringprocessingStatusProcessing status of the memory
PageImageStatusstringpageImageStatusProcessing status of page-image extraction for this memory
PageImageCountintpageImageCountNumber of extracted page-image renditions linked to this memory
MetadataIReadOnlyDictionary<string, object>metadataAdditional metadata for the memory (optional)
CreatedAtDateTimeOffsetcreatedAtTimestamp when the memory was created (milliseconds since epoch)
UpdatedAtDateTimeOffsetupdatedAtTimestamp when the memory was last updated (milliseconds since epoch)
CreatedByIdstringcreatedByIdID of the user who created this memory
UpdatedByIdstringupdatedByIdID of the user who last updated this memory
ChunkingConfigChunkingConfigurationchunkingConfigChunking strategy used for this memory (optional)
ProcessingHistoryProcessingHistoryprocessingHistoryBackground job processing history associated with this memory (optional)

ErrorDetail

Structured error details for an individual batch operation result

PropertyTypeJSON (wire)Description
CodeintcodeNumeric error code (typically an HTTP or gRPC-derived status code)
MessagestringmessageHuman-readable error message

ProcessingHistory

Background job execution history associated with a memory

PropertyTypeJSON (wire)Description
LatestJobBackgroundJobSummarylatestJobSummary of the most recent background job (optional)
AttemptsIReadOnlyList<BackgroundJobAttempt>attemptsAttempt-level telemetry captured for the latest job (optional)

BackgroundJobSummary

Summary of the most recent background job execution for a resource

PropertyTypeJSON (wire)Description
JobIdlongjobIdDatabase identifier of the background job
JobTypestringjobTypeLogical job type dispatched by the background job framework
StatusstringstatusCurrent status of the background job
AttemptsintattemptsNumber of attempts started so far
MaxAttemptsintmaxAttemptsMaximum number of attempts allowed for this job
RunAtDateTimeOffsetrunAtTimestamp when the job becomes eligible to run (milliseconds since epoch) (optional)
LeaseUntilDateTimeOffsetleaseUntilLease expiration timestamp if the job is currently running (milliseconds since epoch) (optional)
LockedBystringlockedByIdentifier of the worker currently holding the lease, if any (optional)
LastErrorstringlastErrorMost recent short error message if the job failed (optional)
UpdatedAtDateTimeOffsetupdatedAtTimestamp when the job row was last updated (milliseconds since epoch) (optional)

BackgroundJobAttempt

Telemetry captured for a single execution attempt of a background job

PropertyTypeJSON (wire)Description
AttemptIdlongattemptIdIdentifier of the attempt
JobIdlongjobIdIdentifier of the job that owns this attempt
StartedAtDateTimeOffsetstartedAtAttempt start timestamp (milliseconds since epoch) (optional)
FinishedAtDateTimeOffsetfinishedAtAttempt completion timestamp (milliseconds since epoch) (optional)
OkboolokIndicates whether the attempt succeeded (null if still running) (optional)
WorkerIdstringworkerIdIdentifier of the worker processing the attempt (optional)
StatusMessagestringstatusMessageLatest status message reported by the worker (optional)
ProgressCurrentlongprogressCurrentCurrent progress counter value
ProgressTotallongprogressTotalTotal progress target when known (optional)
ProgressUnitstringprogressUnitUnit label associated with the progress counters (optional)
ProgressUpdatedAtDateTimeOffsetprogressUpdatedAtTimestamp when progress was last updated (milliseconds since epoch) (optional)
ErrorMessagestringerrorMessageShort error message recorded when the attempt failed (optional)
ErrorStacktracestringerrorStacktraceStack trace captured when the attempt failed, if available (optional)

BatchMemoryDeletionRequest

Request body for deleting memories using ID and/or filtered selectors

PropertyTypeJSON (wire)Description
RequestsIReadOnlyList<BatchDeleteMemorySelectorRequest>requestsArray of delete selectors

BatchDeleteMemorySelectorRequest

A single delete selector: either memoryId or filterSelector

PropertyTypeJSON (wire)Description
MemoryIdstringmemoryIdDeletes one specific memory by UUID (optional)
FilterSelectorFilteredDeleteMemorySelectorRequestfilterSelectorDeletes a filtered set of memories within a specific space (optional)

FilteredDeleteMemorySelectorRequest

Filtered selector scoped to a specific space

PropertyTypeJSON (wire)Description
SpaceIdstringspaceIdSpace ID scope for the filtered delete
StatusFilterstringstatusFilterOptional processing status filter (PENDING, PROCESSING, COMPLETED, FAILED) (optional)
FilterstringfilterOptional metadata filter expression (optional)

BatchMemoryRetrievalRequest

Request body for retrieving multiple memories by their IDs

PropertyTypeJSON (wire)Description
MemoryIdsIReadOnlyList<string>memoryIdsArray of memory IDs to retrieve
IncludeContentboolincludeContentWhether to include the original content in the response (optional)
IncludeProcessingHistoryboolincludeProcessingHistoryWhether to include background job processing history for each memory (optional)

MemoryListResponse

Response containing a list of memories within a space

PropertyTypeJSON (wire)Description
MemoriesIReadOnlyList<Memory>memoriesArray of memories in the space
NextTokenstringnextTokenToken for retrieving the next page of results (optional)

ListMemoryPageImagesResponse

Page of memory page-image metadata

PropertyTypeJSON (wire)Description
PageImagesIReadOnlyList<MemoryPageImage>pageImagesPage-image metadata rows
NextTokenstringnextTokenOpaque token for retrieving the next page (optional)

MemoryPageImage

Metadata for one memory page-image rendition

PropertyTypeJSON (wire)Description
MemoryIdstringmemoryIdMemory UUID
PageIndexintpageIndex0-based page index
DpiintdpiRender DPI
ContentTypestringcontentTypeImage MIME type
ImageContentLengthlongimageContentLengthImage byte length (optional)
ImageContentSha256stringimageContentSha256Hex-encoded SHA-256 digest of image content (optional)
CreatedAtDateTimeOffsetcreatedAtCreation timestamp (milliseconds since epoch)
UpdatedAtDateTimeOffsetupdatedAtLast update timestamp (milliseconds since epoch)
CreatedByIdstringcreatedByIdCreator user UUID
UpdatedByIdstringupdatedByIdLast updater user UUID

RetrieveMemoryRequest

Request body for semantic memory retrieval with optional embedder weight overrides.

PropertyTypeJSON (wire)Description
MessagestringmessagePrimary query/message for semantic search.
ContextIReadOnlyList<ContextItem>contextOptional context items (text or binary) to provide additional context for the search. (optional)
SpaceKeysIReadOnlyList<SpaceKey>spaceKeysList of spaces to search with optional per-embedder weight overrides.
RequestedSizeintrequestedSizeMaximum number of memories to retrieve. (optional)
OutputBudgetTokenBudgetoutputBudgetOptional soft cap for generated retrieve replies. When set to a positive token count, chat post-processing uses this value as the LLM completion-token budget. (optional)
FetchMemoryboolfetchMemoryWhether to include streamed memory-definition records in the response. Defaults to true when omitted. These records include memory metadata and audit fields, but omit originalContent unless fetchMemoryContent is true. (optional)
FetchMemoryContentboolfetchMemoryContentWhether streamed memory-definition records include originalContent bytes. Requires fetchMemory=true. Defaults to false when omitted. (optional)
HnswHnswOptionshnswOptional request-level HNSW tuning overrides. Advanced usage; available on POST retrieve. (optional)
PostProcessorPostProcessorpostProcessorOptional post-processor configuration to transform retrieval results. (optional)
LoggingLoggingOptionsloggingOptional durable request logging block for POST retrieve requests. Set logging.enabled=true to opt in, or supply flat scalar logging.callerAttributes to attach if caller opt-in or an admin policy logs the request. (optional)

ContextItem

Context item with either text or binary content.

PropertyTypeJSON (wire)Description
TextstringtextText content for this context item. (optional)
BinaryBinaryContentbinaryBinary content for this context item. (optional)

SpaceKey

Space configuration for retrieval operations with optional embedder weight overrides.

PropertyTypeJSON (wire)Description
SpaceIdstringspaceIdThe UUID for the space to search.
EmbedderWeightsIReadOnlyList<EmbedderWeight>embedderWeightsOptional per-embedder weight overrides for this space. If not specified, database defaults are used. (optional)
FilterstringfilterOptional filter expression that must evaluate to true for memories in this space. (optional)

TokenBudget

Soft token budget hint for retrieve request processing.

PropertyTypeJSON (wire)Description
TokensinttokensToken count for the budget. Must be positive.

HnswOptions

Optional request-level overrides for pgvector HNSW search settings. Unset fields inherit server defaults.

PropertyTypeJSON (wire)Description
EfSearchintefSearchHNSW candidate list size (1..1000). (optional)
IterativeScanHnswIterativeScaniterativeScanHNSW iterative scan mode. Use POST retrieve for this advanced tuning control. (optional)
MaxScanTuplesintmaxScanTuplesMaximum tuples to scan during iterative filtering (1..2147483647). (optional)
ScanMemMultiplierdoublescanMemMultiplierMultiplier on work_mem for iterative scanning (1.0..1000.0). (optional)

PostProcessor

Post-processor configuration for transforming retrieval results. Custom processors are discovered from installed extensions and must be referenced by their fully qualified factory class name. See https://docs.goodmem.ai/docs/reference/post-processors/chat-post-processor/ for the built-in ChatPostProcessor configuration.

PropertyTypeJSON (wire)Description
NamestringnameFully qualified factory class name of the post-processor to apply.
ConfigIReadOnlyDictionary<string, object>configConfiguration parameters for the post-processor. Fields depend on the selected processor; see the linked documentation for the built-in ChatPostProcessor schema. (optional)

LoggingOptions

PropertyTypeJSON (wire)Description
EnabledboolenabledOpts this request in to durable server-side request logging. False or omitted does not opt out of admin policy logging. (optional)
CallerAttributesIReadOnlyDictionary<string, object>callerAttributesOptional flat scalar attributes attached if this request is persisted by caller opt-in or admin policy logging. Supported value types are string, integer, floating-point, and boolean. At most 32 entries are accepted. (optional)

BinaryContent

Binary content with MIME type for context items.

PropertyTypeJSON (wire)Description
ContentTypestringcontentTypeMIME type of the binary content.
DatastringdataBase64-encoded binary data.

EmbedderWeight

Per-embedder weight override for retrieval operations.

PropertyTypeJSON (wire)Description
EmbedderIdstringembedderIdThe UUID for the embedder.
WeightdoubleweightThe weight to apply to this embedder's results. Can be positive, negative, or zero.

HnswIterativeScan

Iterative scan modes for HNSW index search.

String enum: "ITERATIVE_SCAN_UNSPECIFIED" · "ITERATIVE_SCAN_OFF" · "ITERATIVE_SCAN_RELAXED_ORDER" · "ITERATIVE_SCAN_STRICT_ORDER"

RetrieveMemoryEvent

Streaming event from memory retrieval operation

PropertyTypeJSON (wire)Description
ResultSetBoundaryResultSetBoundaryresultSetBoundaryResult set boundary marker (BEGIN/END) (optional)
AbstractReplyAbstractReplyabstractReplyGenerated abstractive reply (optional)
RetrievedItemRetrievedItemretrievedItemA retrieved memory or chunk (optional)
MemoryDefinitionMemorymemoryDefinitionMemory object to add to client's memories array (optional)
StatusGoodMemStatusstatusWarning or non-fatal status with granular codes (operation continues) (optional)

ResultSetBoundary

Boundary marker for logical result sets in streaming memory retrieval

PropertyTypeJSON (wire)Description
ResultSetIdstringresultSetIdUnique identifier for this result set (UUID)
KindstringkindType of boundary marker
StageNamestringstageNameFree-form label describing the pipeline stage
ExpectedItemsintexpectedItemsHint for progress tracking - expected number of items in this result set (optional)

AbstractReply

Generated abstractive reply with relevance information

PropertyTypeJSON (wire)Description
TextstringtextGenerated abstractive reply text
RelevanceScoredoublerelevanceScoreRelevance score for this reply (0.0 to 1.0)
ResultSetIdstringresultSetIdOptional result set ID linking this abstract to a specific result set (optional)

RetrievedItem

A retrieved result that can be either a Memory or MemoryChunk

PropertyTypeJSON (wire)Description
MemoryMemorymemoryComplete memory object (if retrieved) (optional)
ChunkChunkReferencechunkReference to a memory chunk (if retrieved) (optional)

ChunkReference

Reference to a memory chunk with pointer to its parent memory

PropertyTypeJSON (wire)Description
ResultSetIdstringresultSetIdResult set ID that produced this chunk
ChunkMemoryChunkResponsechunkThe memory chunk data
MemoryIndexintmemoryIndexIndex of the chunk's memory in the client's memories array
RelevanceScoredoublerelevanceScoreRelevance score for this chunk (0.0 to 1.0)

MemoryChunkResponse

Memory chunk information

PropertyTypeJSON (wire)Description
ChunkIdstringchunkIdUnique identifier of the memory chunk
MemoryIdstringmemoryIdID of the memory this chunk belongs to
ChunkSequenceNumberintchunkSequenceNumberSequence number of this chunk within the memory
ChunkTextstringchunkTextThe text content of this chunk
VectorStatusstringvectorStatusStatus of vector processing for this chunk
StartOffsetintstartOffsetStart offset of this chunk in the original content (optional)
EndOffsetintendOffsetEnd offset of this chunk in the original content (optional)
MetadataIReadOnlyDictionary<string, object>metadataAdditional metadata for the memory chunk (optional)
CreatedAtDateTimeOffsetcreatedAtCreation timestamp (milliseconds since epoch)
UpdatedAtDateTimeOffsetupdatedAtLast update timestamp (milliseconds since epoch)
CreatedByIdstringcreatedByIdID of the user who created the chunk
UpdatedByIdstringupdatedByIdID of the user who last updated the chunk