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
| Method | Summary |
|---|---|
CreateAsync | Create a new memory. |
CreateFromFileAsync | Create 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. |
RetrieveAsync | Runs a retrieval from the flat convenience parameters: SpaceIds expand into SpaceKeys and the flat post-processor keys assemble into a ChatPostProcessor. |
RetrieveRawAsync | Advanced semantic memory retrieval with JSON. |
GetAsync | Get a memory by ID. |
ContentAsync | Download memory content. |
PagesAsync | List memory page images. |
PagesImageAsync | Download memory page image content. |
ListAsync | List memories in a space. |
DeleteAsync | Delete a memory. |
BatchCreateAsync | Create multiple memories in a batch. |
BatchGetAsync | Get multiple memories by ID. |
BatchDeleteAsync | Delete memories in batch. |
CreateFromStreamAsync | Create 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)
HTTP — POST /v1/memories
Parameters
| Type | Name | Description |
|---|---|---|
JsonMemoryCreationRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<Memory> — an awaitable that resolves to Memory.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — POST /v1/memories
Parameters
| Type | Name | Description |
|---|---|---|
string | spaceId | ID of the space where this memory will be stored |
string | filePath | Path to a local file; it is read into memory and (for OCR) base64-encoded, with the content type inferred from the extension. |
JsonMemoryCreationRequest | request | The request payload; the linked model lists every field and its JSON wire name. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<Memory> — an awaitable that resolves to Memory.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | spaceId is null or empty. |
ArgumentException | filePath is null or empty. |
GoodmemException | The local file could not be read (I/O error, missing file, or access denied). |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — POST /v1/memories:retrieve
Parameters
| Type | Name | Description |
|---|---|---|
string | message | The natural-language query. |
RetrieveOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
IAsyncEnumerable<RetrieveMemoryEvent> — an async stream; await foreach yields each RetrieveMemoryEvent across pages / events.
Exceptions
| Type | Condition |
|---|---|
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — POST /v1/memories:retrieve
Parameters
| Type | Name | Description |
|---|---|---|
RetrieveMemoryRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
IAsyncEnumerable<RetrieveMemoryEvent> — an async stream; await foreach yields each RetrieveMemoryEvent across pages / events.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/memories/{id}
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The UUID of the memory to retrieve |
MemoriesGetOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<Memory> — an awaitable that resolves to Memory.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/memories/{id}/content
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The UUID of the memory to download |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<byte[]> — an awaitable that resolves to byte[].
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/memories/{id}/pages
Parameters
| Type | Name | Description |
|---|---|---|
string | id | Memory UUID |
MemoriesPagesOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
IAsyncEnumerable<MemoryPageImage> — an async stream; await foreach yields each MemoryPageImage across pages / events.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/memories/{id}/pages/{pageIndex}/image
Parameters
| Type | Name | Description |
|---|---|---|
string | id | Memory UUID |
string | pageIndex | 0-based page index |
MemoriesPagesImageOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<byte[]> — an awaitable that resolves to byte[].
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
ArgumentException | pageIndex is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — GET /v1/spaces/{spaceId}/memories
Parameters
| Type | Name | Description |
|---|---|---|
string | spaceId | The UUID of the space containing the memories |
MemoriesListOptions | options | Options bag carrying the lookup key(s) / convenience knobs; the linked type lists them all. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
IAsyncEnumerable<Memory> — an async stream; await foreach yields each Memory across pages / events.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | spaceId is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — DELETE /v1/memories/{id}
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The UUID of the memory to delete |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task — completes when the operation finishes; there is no response body.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | id is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — POST /v1/memories:batchCreate
Parameters
| Type | Name | Description |
|---|---|---|
JsonBatchMemoryCreationRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<BatchMemoryResponse> — an awaitable that resolves to BatchMemoryResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — POST /v1/memories:batchGet
Parameters
| Type | Name | Description |
|---|---|---|
BatchMemoryRetrievalRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<BatchMemoryResponse> — an awaitable that resolves to BatchMemoryResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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)
HTTP — POST /v1/memories:batchDelete
Parameters
| Type | Name | Description |
|---|---|---|
BatchMemoryDeletionRequest | request | The request payload; the linked model lists every field and its JSON wire name. |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<BatchMemoryResponse> — an awaitable that resolves to BatchMemoryResponse.
Exceptions
| Type | Condition |
|---|---|
ArgumentNullException | request is null. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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
| Type | Name | Description |
|---|---|---|
string | spaceId | |
Stream | content | |
string | fileName | |
JsonMemoryCreationRequest | request | The request payload; the linked model lists every field and its JSON wire name. (optional) |
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<Memory> — an awaitable that resolves to Memory.
Exceptions
| Type | Condition |
|---|---|
ArgumentException | spaceId is null or empty. |
ArgumentNullException | content is null. |
ArgumentException | fileName is null or empty. |
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Requests | IReadOnlyList<JsonMemoryCreationRequest> | requests | Array of memory creation requests. |
JsonMemoryCreationRequest
Request body for creating a new Memory. A Memory represents content stored in a space.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
MemoryId | string | memoryId | Optional client-provided UUID for the memory. If omitted, the server generates one. Returns ALREADY_EXISTS if the ID is already in use. (optional) |
SpaceId | string | spaceId | ID of the space where this memory will be stored |
OriginalContent | string | originalContent | Original content as plain text (use either this or originalContentB64) (optional) |
OriginalContentB64 | string | originalContentB64 | Original content as base64-encoded binary data (use either this or originalContent) (optional) |
OriginalContentRef | string | originalContentRef | Reference to external content location (optional) |
ContentType | string | contentType | MIME type of the content |
Metadata | IReadOnlyDictionary<string, object> | metadata | Additional metadata for the memory (optional) |
ChunkingConfig | ChunkingConfiguration | chunkingConfig | Chunking strategy for this memory (if not provided, uses space default) (optional) |
ExtractPageImages | bool | extractPageImages | Optional hint to extract page images for eligible document types (for example, PDFs) (optional) |
FileField | string | fileField | Optional 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
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Results | IReadOnlyList<BatchMemoryResult> | results | Array of per-item results |
BatchMemoryResult
Individual item result for a batch memories operation
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Success | bool | success | Whether this individual operation succeeded |
MemoryId | string | memoryId | Memory ID associated with this result (present for batchGet errors and batchDelete results) (optional) |
Memory | Memory | memory | Created or retrieved memory (present when the operation returns a memory on success) (optional) |
Error | ErrorDetail | error | Error details when success is false (optional) |
Memory
Memory object containing stored content and metadata
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
MemoryId | string | memoryId | Unique identifier of the memory |
SpaceId | string | spaceId | ID of the space containing this memory |
OriginalContent | byte[] | originalContent | Original content (only included if requested) (optional) |
OriginalContentLength | long | originalContentLength | Size in bytes of the inline original content (optional) |
OriginalContentSha256 | string | originalContentSha256 | SHA-256 digest of the inline original content, hex encoded (optional) |
OriginalContentRef | string | originalContentRef | Reference to external content location (optional) |
ContentType | string | contentType | MIME type of the content |
ProcessingStatus | string | processingStatus | Processing status of the memory |
PageImageStatus | string | pageImageStatus | Processing status of page-image extraction for this memory |
PageImageCount | int | pageImageCount | Number of extracted page-image renditions linked to this memory |
Metadata | IReadOnlyDictionary<string, object> | metadata | Additional metadata for the memory (optional) |
CreatedAt | DateTimeOffset | createdAt | Timestamp when the memory was created (milliseconds since epoch) |
UpdatedAt | DateTimeOffset | updatedAt | Timestamp when the memory was last updated (milliseconds since epoch) |
CreatedById | string | createdById | ID of the user who created this memory |
UpdatedById | string | updatedById | ID of the user who last updated this memory |
ChunkingConfig | ChunkingConfiguration | chunkingConfig | Chunking strategy used for this memory (optional) |
ProcessingHistory | ProcessingHistory | processingHistory | Background job processing history associated with this memory (optional) |
ErrorDetail
Structured error details for an individual batch operation result
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Code | int | code | Numeric error code (typically an HTTP or gRPC-derived status code) |
Message | string | message | Human-readable error message |
ProcessingHistory
Background job execution history associated with a memory
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
LatestJob | BackgroundJobSummary | latestJob | Summary of the most recent background job (optional) |
Attempts | IReadOnlyList<BackgroundJobAttempt> | attempts | Attempt-level telemetry captured for the latest job (optional) |
BackgroundJobSummary
Summary of the most recent background job execution for a resource
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
JobId | long | jobId | Database identifier of the background job |
JobType | string | jobType | Logical job type dispatched by the background job framework |
Status | string | status | Current status of the background job |
Attempts | int | attempts | Number of attempts started so far |
MaxAttempts | int | maxAttempts | Maximum number of attempts allowed for this job |
RunAt | DateTimeOffset | runAt | Timestamp when the job becomes eligible to run (milliseconds since epoch) (optional) |
LeaseUntil | DateTimeOffset | leaseUntil | Lease expiration timestamp if the job is currently running (milliseconds since epoch) (optional) |
LockedBy | string | lockedBy | Identifier of the worker currently holding the lease, if any (optional) |
LastError | string | lastError | Most recent short error message if the job failed (optional) |
UpdatedAt | DateTimeOffset | updatedAt | Timestamp when the job row was last updated (milliseconds since epoch) (optional) |
BackgroundJobAttempt
Telemetry captured for a single execution attempt of a background job
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
AttemptId | long | attemptId | Identifier of the attempt |
JobId | long | jobId | Identifier of the job that owns this attempt |
StartedAt | DateTimeOffset | startedAt | Attempt start timestamp (milliseconds since epoch) (optional) |
FinishedAt | DateTimeOffset | finishedAt | Attempt completion timestamp (milliseconds since epoch) (optional) |
Ok | bool | ok | Indicates whether the attempt succeeded (null if still running) (optional) |
WorkerId | string | workerId | Identifier of the worker processing the attempt (optional) |
StatusMessage | string | statusMessage | Latest status message reported by the worker (optional) |
ProgressCurrent | long | progressCurrent | Current progress counter value |
ProgressTotal | long | progressTotal | Total progress target when known (optional) |
ProgressUnit | string | progressUnit | Unit label associated with the progress counters (optional) |
ProgressUpdatedAt | DateTimeOffset | progressUpdatedAt | Timestamp when progress was last updated (milliseconds since epoch) (optional) |
ErrorMessage | string | errorMessage | Short error message recorded when the attempt failed (optional) |
ErrorStacktrace | string | errorStacktrace | Stack trace captured when the attempt failed, if available (optional) |
BatchMemoryDeletionRequest
Request body for deleting memories using ID and/or filtered selectors
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Requests | IReadOnlyList<BatchDeleteMemorySelectorRequest> | requests | Array of delete selectors |
BatchDeleteMemorySelectorRequest
A single delete selector: either memoryId or filterSelector
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
MemoryId | string | memoryId | Deletes one specific memory by UUID (optional) |
FilterSelector | FilteredDeleteMemorySelectorRequest | filterSelector | Deletes a filtered set of memories within a specific space (optional) |
FilteredDeleteMemorySelectorRequest
Filtered selector scoped to a specific space
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
SpaceId | string | spaceId | Space ID scope for the filtered delete |
StatusFilter | string | statusFilter | Optional processing status filter (PENDING, PROCESSING, COMPLETED, FAILED) (optional) |
Filter | string | filter | Optional metadata filter expression (optional) |
BatchMemoryRetrievalRequest
Request body for retrieving multiple memories by their IDs
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
MemoryIds | IReadOnlyList<string> | memoryIds | Array of memory IDs to retrieve |
IncludeContent | bool | includeContent | Whether to include the original content in the response (optional) |
IncludeProcessingHistory | bool | includeProcessingHistory | Whether to include background job processing history for each memory (optional) |
MemoryListResponse
Response containing a list of memories within a space
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Memories | IReadOnlyList<Memory> | memories | Array of memories in the space |
NextToken | string | nextToken | Token for retrieving the next page of results (optional) |
ListMemoryPageImagesResponse
Page of memory page-image metadata
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
PageImages | IReadOnlyList<MemoryPageImage> | pageImages | Page-image metadata rows |
NextToken | string | nextToken | Opaque token for retrieving the next page (optional) |
MemoryPageImage
Metadata for one memory page-image rendition
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
MemoryId | string | memoryId | Memory UUID |
PageIndex | int | pageIndex | 0-based page index |
Dpi | int | dpi | Render DPI |
ContentType | string | contentType | Image MIME type |
ImageContentLength | long | imageContentLength | Image byte length (optional) |
ImageContentSha256 | string | imageContentSha256 | Hex-encoded SHA-256 digest of image content (optional) |
CreatedAt | DateTimeOffset | createdAt | Creation timestamp (milliseconds since epoch) |
UpdatedAt | DateTimeOffset | updatedAt | Last update timestamp (milliseconds since epoch) |
CreatedById | string | createdById | Creator user UUID |
UpdatedById | string | updatedById | Last updater user UUID |
RetrieveMemoryRequest
Request body for semantic memory retrieval with optional embedder weight overrides.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Message | string | message | Primary query/message for semantic search. |
Context | IReadOnlyList<ContextItem> | context | Optional context items (text or binary) to provide additional context for the search. (optional) |
SpaceKeys | IReadOnlyList<SpaceKey> | spaceKeys | List of spaces to search with optional per-embedder weight overrides. |
RequestedSize | int | requestedSize | Maximum number of memories to retrieve. (optional) |
OutputBudget | TokenBudget | outputBudget | Optional 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) |
FetchMemory | bool | fetchMemory | Whether 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) |
FetchMemoryContent | bool | fetchMemoryContent | Whether streamed memory-definition records include originalContent bytes. Requires fetchMemory=true. Defaults to false when omitted. (optional) |
Hnsw | HnswOptions | hnsw | Optional request-level HNSW tuning overrides. Advanced usage; available on POST retrieve. (optional) |
PostProcessor | PostProcessor | postProcessor | Optional post-processor configuration to transform retrieval results. (optional) |
Logging | LoggingOptions | logging | Optional 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Text | string | text | Text content for this context item. (optional) |
Binary | BinaryContent | binary | Binary content for this context item. (optional) |
SpaceKey
Space configuration for retrieval operations with optional embedder weight overrides.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
SpaceId | string | spaceId | The UUID for the space to search. |
EmbedderWeights | IReadOnlyList<EmbedderWeight> | embedderWeights | Optional per-embedder weight overrides for this space. If not specified, database defaults are used. (optional) |
Filter | string | filter | Optional filter expression that must evaluate to true for memories in this space. (optional) |
TokenBudget
Soft token budget hint for retrieve request processing.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Tokens | int | tokens | Token count for the budget. Must be positive. |
HnswOptions
Optional request-level overrides for pgvector HNSW search settings. Unset fields inherit server defaults.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
EfSearch | int | efSearch | HNSW candidate list size (1..1000). (optional) |
IterativeScan | HnswIterativeScan | iterativeScan | HNSW iterative scan mode. Use POST retrieve for this advanced tuning control. (optional) |
MaxScanTuples | int | maxScanTuples | Maximum tuples to scan during iterative filtering (1..2147483647). (optional) |
ScanMemMultiplier | double | scanMemMultiplier | Multiplier 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Name | string | name | Fully qualified factory class name of the post-processor to apply. |
Config | IReadOnlyDictionary<string, object> | config | Configuration parameters for the post-processor. Fields depend on the selected processor; see the linked documentation for the built-in ChatPostProcessor schema. (optional) |
LoggingOptions
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Enabled | bool | enabled | Opts this request in to durable server-side request logging. False or omitted does not opt out of admin policy logging. (optional) |
CallerAttributes | IReadOnlyDictionary<string, object> | callerAttributes | Optional 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.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
ContentType | string | contentType | MIME type of the binary content. |
Data | string | data | Base64-encoded binary data. |
EmbedderWeight
Per-embedder weight override for retrieval operations.
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
EmbedderId | string | embedderId | The UUID for the embedder. |
Weight | double | weight | The 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
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
ResultSetBoundary | ResultSetBoundary | resultSetBoundary | Result set boundary marker (BEGIN/END) (optional) |
AbstractReply | AbstractReply | abstractReply | Generated abstractive reply (optional) |
RetrievedItem | RetrievedItem | retrievedItem | A retrieved memory or chunk (optional) |
MemoryDefinition | Memory | memoryDefinition | Memory object to add to client's memories array (optional) |
Status | GoodMemStatus | status | Warning or non-fatal status with granular codes (operation continues) (optional) |
ResultSetBoundary
Boundary marker for logical result sets in streaming memory retrieval
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
ResultSetId | string | resultSetId | Unique identifier for this result set (UUID) |
Kind | string | kind | Type of boundary marker |
StageName | string | stageName | Free-form label describing the pipeline stage |
ExpectedItems | int | expectedItems | Hint for progress tracking - expected number of items in this result set (optional) |
AbstractReply
Generated abstractive reply with relevance information
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Text | string | text | Generated abstractive reply text |
RelevanceScore | double | relevanceScore | Relevance score for this reply (0.0 to 1.0) |
ResultSetId | string | resultSetId | Optional result set ID linking this abstract to a specific result set (optional) |
RetrievedItem
A retrieved result that can be either a Memory or MemoryChunk
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
Memory | Memory | memory | Complete memory object (if retrieved) (optional) |
Chunk | ChunkReference | chunk | Reference to a memory chunk (if retrieved) (optional) |
ChunkReference
Reference to a memory chunk with pointer to its parent memory
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
ResultSetId | string | resultSetId | Result set ID that produced this chunk |
Chunk | MemoryChunkResponse | chunk | The memory chunk data |
MemoryIndex | int | memoryIndex | Index of the chunk's memory in the client's memories array |
RelevanceScore | double | relevanceScore | Relevance score for this chunk (0.0 to 1.0) |
MemoryChunkResponse
Memory chunk information
| Property | Type | JSON (wire) | Description |
|---|---|---|---|
ChunkId | string | chunkId | Unique identifier of the memory chunk |
MemoryId | string | memoryId | ID of the memory this chunk belongs to |
ChunkSequenceNumber | int | chunkSequenceNumber | Sequence number of this chunk within the memory |
ChunkText | string | chunkText | The text content of this chunk |
VectorStatus | string | vectorStatus | Status of vector processing for this chunk |
StartOffset | int | startOffset | Start offset of this chunk in the original content (optional) |
EndOffset | int | endOffset | End offset of this chunk in the original content (optional) |
Metadata | IReadOnlyDictionary<string, object> | metadata | Additional metadata for the memory chunk (optional) |
CreatedAt | DateTimeOffset | createdAt | Creation timestamp (milliseconds since epoch) |
UpdatedAt | DateTimeOffset | updatedAt | Last update timestamp (milliseconds since epoch) |
CreatedById | string | createdById | ID of the user who created the chunk |
UpdatedById | string | updatedById | ID of the user who last updated the chunk |