Memories API
Memories API documentation for Java SDK
The default url is http://localhost:8080
| Method | HTTP request | Description |
|---|---|---|
| batchCreateMemory | POST /v1/memories:batchCreate | Create multiple memories in a batch |
| batchDeleteMemory | POST /v1/memories:batchDelete | Delete memories in batch |
| 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 |
| getMemoryPageImageContent | GET /v1/memories/{id}/pages/{pageIndex}/image | Download memory page image content |
| listMemories | GET /v1/spaces/{spaceId}/memories | List memories in a space |
| listMemoryPageImages | GET /v1/memories/{id}/pages | List memory page images |
| retrieveMemory | GET /v1/memories:retrieve | Stream semantic memory retrieval |
| retrieveMemoryAdvanced | POST /v1/memories:retrieve | Advanced semantic memory retrieval with JSON |
batchCreateMemory
BatchMemoryResponse batchCreateMemory(jsonBatchMemoryCreationRequest)
Create multiple memories in a batch
Creates multiple memories in a single operation, with individual success/failure results.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
JsonBatchMemoryCreationRequest 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 {
BatchMemoryResponse result = apiInstance.batchCreateMemory(jsonBatchMemoryCreationRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#batchCreateMemory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| 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. |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json, multipart/form-data
- 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
BatchMemoryResponse batchDeleteMemory(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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
BatchMemoryDeletionRequest batchMemoryDeletionRequest = new BatchMemoryDeletionRequest(); // BatchMemoryDeletionRequest | Batch memory deletion details
try {
BatchMemoryResponse result = apiInstance.batchDeleteMemory(batchMemoryDeletionRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#batchDeleteMemory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryDeletionRequest | BatchMemoryDeletionRequest | Batch memory deletion 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 |
|---|---|---|
| 200 | Results of batch memory deletion operation | - |
| 207 | Multi-Status - partial success in batch operation | - |
| 400 | Invalid request - issues with one or more selectors | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to delete one or more memories | - |
batchGetMemory
BatchMemoryResponse batchGetMemory(batchMemoryRetrievalRequest)
Get multiple memories by ID
Retrieves multiple memories in a single operation, with individual success/failure results.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
BatchMemoryRetrievalRequest batchMemoryRetrievalRequest = new BatchMemoryRetrievalRequest(); // BatchMemoryRetrievalRequest | Batch memory retrieval details
try {
BatchMemoryResponse result = apiInstance.batchGetMemory(batchMemoryRetrievalRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#batchGetMemory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryRetrievalRequest | BatchMemoryRetrievalRequest | Batch memory retrieval 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 |
|---|---|---|
| 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(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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
JsonMemoryCreationRequest 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 {
Memory result = apiInstance.createMemory(jsonMemoryCreationRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#createMemory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| 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. |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json, multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successfully created memory | * Location - URL of the created space resource |
| 400 | Invalid request - missing required fields or invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to create memories | - |
| 409 | Conflict - a memory with the same client-specified memoryId already exists | - |
deleteMemory
deleteMemory(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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the memory to delete
try {
apiInstance.deleteMemory(id);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#deleteMemory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the memory to delete |
Return type
null (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(id, includeContent, includeProcessingHistory)
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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the memory to retrieve
Boolean includeContent = false; // Boolean | Whether to include the original content in the response (defaults to false). The snake_case alias include_content is also accepted.
Boolean includeProcessingHistory = false; // Boolean | Whether to include background job processing history in the response (defaults to false). The snake_case alias include_processing_history is also accepted.
try {
Memory result = apiInstance.getMemory(id, includeContent, includeProcessingHistory);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#getMemory");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the memory to retrieve | |
| includeContent | Boolean | 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] |
| includeProcessingHistory | Boolean | 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
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
File getMemoryContent(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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the memory to download
try {
File result = apiInstance.getMemoryContent(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#getMemoryContent");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the memory to download |
Return type
File
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 | - |
getMemoryPageImageContent
File getMemoryPageImageContent(id, pageIndex, dpi, contentType)
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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | Memory UUID
Integer pageIndex = 0; // Integer | 0-based page index
Integer dpi = 150; // Integer | Optional rendition filter. If omitted, the unique page-image rendition for the page is returned; if multiple renditions exist, specify dpi and/or contentType.
String 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.
try {
File result = apiInstance.getMemoryPageImageContent(id, pageIndex, dpi, contentType);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#getMemoryPageImageContent");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | Memory UUID | |
| pageIndex | Integer | 0-based page index | |
| dpi | Integer | 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] |
| contentType | 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] |
Return type
File
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Page-image content streamed successfully | - |
| 400 | Invalid request parameters | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Memory or rendition not found | - |
listMemories
MemoryListResponse listMemories(spaceId, includeContent, includeProcessingHistory, statusFilter, filter, maxResults, nextToken, sortBy, sortOrder)
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
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
String spaceId = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the space containing the memories
Boolean includeContent = false; // Boolean | Whether to include the original content in the response (defaults to false). The snake_case alias include_content is also accepted.
Boolean includeProcessingHistory = false; // Boolean | Whether to include background job processing history in the response (defaults to false). The snake_case alias include_processing_history is also accepted.
String statusFilter = "PENDING"; // String | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED). The snake_case alias status_filter is also accepted.
String filter = "val('$.source') = 'email'"; // String | Optional metadata filter expression for list results
Integer maxResults = 50; // Integer | Maximum number of results per page (defaults to 50, clamped to [1, 500]). The snake_case alias max_results is also accepted.
String 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.
String sortBy = "created_at"; // String | Field to sort by (e.g., 'created_at'). The snake_case alias sort_by is also accepted.
String sortOrder = "DESCENDING"; // String | Sort direction (ASCENDING or DESCENDING). The snake_case alias sort_order is also accepted.
try {
MemoryListResponse result = apiInstance.listMemories(spaceId, includeContent, includeProcessingHistory, statusFilter, filter, maxResults, nextToken, sortBy, sortOrder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#listMemories");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| spaceId | String | The unique identifier of the space containing the memories | |
| includeContent | Boolean | 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] |
| includeProcessingHistory | Boolean | 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] |
| statusFilter | String | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED). The snake_case alias status_filter is also accepted. | [optional] [enum: PENDING, PROCESSING, COMPLETED, FAILED] |
| filter | String | Optional metadata filter expression for list results | [optional] |
| maxResults | Integer | 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] |
| nextToken | 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] |
| sortBy | String | Field to sort by (e.g., 'created_at'). The snake_case alias sort_by is also accepted. | [optional] |
| sortOrder | String | Sort direction (ASCENDING or DESCENDING). The snake_case alias sort_order is also accepted. | [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 | - |
listMemoryPageImages
ListMemoryPageImagesResponse listMemoryPageImages(id, startPageIndex, endPageIndex, dpi, contentType, maxResults, nextToken)
List memory page images
Lists extracted page-image metadata for a memory with optional filters and pagination.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.MemoriesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
MemoriesApi apiInstance = new MemoriesApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | Memory UUID
Integer startPageIndex = 0; // Integer | Optional lower bound for returned page indices, inclusive. The snake_case alias start_page_index is also accepted.
Integer endPageIndex = 10; // Integer | Optional upper bound for returned page indices, inclusive. The snake_case alias end_page_index is also accepted.
Integer dpi = 150; // Integer | Optional rendition filter for page-image DPI.
String 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.
Integer maxResults = 50; // Integer | Maximum number of results per page. The snake_case alias max_results is also accepted.
String 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.
try {
ListMemoryPageImagesResponse result = apiInstance.listMemoryPageImages(id, startPageIndex, endPageIndex, dpi, contentType, maxResults, nextToken);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MemoriesApi#listMemoryPageImages");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | Memory UUID | |
| startPageIndex | Integer | Optional lower bound for returned page indices, inclusive. The snake_case alias start_page_index is also accepted. | [optional] |
| endPageIndex | Integer | Optional upper bound for returned page indices, inclusive. The snake_case alias end_page_index is also accepted. | [optional] |
| dpi | Integer | Optional rendition filter for page-image DPI. | [optional] |
| contentType | String | Optional rendition filter for page-image MIME type, such as image/png. The snake_case alias content_type is also accepted. | [optional] |
| maxResults | Integer | Maximum number of results per page. The snake_case alias max_results is also accepted. | [optional] |
| nextToken | String | 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
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Page-image metadata retrieved successfully | - |
| 400 | Invalid request parameters | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Memory not found | - |
retrieveMemory
📡 Stream Semantic Memory Retrieval
Use the StreamingClient class for streaming memory retrieval:
Working Example with Streaming Client
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.StreamingClient;
import ai.pairsys.goodmem.client.StreamingClient.*;
import java.util.List;
import java.util.stream.Stream;
public class BasicStreamingExample {
public static void main(String[] args) throws StreamError {
// Configure client
ApiClient apiClient = new ApiClient();
apiClient.setBasePath("http://localhost:8080");
apiClient.setApiKey("your-api-key");
// Create streaming client
StreamingClient streamingClient = new StreamingClient(apiClient);
// Stream memory retrieval results with ChatPostProcessor
Stream<MemoryStreamResponse> stream = streamingClient.retrieveMemoryStreamChat(
"your search query", // message
List.of("550e8400-e29b-41d4-a716-446655440000"), // space IDs
10, // requested size
true, // fetch memory
false, // fetch memory content
"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
);
// Process streaming events
stream.forEach(event -> {
if (event.getAbstractReply() != null) {
System.out.println("Abstract: " + event.getAbstractReply().getText());
} else if (event.getRetrievedItem() != null
&& event.getRetrievedItem().getMemory() != null) {
System.out.println("Memory: " + event.getRetrievedItem().getMemory());
}
});
}
}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 time
Return type
Stream<MemoryStreamResponse> - 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
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.StreamingClient;
import ai.pairsys.goodmem.client.StreamingClient.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
public class AdvancedStreamingExample {
public static void main(String[] args) throws StreamError {
// Configure client
ApiClient apiClient = new ApiClient();
apiClient.setBasePath("http://localhost:8080");
apiClient.setApiKey("your-api-key");
// Create streaming client
StreamingClient streamingClient = new StreamingClient(apiClient);
// Create advanced request with custom post-processor
AdvancedMemoryStreamRequest request = new AdvancedMemoryStreamRequest(
"your search query",
List.of("550e8400-e29b-41d4-a716-446655440000")
);
request.setRequestedSize(10);
request.setFetchMemory(true);
request.setFetchMemoryContent(false);
// Configure custom post-processor
request.setPostProcessorName("com.goodmem.retrieval.postprocess.ChatPostProcessorFactory");
Map<String, Object> postProcessorConfig = new HashMap<>();
postProcessorConfig.put("llm_id", "550e8400-e29b-41d4-a716-446655440001");
postProcessorConfig.put("reranker_id", "550e8400-e29b-41d4-a716-446655440000");
postProcessorConfig.put("relevance_threshold", 0.5);
postProcessorConfig.put("llm_temp", 0.3);
postProcessorConfig.put("max_results", 10);
postProcessorConfig.put("chronological_resort", true);
request.setPostProcessorConfig(postProcessorConfig);
// Execute advanced streaming
Stream<MemoryStreamResponse> stream = streamingClient.retrieveMemoryStreamAdvanced(request);
// Process streaming events
stream.forEach(event -> {
if (event.getAbstractReply() != null) {
System.out.println("Abstract: " + event.getAbstractReply().getText());
} else if (event.getRetrievedItem() != null) {
System.out.println("Retrieved item: " + event.getRetrievedItem());
}
});
}
}Parameters
Use AdvancedMemoryStreamRequest with:
message: Query messagespaceIds: List of space UUIDsrequestedSize: Maximum memories to retrievefetchMemory: Whether to fetch memory definitionsfetchMemoryContent: Whether to fetch original contentpostProcessorName: Name of custom post-processorpostProcessorConfig: Configuration map for the post-processor
Return type
Stream<MemoryStreamResponse> - Stream of memory retrieval events