GoodMem
ReferenceClient SDKs.NET SDK

Memories API

Memories API documentation for .NET SDK

All URIs are relative to *http://localhost:8080*

MethodHTTP requestDescription
BatchCreateMemoryPOST /v1/memories:batchCreateCreate multiple memories in a batch
BatchDeleteMemoryPOST /v1/memories:batchDeleteDelete multiple memories by ID
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
ListMemoriesGET /v1/spaces/{spaceId}/memoriesList memories in a space
RetrieveMemoryGET /v1/memories:retrieveStream semantic memory retrieval
RetrieveMemoryAdvancedPOST /v1/memories:retrieveAdvanced semantic memory retrieval with JSON

BatchCreateMemory

void BatchCreateMemory (BatchMemoryCreationRequest batchMemoryCreationRequest)

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";](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 batchMemoryCreationRequest = new BatchMemoryCreationRequest(); // BatchMemoryCreationRequest | Batch memory creation details

            try
            {
                // Create multiple memories in a batch
                apiInstance.BatchCreateMemory(batchMemoryCreationRequest);
            }
            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
    apiInstance.BatchCreateMemoryWithHttpInfo(batchMemoryCreationRequest);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling MemoriesApi.BatchCreateMemoryWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

NameTypeDescriptionNotes
batchMemoryCreationRequestBatchMemoryCreationRequestBatch memory creation details

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • 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

void BatchDeleteMemory (BatchMemoryDeletionRequest batchMemoryDeletionRequest)

Delete multiple memories by ID

Deletes multiple memories in a single operation, with success/failure results for each ID.

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";](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 multiple memories by ID
                apiInstance.BatchDeleteMemory(batchMemoryDeletionRequest);
            }
            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 multiple memories by ID
    apiInstance.BatchDeleteMemoryWithHttpInfo(batchMemoryDeletionRequest);
}
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

void (empty response body)

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 memory IDs-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to delete one or more memories-

↑ Back to .NET SDK

BatchGetMemory

void 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";](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
                apiInstance.BatchGetMemory(batchMemoryRetrievalRequest);
            }
            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
    apiInstance.BatchGetMemoryWithHttpInfo(batchMemoryRetrievalRequest);
}
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

void (empty response body)

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 (MemoryCreationRequest memoryCreationRequest)

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. IMPORTANT: This operation is NOT idempotent - each request creates a new memory record. 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, generating a unique UUID, 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";](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 memoryCreationRequest = new MemoryCreationRequest(); // MemoryCreationRequest | Memory creation details

            try
            {
                // Create a new memory
                Memory result = apiInstance.CreateMemory(memoryCreationRequest);
                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(memoryCreationRequest);
    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
memoryCreationRequestMemoryCreationRequestMemory creation details

Return type

Memory

Authorization

No authorization required

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Successfully created memory* Location - URI of the created memory resource
400Invalid request - missing required fields or invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to create memories-

↑ 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";](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";](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) (optional) 
            var includeProcessingHistory = false;  // bool? | Whether to include background job processing history in the response (defaults to false) (optional) 

            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)[optional]
includeProcessingHistorybool?Whether to include background job processing history in the response (defaults to false)[optional]

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

void 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";](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
                apiInstance.GetMemoryContent(id);
            }
            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
    apiInstance.GetMemoryContentWithHttpInfo(id);
}
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

void (empty response body)

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

ListMemories

MemoryListResponse ListMemories (string spaceId, bool? includeContent = null, string? statusFilter = 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. CRITICAL: The current server implementation does NOT support pagination - the max_results and next_token parameters are IGNORED and all matching memories are returned. 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";](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) (optional) 
            var statusFilter = COMPLETED;  // string? | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED) (optional) 
            var maxResults = 100;  // int? | IGNORED: The current server implementation does not support pagination for this endpoint. This parameter is documented for future compatibility but will be ignored. (optional) 
            var nextToken = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...;  // string? | IGNORED: The current server implementation does not support pagination for this endpoint. This parameter is documented for future compatibility but will be ignored. (optional) 
            var sortBy = created_at;  // string? | Field to sort by (e.g., 'created_at') (optional) 
            var sortOrder = DESCENDING;  // string? | Sort direction (ASCENDING or DESCENDING) (optional) 

            try
            {
                // List memories in a space
                MemoryListResponse result = apiInstance.ListMemories(spaceId, includeContent, statusFilter, 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, statusFilter, 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)[optional]
statusFilterstring?Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED)[optional]
maxResultsint?IGNORED: The current server implementation does not support pagination for this endpoint. This parameter is documented for future compatibility but will be ignored.[optional]
nextTokenstring?IGNORED: The current server implementation does not support pagination for this endpoint. This parameter is documented for future compatibility but will be ignored.[optional]
sortBystring?Field to sort by (e.g., 'created_at')[optional]
sortOrderstring?Sort direction (ASCENDING or DESCENDING)[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

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";](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";](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