GoodMem
ReferenceClient SDKs.NET

Memories API

Memories API documentation for .NET SDK

The default url is http://localhost:8080

MethodHTTP requestDescription
BatchCreateMemoryPOST /v1/memories:batchCreateCreate multiple memories in a batch
BatchDeleteMemoryPOST /v1/memories:batchDeleteDelete memories in batch
BatchGetMemoryPOST /v1/memories:batchGetGet multiple memories by ID
CreateMemoryPOST /v1/memoriesCreate a new memory
DeleteMemoryDELETE /v1/memories/{id}Delete a memory
GetMemoryGET /v1/memories/{id}Get a memory by ID
GetMemoryContentGET /v1/memories/{id}/contentDownload memory content
GetMemoryPageImageContentGET /v1/memories/{id}/pages/{pageIndex}/imageDownload memory page image content
ListMemoriesGET /v1/spaces/{spaceId}/memoriesList memories in a space
ListMemoryPageImagesGET /v1/memories/{id}/pagesList memory page images
RetrieveMemoryGET /v1/memories:retrieveStream semantic memory retrieval
RetrieveMemoryAdvancedPOST /v1/memories:retrieveAdvanced semantic memory retrieval with JSON

BatchCreateMemory

BatchMemoryResponse BatchCreateMemory (JsonBatchMemoryCreationRequest jsonBatchMemoryCreationRequest)

