Memories API
Memories API documentation for .NET SDK
All URIs are relative to *http://localhost:8080*
| Method | HTTP request | Description |
|---|---|---|
| BatchCreateMemory | POST /v1/memories:batchCreate | Create multiple memories in a batch |
| BatchDeleteMemory | POST /v1/memories:batchDelete | Delete multiple memories by ID |
| BatchGetMemory | POST /v1/memories:batchGet | Get multiple memories by ID |
| CreateMemory | POST /v1/memories | Create a new memory |
| DeleteMemory | DELETE /v1/memories/{id} | Delete a memory |
| GetMemory | GET /v1/memories/{id} | Get a memory by ID |
| GetMemoryContent | GET /v1/memories/{id}/content | Download memory content |
| ListMemories | GET /v1/spaces/{spaceId}/memories | List memories in a space |
| RetrieveMemory | GET /v1/memories:retrieve | Stream semantic memory retrieval |
| RetrieveMemoryAdvanced | POST /v1/memories:retrieve | Advanced 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
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryCreationRequest | BatchMemoryCreationRequest | Batch 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 code | Description | Response headers |
|---|---|---|
| 200 | Results of batch memory creation operation | - |
| 207 | Multi-Status - partial success in batch operation | - |
| 400 | Invalid request - issues with one or more requests | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to create memories | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryDeletionRequest | BatchMemoryDeletionRequest | Batch 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 code | Description | Response headers |
|---|---|---|
| 200 | Results of batch memory deletion operation | - |
| 207 | Multi-Status - partial success in batch operation | - |
| 400 | Invalid request - issues with one or more memory IDs | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to delete one or more memories | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryRetrievalRequest | BatchMemoryRetrievalRequest | Batch 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 code | Description | Response headers |
|---|---|---|
| 200 | Results of batch memory retrieval operation | - |
| 207 | Multi-Status - partial success in batch operation | - |
| 400 | Invalid request - issues with one or more memory IDs | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to access one or more memories | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| memoryCreationRequest | MemoryCreationRequest | Memory creation details |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successfully created memory | * Location - URI of the created memory resource |
| 400 | Invalid request - missing required fields or invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to create memories | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The 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 code | Description | Response headers |
|---|---|---|
| 204 | Memory successfully deleted | - |
| 400 | Invalid request - memory ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to delete this memory | - |
| 404 | Not found - memory with the specified ID does not exist | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The unique identifier of the memory to retrieve | |
| includeContent | bool? | Whether to include the original content in the response (defaults to false) | [optional] |
| includeProcessingHistory | bool? | Whether to include background job processing history in the response (defaults to false) | [optional] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved memory | - |
| 400 | Invalid request - memory ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to view this memory | - |
| 404 | Not found - memory with the specified ID does not exist | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The 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 code | Description | Response headers |
|---|---|---|
| 200 | Memory content streamed successfully | - |
| 400 | Invalid request - memory ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to view this memory | - |
| 404 | Not found - memory has no inline content or does not exist | - |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| spaceId | string | The unique identifier of the space containing the memories | |
| includeContent | bool? | Whether to include the original content in the response (defaults to false) | [optional] |
| statusFilter | string? | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED) | [optional] |
| maxResults | 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] |
| nextToken | 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] |
| sortBy | string? | Field to sort by (e.g., 'created_at') | [optional] |
| sortOrder | string? | Sort direction (ASCENDING or DESCENDING) | [optional] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved memories | - |
| 400 | Invalid request - space ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to list memories in this space | - |
| 404 | Not found - space with the specified ID does not exist | - |
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 generationppRerankerId: UUID of reranker for result rerankingppRelevanceThreshold: Minimum relevance scoreppLlmTemp: LLM temperature for generationppMaxResults: Maximum results to returnppChronologicalResort: Whether to resort by creation timeformat: Streaming format ("ndjson"or"sse")
Return type
IAsyncEnumerable<StreamingEvent> - Async stream of memory retrieval events
Authorization
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 messageSpaceIds: List of space UUIDsRequestedSize: Maximum memories to retrieveFetchMemory: Whether to fetch memory definitionsFetchMemoryContent: Whether to fetch original contentFormat: Streaming format ("ndjson"or"sse")PostProcessorName: Name of custom post-processorPostProcessorConfig: Configuration dictionary for the post-processor
Return type
IAsyncEnumerable<StreamingEvent> - Async stream of memory retrieval events