GoodMem
ReferenceClient SDKsGo SDK

Memories API

Memories API documentation for Go 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

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

NameTypeDescriptionNotes
batchMemoryCreationRequestBatchMemoryCreationRequestBatch 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

NameTypeDescriptionNotes
batchMemoryDeletionRequestBatchMemoryDeletionRequestBatch 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

NameTypeDescriptionNotes
batchMemoryRetrievalRequestBatchMemoryRetrievalRequestBatch 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

NameTypeDescriptionNotes
memoryCreationRequestMemoryCreationRequestMemory creation details

Return type

Memory

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

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the memory to delete

Other Parameters

Other parameters are passed through a pointer to a apiDeleteMemoryRequest struct via the builder pattern

NameTypeDescriptionNotes

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

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the memory to retrieve

Other Parameters

Other parameters are passed through a pointer to a apiGetMemoryRequest struct via the builder pattern

NameTypeDescriptionNotes

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

Memory

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

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the memory to download

Other Parameters

Other parameters are passed through a pointer to a apiGetMemoryContentRequest struct via the builder pattern

NameTypeDescriptionNotes

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

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
spaceIdstringThe 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

NameTypeDescriptionNotes

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

MemoryListResponse

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 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 (FormatNDJSON or FormatSSE)

Return type

MemoryStreamChannel - Channel of streaming events

Authorization

ApiKeyAuth