Create multiple memories in a batch

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class BatchCreateMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var jsonBatchMemoryCreationRequest = new JsonBatchMemoryCreationRequest(); // JsonBatchMemoryCreationRequest | Batch memory creation details. For application/json requests, each item must provide exactly one of originalContent or originalContentB64. For multipart/form-data, provide a requests part and one file part per request.

            try
            {
                // Create multiple memories in a batch
                BatchMemoryResponse result = apiInstance.BatchCreateMemory(jsonBatchMemoryCreationRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.BatchCreateMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BatchCreateMemoryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create multiple memories in a batch
    `ApiResponse<BatchMemoryResponse>` response = apiInstance.BatchCreateMemoryWithHttpInfo(jsonBatchMemoryCreationRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.BatchCreateMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
jsonBatchMemoryCreationRequestJsonBatchMemoryCreationRequestBatch memory creation details. For application/json requests, each item must provide exactly one of originalContent or originalContentB64. For multipart/form-data, provide a requests part and one file part per request.

Return type

BatchMemoryResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, multipart/form-data
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Results of batch memory creation operation-
207Multi-Status - partial success in batch operation-
400Invalid request - issues with one or more requests-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to create memories-

↑ Back to .NET SDK

BatchDeleteMemory

BatchMemoryResponse BatchDeleteMemory (BatchMemoryDeletionRequest batchMemoryDeletionRequest)

Delete memories in batch

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class BatchDeleteMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var batchMemoryDeletionRequest = new BatchMemoryDeletionRequest(); // BatchMemoryDeletionRequest | Batch memory deletion details

            try
            {
                // Delete memories in batch
                BatchMemoryResponse result = apiInstance.BatchDeleteMemory(batchMemoryDeletionRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.BatchDeleteMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BatchDeleteMemoryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete memories in batch
    `ApiResponse<BatchMemoryResponse>` response = apiInstance.BatchDeleteMemoryWithHttpInfo(batchMemoryDeletionRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.BatchDeleteMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
batchMemoryDeletionRequestBatchMemoryDeletionRequestBatch memory deletion details

Return type

BatchMemoryResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Results of batch memory deletion operation-
207Multi-Status - partial success in batch operation-
400Invalid request - issues with one or more selectors-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to delete one or more memories-

↑ Back to .NET SDK

BatchGetMemory

BatchMemoryResponse BatchGetMemory (BatchMemoryRetrievalRequest batchMemoryRetrievalRequest)

Get multiple memories by ID

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class BatchGetMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var batchMemoryRetrievalRequest = new BatchMemoryRetrievalRequest(); // BatchMemoryRetrievalRequest | Batch memory retrieval details

            try
            {
                // Get multiple memories by ID
                BatchMemoryResponse result = apiInstance.BatchGetMemory(batchMemoryRetrievalRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.BatchGetMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the BatchGetMemoryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get multiple memories by ID
    `ApiResponse<BatchMemoryResponse>` response = apiInstance.BatchGetMemoryWithHttpInfo(batchMemoryRetrievalRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.BatchGetMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
batchMemoryRetrievalRequestBatchMemoryRetrievalRequestBatch memory retrieval details

Return type

BatchMemoryResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Results of batch memory retrieval operation-
207Multi-Status - partial success in batch operation-
400Invalid request - issues with one or more memory IDs-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to access one or more memories-

↑ Back to .NET SDK

CreateMemory

Memory CreateMemory (JsonMemoryCreationRequest jsonMemoryCreationRequest)

Create a new memory

Creates a new memory in a specified space and starts asynchronous processing. The memory begins in PENDING status while a background job performs chunking and embedding generation. IDEMPOTENCY: If memoryId is omitted, the server generates a new UUID and retries are not idempotent. If the client supplies a stable memoryId, the operation behaves as create-if-absent: the first request creates the memory and subsequent retries return HTTP 409 Conflict (ALREADY_EXISTS) rather than creating duplicates. Returns INVALID_ARGUMENT if space_id, original_content, or content_type is missing or invalid. Returns NOT_FOUND if the specified space does not exist. Requires CREATE_MEMORY_OWN permission for spaces you own (or CREATE_MEMORY_ANY for admin users to create in any space). Side effects include creating the memory record and enqueuing a background processing job.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class CreateMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var jsonMemoryCreationRequest = new JsonMemoryCreationRequest(); // JsonMemoryCreationRequest | Memory creation details. For application/json requests, provide exactly one of originalContent or originalContentB64. For multipart/form-data, provide a JSON request part plus a file part.

            try
            {
                // Create a new memory
                Memory result = apiInstance.CreateMemory(jsonMemoryCreationRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.CreateMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateMemoryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create a new memory
    `ApiResponse<Memory>` response = apiInstance.CreateMemoryWithHttpInfo(jsonMemoryCreationRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.CreateMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
jsonMemoryCreationRequestJsonMemoryCreationRequestMemory creation details. For application/json requests, provide exactly one of originalContent or originalContentB64. For multipart/form-data, provide a JSON request part plus a file part.

Return type

Memory

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, multipart/form-data
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Successfully created memory* Location - URL of the created space resource
400Invalid request - missing required fields or invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to create memories-
409Conflict - a memory with the same client-specified memoryId already exists-

↑ Back to .NET SDK

DeleteMemory

void DeleteMemory (string id)

Delete a memory

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class DeleteMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var id = 550e8400-e29b-41d4-a716-446655440000;  // string | The unique identifier of the memory to delete

            try
            {
                // Delete a memory
                apiInstance.DeleteMemory(id);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.DeleteMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteMemoryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete a memory
    apiInstance.DeleteMemoryWithHttpInfo(id);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.DeleteMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
idstringThe unique identifier of the memory to delete

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status codeDescriptionResponse headers
204Memory successfully deleted-
400Invalid request - memory ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to delete this memory-
404Not found - memory with the specified ID does not exist-

↑ Back to .NET SDK

GetMemory

Memory GetMemory (string id, bool? includeContent = null, bool? includeProcessingHistory = null)

Get a memory by ID

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class GetMemoryExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var id = 550e8400-e29b-41d4-a716-446655440000;  // string | The unique identifier of the memory to retrieve
            var includeContent = false;  // bool? | Whether to include the original content in the response (defaults to false). The snake_case alias include_content is also accepted. (optional)  (default to false)
            var includeProcessingHistory = false;  // bool? | Whether to include background job processing history in the response (defaults to false). The snake_case alias include_processing_history is also accepted. (optional)  (default to false)

            try
            {
                // Get a memory by ID
                Memory result = apiInstance.GetMemory(id, includeContent, includeProcessingHistory);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.GetMemory: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetMemoryWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get a memory by ID
    `ApiResponse<Memory>` response = apiInstance.GetMemoryWithHttpInfo(id, includeContent, includeProcessingHistory);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.GetMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
idstringThe unique identifier of the memory to retrieve
includeContentbool?Whether to include the original content in the response (defaults to false). The snake_case alias include_content is also accepted.[optional] [default to false]
includeProcessingHistorybool?Whether to include background job processing history in the response (defaults to false). The snake_case alias include_processing_history is also accepted.[optional] [default to false]

Return type

Memory

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved memory-
400Invalid request - memory ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to view this memory-
404Not found - memory with the specified ID does not exist-

↑ Back to .NET SDK

GetMemoryContent

FileParameter GetMemoryContent (string id)

Download memory content

Streams 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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class GetMemoryContentExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var id = 550e8400-e29b-41d4-a716-446655440000;  // string | The unique identifier of the memory to download

            try
            {
                // Download memory content
                FileParameter result = apiInstance.GetMemoryContent(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.GetMemoryContent: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetMemoryContentWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Download memory content
    `ApiResponse<FileParameter>` response = apiInstance.GetMemoryContentWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.GetMemoryContentWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
idstringThe unique identifier of the memory to download

Return type

FileParameter

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

HTTP response details

Status codeDescriptionResponse headers
200Memory content streamed successfully-
400Invalid request - memory ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to view this memory-
404Not found - memory has no inline content or does not exist-

↑ Back to .NET SDK

GetMemoryPageImageContent

FileParameter GetMemoryPageImageContent (string id, int pageIndex, int? dpi = null, string? contentType = null)

Download memory page image content

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class GetMemoryPageImageContentExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var id = 550e8400-e29b-41d4-a716-446655440000;  // string | Memory UUID
            var pageIndex = 0;  // int | 0-based page index
            var dpi = 150;  // int? | Optional rendition filter. If omitted, the unique page-image rendition for the page is returned; if multiple renditions exist, specify dpi and/or contentType. (optional) 
            var contentType = image/png;  // string? | Optional rendition filter. MIME type of the desired page image, such as image/png. The snake_case alias content_type is also accepted. (optional) 

            try
            {
                // Download memory page image content
                FileParameter result = apiInstance.GetMemoryPageImageContent(id, pageIndex, dpi, contentType);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.GetMemoryPageImageContent: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetMemoryPageImageContentWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Download memory page image content
    `ApiResponse<FileParameter>` response = apiInstance.GetMemoryPageImageContentWithHttpInfo(id, pageIndex, dpi, contentType);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.GetMemoryPageImageContentWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
idstringMemory UUID
pageIndexint0-based page index
dpiint?Optional rendition filter. If omitted, the unique page-image rendition for the page is returned; if multiple renditions exist, specify dpi and/or contentType.[optional]
contentTypestring?Optional rendition filter. MIME type of the desired page image, such as image/png. The snake_case alias content_type is also accepted.[optional]

Return type

FileParameter

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

HTTP response details

Status codeDescriptionResponse headers
200Page-image content streamed successfully-
400Invalid request parameters-
401Unauthorized-
403Forbidden-
404Memory or rendition not found-

↑ Back to .NET SDK

ListMemories

MemoryListResponse ListMemories (string spaceId, bool? includeContent = null, bool? includeProcessingHistory = null, string? statusFilter = null, string? filter = null, int? maxResults = null, string? nextToken = null, string? sortBy = null, string? sortOrder = null)

List memories in a space

Lists all memories within a given space. Pagination is supported via maxResults and nextToken (opaque). nextToken is a URL-safe Base64 string without padding; do not parse or construct it. This is a read-only operation with no side effects and is safe to retry. Requires LIST_MEMORY_OWN or LIST_MEMORY_ANY permission. Returns NOT_FOUND if the specified space does not exist.

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class ListMemoriesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var spaceId = 550e8400-e29b-41d4-a716-446655440000;  // string | The unique identifier of the space containing the memories
            var includeContent = false;  // bool? | Whether to include the original content in the response (defaults to false). The snake_case alias include_content is also accepted. (optional)  (default to false)
            var includeProcessingHistory = false;  // bool? | Whether to include background job processing history in the response (defaults to false). The snake_case alias include_processing_history is also accepted. (optional)  (default to false)
            var statusFilter = COMPLETED;  // string? | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED). The snake_case alias status_filter is also accepted. (optional) 
            var filter = val('$.source') = 'email';  // string? | Optional metadata filter expression for list results (optional) 
            var maxResults = 100;  // int? | Maximum number of results per page (defaults to 50, clamped to [1, 500]). The snake_case alias max_results is also accepted. (optional)  (default to 50)
            var nextToken = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...;  // string? | Opaque pagination token for the next page. URL-safe Base64 without padding; do not parse or construct it. The snake_case alias next_token is also accepted. (optional) 
            var sortBy = created_at;  // string? | Field to sort by (e.g., 'created_at'). The snake_case alias sort_by is also accepted. (optional) 
            var sortOrder = DESCENDING;  // string? | Sort direction (ASCENDING or DESCENDING). The snake_case alias sort_order is also accepted. (optional) 

            try
            {
                // List memories in a space
                MemoryListResponse result = apiInstance.ListMemories(spaceId, includeContent, includeProcessingHistory, statusFilter, filter, maxResults, nextToken, sortBy, sortOrder);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.ListMemories: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListMemoriesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List memories in a space
    `ApiResponse<MemoryListResponse>` response = apiInstance.ListMemoriesWithHttpInfo(spaceId, includeContent, includeProcessingHistory, statusFilter, filter, maxResults, nextToken, sortBy, sortOrder);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.ListMemoriesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
spaceIdstringThe unique identifier of the space containing the memories
includeContentbool?Whether to include the original content in the response (defaults to false). The snake_case alias include_content is also accepted.[optional] [default to false]
includeProcessingHistorybool?Whether to include background job processing history in the response (defaults to false). The snake_case alias include_processing_history is also accepted.[optional] [default to false]
statusFilterstring?Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED). The snake_case alias status_filter is also accepted.[optional]
filterstring?Optional metadata filter expression for list results[optional]
maxResultsint?Maximum number of results per page (defaults to 50, clamped to [1, 500]). The snake_case alias max_results is also accepted.[optional] [default to 50]
nextTokenstring?Opaque pagination token for the next page. URL-safe Base64 without padding; do not parse or construct it. The snake_case alias next_token is also accepted.[optional]
sortBystring?Field to sort by (e.g., 'created_at'). The snake_case alias sort_by is also accepted.[optional]
sortOrderstring?Sort direction (ASCENDING or DESCENDING). The snake_case alias sort_order is also accepted.[optional]

Return type

MemoryListResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved memories-
400Invalid request - space ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to list memories in this space-
404Not found - space with the specified ID does not exist-

↑ Back to .NET SDK

ListMemoryPageImages

ListMemoryPageImagesResponse ListMemoryPageImages (string id, int? startPageIndex = null, int? endPageIndex = null, int? dpi = null, string? contentType = null, int? maxResults = null, string? nextToken = null)

List memory page images

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class ListMemoryPageImagesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://localhost";
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new MemoriesApi(httpClient, config, httpClientHandler);
            var id = 550e8400-e29b-41d4-a716-446655440000;  // string | Memory UUID
            var startPageIndex = 0;  // int? | Optional lower bound for returned page indices, inclusive. The snake_case alias start_page_index is also accepted. (optional) 
            var endPageIndex = 10;  // int? | Optional upper bound for returned page indices, inclusive. The snake_case alias end_page_index is also accepted. (optional) 
            var dpi = 150;  // int? | Optional rendition filter for page-image DPI. (optional) 
            var contentType = image/png;  // string? | Optional rendition filter for page-image MIME type, such as image/png. The snake_case alias content_type is also accepted. (optional) 
            var maxResults = 50;  // int? | Maximum number of results per page. The snake_case alias max_results is also accepted. (optional) 
            var nextToken = eyJzdGFydCI6NTAsIm1lbW9yeUlkIjoiLi4uIn0;  // string? | Opaque pagination token for the next page. The snake_case alias next_token is also accepted. Do not parse or construct it. (optional) 

            try
            {
                // List memory page images
                ListMemoryPageImagesResponse result = apiInstance.ListMemoryPageImages(id, startPageIndex, endPageIndex, dpi, contentType, maxResults, nextToken);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MemoriesApi.ListMemoryPageImages: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListMemoryPageImagesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List memory page images
    `ApiResponse<ListMemoryPageImagesResponse>` response = apiInstance.ListMemoryPageImagesWithHttpInfo(id, startPageIndex, endPageIndex, dpi, contentType, maxResults, nextToken);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.ListMemoryPageImagesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
idstringMemory UUID
startPageIndexint?Optional lower bound for returned page indices, inclusive. The snake_case alias start_page_index is also accepted.[optional]
endPageIndexint?Optional upper bound for returned page indices, inclusive. The snake_case alias end_page_index is also accepted.[optional]
dpiint?Optional rendition filter for page-image DPI.[optional]
contentTypestring?Optional rendition filter for page-image MIME type, such as image/png. The snake_case alias content_type is also accepted.[optional]
maxResultsint?Maximum number of results per page. The snake_case alias max_results is also accepted.[optional]
nextTokenstring?Opaque pagination token for the next page. The snake_case alias next_token is also accepted. Do not parse or construct it.[optional]

Return type

ListMemoryPageImagesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Page-image metadata retrieved successfully-
400Invalid request parameters-
401Unauthorized-
403Forbidden-
404Memory not found-

↑ Back to .NET SDK

RetrieveMemory

📡 Stream Semantic Memory Retrieval

Use the StreamingClient class for streaming memory retrieval:

Working Example with Streaming Client

using Pairsystems.Goodmem.Client;
using Pairsystems.Goodmem.Client.Client;
using System;
using System.Collections.Generic;
using System.Threading;

// Configure client
var config = new Configuration();
config.BasePath = "http://localhost:8080";
config.DefaultHeaders["X-API-Key"] = "your-api-key";

// Create streaming client
var streamingClient = new StreamingClient(config);

// Stream with ChatPostProcessor
await foreach (var ev in streamingClient.RetrieveMemoryStreamChatAsync(
    "your search query",                              // message
    new `List<string>` { "550e8400-e29b-41d4-a716-446655440000" },  // space IDs
    10,                                                // requested size
    true,                                              // fetch memory
    false,                                             // fetch memory content
    "ndjson",                                          // format (ndjson or sse)
    "550e8400-e29b-41d4-a716-446655440001",           // LLM ID
    "550e8400-e29b-41d4-a716-446655440000",           // reranker ID
    0.5,                                               // relevance threshold
    0.3,                                               // LLM temperature
    10,                                                // max results
    true,                                              // chronological resort
    CancellationToken.None))
{
    if (ev.AbstractReply != null)
    {
        Console.WriteLine($"Abstract: {ev.AbstractReply.Text}");
    }
    else if (ev.RetrievedItem?.Memory != null)
    {
        Console.WriteLine($"Memory: {ev.RetrievedItem.Memory}");
    }
}

Parameters

Same parameters as the standard method, with additional ChatPostProcessor parameters:

  • ppLlmId: UUID of LLM for abstract generation
  • ppRerankerId: UUID of reranker for result reranking
  • ppRelevanceThreshold: Minimum relevance score
  • ppLlmTemp: LLM temperature for generation
  • ppMaxResults: Maximum results to return
  • ppChronologicalResort: Whether to resort by creation time
  • format: Streaming format ("ndjson" or "sse")

Return type

IAsyncEnumerable<StreamingEvent> - Async stream of memory retrieval events

Authorization

ApiKeyAuth

RetrieveMemoryAdvanced

📡 Advanced Stream Semantic Memory Retrieval

Use the StreamingClient class for advanced streaming memory retrieval with custom post-processor configuration:

Working Example with Streaming Client

using Pairsystems.Goodmem.Client;
using Pairsystems.Goodmem.Client.Client;
using System;
using System.Collections.Generic;
using System.Threading;

// Configure client
var config = new Configuration();
config.BasePath = "http://localhost:8080";
config.DefaultHeaders["X-API-Key"] = "your-api-key";

// Create streaming client
var streamingClient = new StreamingClient(config);

// Create advanced request with custom post-processor
var request = new AdvancedMemoryStreamRequest
{
    Message = "your search query",
    SpaceIds = new `List<string>` { "550e8400-e29b-41d4-a716-446655440000" },
    RequestedSize = 10,
    FetchMemory = true,
    FetchMemoryContent = false,
    Format = "ndjson",  // or "sse"
    PostProcessorName = "com.goodmem.retrieval.postprocess.ChatPostProcessorFactory",
    PostProcessorConfig = new `Dictionary<string, object>`
    {
        ["llm_id"] = "550e8400-e29b-41d4-a716-446655440001",
        ["reranker_id"] = "550e8400-e29b-41d4-a716-446655440000",
        ["relevance_threshold"] = 0.5,
        ["llm_temp"] = 0.3,
        ["max_results"] = 10,
        ["chronological_resort"] = true
    }
};

// Execute advanced streaming
await foreach (var ev in streamingClient.RetrieveMemoryStreamAdvancedAsync(request, CancellationToken.None))
{
    if (ev.AbstractReply != null)
    {
        Console.WriteLine($"Abstract: {ev.AbstractReply.Text}");
    }
    else if (ev.RetrievedItem != null)
    {
        Console.WriteLine($"Retrieved item: {ev.RetrievedItem}");
    }
}

Parameters

Use AdvancedMemoryStreamRequest with:

  • Message: Query message
  • SpaceIds: List of space UUIDs
  • RequestedSize: Maximum memories to retrieve
  • FetchMemory: Whether to fetch memory definitions
  • FetchMemoryContent: Whether to fetch original content
  • Format: Streaming format ("ndjson" or "sse")
  • PostProcessorName: Name of custom post-processor
  • PostProcessorConfig: Configuration dictionary for the post-processor

Return type

IAsyncEnumerable<StreamingEvent> - Async stream of memory retrieval events

Authorization

ApiKeyAuth

On this page

BatchCreateMemoryExampleUsing the BatchCreateMemoryWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsBatchDeleteMemoryExampleUsing the BatchDeleteMemoryWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsBatchGetMemoryExampleUsing the BatchGetMemoryWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsCreateMemoryExampleUsing the CreateMemoryWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsDeleteMemoryExampleUsing the DeleteMemoryWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsGetMemoryExampleUsing the GetMemoryWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsGetMemoryContentExampleUsing the GetMemoryContentWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsGetMemoryPageImageContentExampleUsing the GetMemoryPageImageContentWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsListMemoriesExampleUsing the ListMemoriesWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsListMemoryPageImagesExampleUsing the ListMemoryPageImagesWithHttpInfo variantParametersReturn typeAuthorizationHTTP request headersHTTP response detailsRetrieveMemoryWorking Example with Streaming ClientParametersReturn typeAuthorizationRetrieveMemoryAdvancedWorking Example with Streaming ClientParametersReturn typeAuthorization