Memories API
Memories API documentation for Go 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
BatchCreateMemory(ctx).BatchMemoryCreationRequest(batchMemoryCreationRequest).Execute()
Create multiple memories in a batch
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
batchMemoryCreationRequest := *goodmem_client.NewBatchMemoryCreationRequest([]goodmem_client.MemoryCreationRequest{*goodmem_client.NewMemoryCreationRequest("550e8400-e29b-41d4-a716-446655440000", "text/plain")}) // BatchMemoryCreationRequest | Batch memory creation details
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
r, err := apiClient.MemoriesAPI.BatchCreateMemory(context.Background()).BatchMemoryCreationRequest(batchMemoryCreationRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.BatchCreateMemory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiBatchCreateMemoryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryCreationRequest | BatchMemoryCreationRequest | Batch memory creation details |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
BatchDeleteMemory
BatchDeleteMemory(ctx).BatchMemoryDeletionRequest(batchMemoryDeletionRequest).Execute()
Delete multiple memories by ID
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
batchMemoryDeletionRequest := *goodmem_client.NewBatchMemoryDeletionRequest([]string{"MemoryIds_example"}) // BatchMemoryDeletionRequest | Batch memory deletion details
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
r, err := apiClient.MemoriesAPI.BatchDeleteMemory(context.Background()).BatchMemoryDeletionRequest(batchMemoryDeletionRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.BatchDeleteMemory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiBatchDeleteMemoryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryDeletionRequest | BatchMemoryDeletionRequest | Batch memory deletion details |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
BatchGetMemory
BatchGetMemory(ctx).BatchMemoryRetrievalRequest(batchMemoryRetrievalRequest).Execute()
Get multiple memories by ID
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
batchMemoryRetrievalRequest := *goodmem_client.NewBatchMemoryRetrievalRequest([]string{"MemoryIds_example"}) // BatchMemoryRetrievalRequest | Batch memory retrieval details
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
r, err := apiClient.MemoriesAPI.BatchGetMemory(context.Background()).BatchMemoryRetrievalRequest(batchMemoryRetrievalRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.BatchGetMemory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiBatchGetMemoryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| batchMemoryRetrievalRequest | BatchMemoryRetrievalRequest | Batch memory retrieval details |
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
CreateMemory
Memory CreateMemory(ctx).MemoryCreationRequest(memoryCreationRequest).Execute()
Create a new memory
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
memoryCreationRequest := *goodmem_client.NewMemoryCreationRequest("550e8400-e29b-41d4-a716-446655440000", "text/plain") // MemoryCreationRequest | Memory creation details
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
resp, r, err := apiClient.MemoriesAPI.CreateMemory(context.Background()).MemoryCreationRequest(memoryCreationRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.CreateMemory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateMemory`: Memory
fmt.Fprintf(os.Stdout, "Response from `MemoriesAPI.CreateMemory`: %v\n", resp)
}Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiCreateMemoryRequest struct via the builder pattern
| 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
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
DeleteMemory
DeleteMemory(ctx, id).Execute()
Delete a memory
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the memory to delete
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
r, err := apiClient.MemoriesAPI.DeleteMemory(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.DeleteMemory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | The unique identifier of the memory to delete |
Other Parameters
Other parameters are passed through a pointer to a apiDeleteMemoryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
GetMemory
Memory GetMemory(ctx, id).IncludeContent(includeContent).IncludeProcessingHistory(includeProcessingHistory).Execute()
Get a memory by ID
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the memory to retrieve
includeContent := false // bool | Whether to include the original content in the response (defaults to false) (optional)
includeProcessingHistory := false // bool | Whether to include background job processing history in the response (defaults to false) (optional)
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
resp, r, err := apiClient.MemoriesAPI.GetMemory(context.Background(), id).IncludeContent(includeContent).IncludeProcessingHistory(includeProcessingHistory).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.GetMemory``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetMemory`: Memory
fmt.Fprintf(os.Stdout, "Response from `MemoriesAPI.GetMemory`: %v\n", resp)
}Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | The unique identifier of the memory to retrieve |
Other Parameters
Other parameters are passed through a pointer to a apiGetMemoryRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
includeContent | bool | Whether to include the original content in the response (defaults to false) | includeProcessingHistory | bool | Whether to include background job processing history in the response (defaults to false) |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
GetMemoryContent
GetMemoryContent(ctx, id).Execute()
Download memory content
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the memory to download
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
r, err := apiClient.MemoriesAPI.GetMemoryContent(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.GetMemoryContent``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | The unique identifier of the memory to download |
Other Parameters
Other parameters are passed through a pointer to a apiGetMemoryContentRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
Return type
(empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
ListMemories
MemoryListResponse ListMemories(ctx, spaceId).IncludeContent(includeContent).StatusFilter(statusFilter).MaxResults(maxResults).NextToken(nextToken).SortBy(sortBy).SortOrder(sortOrder).Execute()
List memories in a space
Example
package main
import (
"context"
"fmt"
"os"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
spaceId := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the space containing the memories
includeContent := false // bool | Whether to include the original content in the response (defaults to false) (optional)
statusFilter := "COMPLETED" // string | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED) (optional)
maxResults := int32(100) // int32 | 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 := "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)
sortBy := "created_at" // string | Field to sort by (e.g., 'created_at') (optional)
sortOrder := "DESCENDING" // string | Sort direction (ASCENDING or DESCENDING) (optional)
configuration := goodmem_client.NewConfiguration()
apiClient := goodmem_client.NewAPIClient(configuration)
resp, r, err := apiClient.MemoriesAPI.ListMemories(context.Background(), spaceId).IncludeContent(includeContent).StatusFilter(statusFilter).MaxResults(maxResults).NextToken(nextToken).SortBy(sortBy).SortOrder(sortOrder).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MemoriesAPI.ListMemories``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListMemories`: MemoryListResponse
fmt.Fprintf(os.Stdout, "Response from `MemoriesAPI.ListMemories`: %v\n", resp)
}Path Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| spaceId | string | The unique identifier of the space containing the memories |
Other Parameters
Other parameters are passed through a pointer to a apiListMemoriesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
includeContent | bool | Whether to include the original content in the response (defaults to false) | statusFilter | string | Filter memories by processing status (PENDING, PROCESSING, COMPLETED, FAILED) | maxResults | int32 | IGNORED: The current server implementation does not support pagination for this endpoint. This parameter is documented for future compatibility but will be ignored. | 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. | sortBy | string | Field to sort by (e.g., 'created_at') | sortOrder | string | Sort direction (ASCENDING or DESCENDING) |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK
RetrieveMemory
📡 Stream Semantic Memory Retrieval
Use the StreamingClient for streaming memory retrieval:
Working Example with Streaming Client
package main
import (
"context"
"fmt"
"log"
goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)
func main() {
// Configure client
configuration := goodmem_client.NewConfiguration()
configuration.Host = "http://localhost:8080"
configuration.DefaultHeader["X-API-Key"] = "your-api-key"
apiClient := goodmem_client.NewAPIClient(configuration)
streamingClient := goodmem_client.NewStreamingClient(apiClient)
// Helper values
requestedSize := int32(10)
fetchMemory := true
fetchMemoryContent := false
llmID := "550e8400-e29b-41d4-a716-446655440001"
rerankerID := "550e8400-e29b-41d4-a716-446655440000"
relevanceThreshold := 0.5
llmTemp := 0.3
maxResults := int32(10)
chronologicalResort := true
// Stream with ChatPostProcessor
ctx := context.Background()
stream, err := streamingClient.RetrieveMemoryStreamChat(
ctx,
"your search query",
[]string{"space-uuid"},
&requestedSize,
&fetchMemory,
&fetchMemoryContent,
goodmem_client.FormatNDJSON, // or FormatSSE
&llmID,
&rerankerID,
&relevanceThreshold,
&llmTemp,
&maxResults,
&chronologicalResort,
)
if err != nil {
log.Fatalf("Error: %v", err)
}
// Process events
for event := range stream {
if event.AbstractReply != nil {
fmt.Printf("Abstract: %s
", event.AbstractReply.Text)
} else if event.RetrievedItem != nil && event.RetrievedItem.Memory != nil {
fmt.Printf("Memory: %v
", event.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 (FormatNDJSONorFormatSSE)
Return type
MemoryStreamChannel - Channel of streaming events