GoodMem
ReferenceAPIgRPC API

Memory

Memory service API reference

Services

MemoryService Service


CRUD & batch RPC surface

Provides services for creating, retrieving, and managing memories.

Authentication: All methods require API key authentication.

Global errors: All RPCs may return DEADLINE_EXCEEDED, CANCELLED, UNAVAILABLE, RESOURCE_EXHAUSTED, INTERNAL.

Permissions model:

  • *_MEMORY_OWN: Allows operations on memories within spaces owned by the caller.
  • *_MEMORY_ANY: Allows operations on memories in any space (requires elevated role).

CreateMemory

Creates a new Memory in a specified Space.

Type
Requestgoodmem.v1.CreateMemoryRequest
Responsegoodmem.v1.Memory

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: CREATE_MEMORY_OWN or CREATE_MEMORY_ANY

Side Effects:

  • Creates a new Memory record with status PENDING
  • Enqueues a background job to process the memory (chunking and embedding)

Error Codes:

  • UNAUTHENTICATED: Missing or invalid auth token
  • PERMISSION_DENIED: Caller lacks permission to create memories in the specified space
  • INVALID_ARGUMENT: space_id, original_content, or content_type is missing or invalid
  • NOT_FOUND: The specified space_id does not exist

Idempotency: Not idempotent. Clients should not retry on unknown errors.

GetMemory

Retrieves a single Memory by its ID.

Type
Requestgoodmem.v1.GetMemoryRequest
Responsegoodmem.v1.Memory

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: READ_MEMORY_OWN or READ_MEMORY_ANY

Note: For users with only READ_MEMORY_OWN, access is granted if they own the parent space OR if the parent space is public.

Error Codes:

  • UNAUTHENTICATED: Missing or invalid auth token
  • PERMISSION_DENIED: Caller lacks permission to read the memory
  • INVALID_ARGUMENT: memory_id is invalid
  • NOT_FOUND: The specified memory or its parent space does not exist

Idempotency: Read-only; safe to retry.

ListMemories

Lists all Memories within a given Space.

Type
Requestgoodmem.v1.ListMemoriesRequest
Responsegoodmem.v1.ListMemoriesResponse

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: LIST_MEMORY_OWN or LIST_MEMORY_ANY

Note: The current server implementation does not support pagination for this RPC. The max_results and next_token fields will be ignored.

Error Codes:

  • UNAUTHENTICATED: Missing or invalid auth token
  • PERMISSION_DENIED: Caller lacks permission to list memories in the specified space
  • INVALID_ARGUMENT: space_id is invalid
  • NOT_FOUND: The specified space does not exist

Idempotency: Read-only; safe to retry.

DeleteMemory

Permanently deletes a Memory and its associated chunks.

Type
Requestgoodmem.v1.DeleteMemoryRequest
Responsegoogle.protobuf.Empty

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: DELETE_MEMORY_OWN or DELETE_MEMORY_ANY

Error Codes:

  • UNAUTHENTICATED: Missing or invalid auth token
  • PERMISSION_DENIED: Caller lacks permission to delete the memory
  • INVALID_ARGUMENT: memory_id is invalid
  • NOT_FOUND: The specified memory does not exist

Idempotency: Safe to retry; may return NOT_FOUND if already deleted.

BatchCreateMemory

Creates multiple Memories in a single request.

This is a partial-success operation. The response will contain a result for each requested creation, indicating either success (with the new Memory) or an error status.

Type
Requestgoodmem.v1.BatchCreateMemoryRequest
Responsegoodmem.v1.BatchCreateMemoryResponse

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: CREATE_MEMORY_OWN or CREATE_MEMORY_ANY

Idempotency: Not idempotent - each call may create new memories.

BatchGetMemory

Retrieves multiple Memories by their IDs in a single request.

This is a partial-success operation. The response will contain a result for each requested memory.

Type
Requestgoodmem.v1.BatchGetMemoryRequest
Responsegoodmem.v1.BatchGetMemoryResponse

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: READ_MEMORY_OWN or READ_MEMORY_ANY

Idempotency: Read-only; safe to retry.

BatchDeleteMemory

Deletes multiple Memories by their IDs in a single request.

This is a partial-success operation. The response will indicate the outcome for each requested deletion.

Type
Requestgoodmem.v1.BatchDeleteMemoryRequest
Responsegoodmem.v1.BatchDeleteMemoryResponse

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: DELETE_MEMORY_OWN or DELETE_MEMORY_ANY

Idempotency: Safe to retry; may return NOT_FOUND for already deleted memories.

RetrieveMemory

Performs a semantic search over one or more Spaces and streams back results.

This is a server-streaming RPC that provides a rich, event-based view of the retrieval process, including ranked chunks, full memory definitions, and optional LLM-generated summaries.

Type
Requestgoodmem.v1.RetrieveMemoryRequest
Responsestream goodmem.v1.RetrieveMemoryEvent

Auth: gRPC metadata authorization: Bearer <api-key>

Permissions Required: READ_MEMORY_OWN or READ_MEMORY_ANY

Error Codes:

  • Fails fast with INVALID_ARGUMENT, NOT_FOUND, or PERMISSION_DENIED if any initial validation of the request parameters (e.g., space IDs) fails
  • During the stream, non-fatal warnings are sent via GoodMemStatus events

Idempotency: Read-only; safe to retry.

Messages

Memory


Memory & MemoryChunk

A logical “memory” – a unit of content with associated metadata.

This is the primary object clients interact with. It represents the original, unprocessed content. The server processes this content asynchronously to create one or more MemoryChunks with vector embeddings.

FieldTypeDescription
memory_idbytesOUTPUT_ONLY; UUID (16 bytes) of the memory.
space_idbytesOUTPUT_ONLY; UUID of the parent space.
original_contentbytesWRITE_ONLY; The raw payload of the memory. Not returned in read RPCs unless explicitly requested.
original_content_refstringOptional URI pointing to the external source of the content.
original_content_lengthint64OUTPUT_ONLY; Size in bytes of original_content when stored inline.
original_content_sha256bytesOUTPUT_ONLY; SHA-256 digest of original_content (binary form).
content_typestringREQUIRED; MIME type of the content (e.g., "text/plain", "application/pdf").
metadatagoogle.protobuf.StructOptional, arbitrary JSON-like metadata associated with the memory.
chunking_configgoodmem.v1.ChunkingConfigOptional chunking strategy that overrides the space's default.
processing_statusgoodmem.v1.ProcessingStatusOUTPUT_ONLY; The current status of the asynchronous processing pipeline.
processing_historygoodmem.v1.ProcessingHistoryOUTPUT_ONLY; Populated when requested via Get/List flags.
created_atgoogle.protobuf.Timestamp--- Audit ---------------------------------------------------------------
OUTPUT_ONLY; Timestamp of creation.
updated_atgoogle.protobuf.TimestampOUTPUT_ONLY; Timestamp of last update.
created_by_idbytesOUTPUT_ONLY; UUID of the user who created the memory.
updated_by_idbytesOUTPUT_ONLY; UUID of the user who last updated the memory.

MemoryChunk

A single chunk derived from a Memory, paired with its vector embedding. Mostly internal, but exposed for advanced diagnostics.

FieldTypeDescription
chunk_idbytesOUTPUT_ONLY; UUID of the chunk.
memory_idbytesOUTPUT_ONLY; UUID of the parent memory.
chunk_sequence_numberint32OUTPUT_ONLY; The 0-based position of this chunk within the parent memory.
chunk_textstringThe text content of the chunk.
embedding_vectorfloatFor internal use; not reliably populated in retrieval responses.
vector_statusgoodmem.v1.ProcessingStatusOUTPUT_ONLY; The generation status of the embedding vector.
start_offsetint32OUTPUT_ONLY; Byte offset in UTF-8 of the chunk start in original content.
end_offsetint32OUTPUT_ONLY; Byte offset in UTF-8 of the chunk end (exclusive).
created_atgoogle.protobuf.Timestamp--- Audit ---------------------------------------------------------------
OUTPUT_ONLY; Timestamp of creation.
updated_atgoogle.protobuf.TimestampOUTPUT_ONLY; Timestamp of last update.
created_by_idbytesOUTPUT_ONLY; UUID of the user who created the chunk.
updated_by_idbytesOUTPUT_ONLY; UUID of the user who last updated the chunk.

MemoryOrStatus


Helper union for batch RPCs

A union type for batch operations that can return either a Memory or an error Status.

FieldTypeDescription
memorygoodmem.v1.MemoryA successfully retrieved or created Memory.
statusgoogle.rpc.StatusAn error status for a failed operation on a single item.

RetrieveMemoryRequest


RetrieveMemory – request & streaming response

Defines the parameters for a semantic search query.

FieldTypeDescription
messagestring--- Core query parameters ----------------------------------------------
REQUIRED; The user's natural language query or prompt.
context...rieveMemoryRequest.ContextItemOptional; Extra context to provide alongside the query.
space_ids...RetrieveMemoryRequest.SpaceKeyREQUIRED; The list of spaces to search within.
requested_sizeint32The maximum number of results requested.
output_budget...rieveMemoryRequest.TokenBudget--- Soft resource caps --------------------------------------------------
Optional; A hint for the maximum number of tokens in the final reply.
compute_budget...rieveMemoryRequest.TokenBudgetOptional; A hint for the overall computational effort.
fetch_memorybool--- Response shaping flags ---------------------------------------------
If omitted, defaults to true. If explicitly set to false, `memory_definition` events will not be streamed.
fetch_memory_contentboolIf true, includes the raw content in streamed `memory_definition` events. Requires `fetch_memory` to be true.
post_processor...eveMemoryRequest.PostProcessorOptional; A post-processor to apply to the results (e.g., for summarization).

RetrieveMemoryRequest.TokenBudget

A hint to the server about the desired token budget for a response.

FieldTypeDescription
tokensuint32The desired number of tokens.

RetrieveMemoryRequest.BinaryContent

Represents a piece of binary content provided as context.

FieldTypeDescription
content_typestringThe MIME type of the content.
databytesThe raw binary data.

RetrieveMemoryRequest.ContextItem

A single item of context provided to augment the user's query.

FieldTypeDescription
textstringTextual context.
binary...eveMemoryRequest.BinaryContentBinary context (e.g., an image).

RetrieveMemoryRequest.PostProcessor

Defines a post-processor to be run on the retrieval results.

FieldTypeDescription
namestringThe fully-qualified class name of the post-processor to run.
configgoogle.protobuf.StructOptional JSON-like configuration for the post-processor.

RetrieveMemoryRequest.EmbedderWeight

Specifies a custom weight for an embedder during a query.

FieldTypeDescription
embedder_idbytesThe UUID of the embedder to apply the weight to.
weightfloatThe relevance weight for this embedder.

RetrieveMemoryRequest.SpaceKey

Specifies a space to search in, with optional per-embedder weighting.

FieldTypeDescription
space_idbytesREQUIRED; The UUID of the space to search.
embedder_weights...veMemoryRequest.EmbedderWeightOptional; Overrides default weights for embedders in this space.
filterstringOptional; Only memories that satisfy this filter expression are included in the results.

RetrieveMemoryEvent

A single event in the streaming response of a RetrieveMemory RPC.

The stream is a sequence of these events. The client is responsible for assembling the final results based on the event types. Events for different result sets may interleave, but within a given result set, the server emits BEGIN → items → END in order.

FieldTypeDescription
result_set_boundary...eMemoryEvent.ResultSetBoundaryMarks the beginning or end of a logical set of results.
retrieved_item...rieveMemoryEvent.RetrievedItemA single retrieved item, part of a result set.
abstract_reply...rieveMemoryEvent.AbstractReplyAn LLM-generated summary or answer.
memory_definitiongoodmem.v1.MemoryA full memory definition, provided for client-side caching.
statusgoodmem.v1.GoodMemStatusA non-fatal warning or status update.

RetrieveMemoryEvent.ResultSetBoundary

Marks the BEGIN or END of a logical result set (e.g., from vector search or reranking).

Every RetrievedItem between a BEGIN and END boundary will share the same result_set_id.

FieldTypeDescription
result_set_idbytesA unique UUID for this result set.
kind...ryEvent.ResultSetBoundary.KindWhether this marks the beginning or end of the set.
stage_namestringA human-readable name for the pipeline stage (e.g., "vector-search", "rerank").
expected_itemsuint32A hint for the total number of items in this set. A value of 0 means the total is not specified.

RetrieveMemoryEvent.AbstractReply

An LLM-generated textual summary or answer based on the retrieved items.

FieldTypeDescription
textstringThe generated text.
relevance_scoredoubleThe relevance score of the abstract itself.
result_set_idbytesOptional; The result set this abstract was generated from.

RetrieveMemoryEvent.RetrievedItem

A single item retrieved from a search, belonging to a specific result set.

FieldTypeDescription
memorygoodmem.v1.MemoryThe server does not use this field in the current implementation.
Full memory definitions are sent via the `memory_definition` event.
chunk...t.RetrievedItem.ChunkReferenceA reference to a specific chunk within a memory.

RetrieveMemoryEvent.RetrievedItem.ChunkReference

A reference to a specific chunk, its relevance score, and a pointer to its parent memory definition within the stream.

FieldTypeDescription
result_set_idbytesThe ID of the result set this chunk belongs to.
chunkgoodmem.v1.MemoryChunkThe chunk data itself.
memory_indexint32The index of this chunk's parent memory in the client-side cache of `Memory` definitions.
relevance_scoredoubleThe relevance score of this chunk to the query.

CreateMemoryRequest


Create / Batch-create

FieldTypeDescription
memory_idbytesOptional: client-provided UUID (16 bytes); server generates if omitted; returns ALREADY_EXISTS if ID exists
space_idbytesREQUIRED: The UUID of the space to create the memory in.
original_contentbytesREQUIRED: The raw content of the memory.
original_content_refstringOptional: A URI pointing to the external source of the content.
content_typestringREQUIRED: The MIME type of the content.
metadatagoogle.protobuf.StructOptional: Arbitrary JSON-like metadata.
chunking_configgoodmem.v1.ChunkingConfigOptional; Overrides the default chunking config of the space.

BatchCreateMemoryRequest

FieldTypeDescription
requestsgoodmem.v1.CreateMemoryRequest

BatchCreateMemoryResponse

FieldTypeDescription
resultsgoodmem.v1.MemoryOrStatus

GetMemoryRequest


Get / Batch-get

FieldTypeDescription
memory_idbytesREQUIRED; The UUID of the memory to retrieve.
include_contentboolIf true, the `original_content` field of the memory will be populated.
include_processing_historyboolIf true, populates the `processing_history` field.

BatchGetMemoryRequest

FieldTypeDescription
memory_idsbytesThe list of memory UUIDs to retrieve.
include_contentboolIf true, populates the `original_content` field for all retrieved memories.
include_processing_historyboolIf true, populates the `processing_history` field for all memories.

BatchGetMemoryResponse

FieldTypeDescription
resultsgoodmem.v1.MemoryOrStatus

ListMemoriesRequest


List with pagination

FieldTypeDescription
space_idbytesREQUIRED; The UUID of the space to list memories from.
status_filtergoodmem.v1.ProcessingStatusOptional; Filters memories by their processing status.
max_resultsint32Optional; The server does not currently support pagination and may ignore this.
next_tokenstringOptional; An opaque token for fetching the next page. Not yet supported.
sort_bystringOptional; Field to sort by (e.g., "created_at"). Behavior for unsupported fields is not defined.
sort_ordergoodmem.v1.SortOrderOptional; The direction to sort (ASCENDING or DESCENDING).
include_contentboolOptional; If true, populates the `original_content` field.
include_processing_historyboolIf true, populates the `processing_history` field for each memory.

ListMemoriesResponse

FieldTypeDescription
memoriesgoodmem.v1.MemoryA page of memory results.
next_tokenstringAn opaque token for fetching the next page. Not yet supported.

ListMemoriesNextPageToken

Internal cursor for ListMemories pagination. Not for client use.

FieldTypeDescription
startint32The starting offset for the next page.
space_idbytesThe space_id from the original request.
status_filtergoodmem.v1.ProcessingStatusThe status_filter from the original request.
sort_bystringThe sort_by field from the original request.
sort_ordergoodmem.v1.SortOrderThe sort_order from the original request.
requestor_idbytesThe UUID of the authenticated user for token validation.
include_contentboolThe include_content flag from the original request.
include_processing_historyboolThe include_processing_history flag from the original request.

DeleteMemoryRequest


Delete / Batch-delete

FieldTypeDescription
memory_idbytesREQUIRED; The UUID of the memory to delete.

BatchDeleteMemoryRequest

FieldTypeDescription
memory_idsbytesA list of memory UUIDs to delete.

DeleteResult

The result of a single deletion in a batch operation.

FieldTypeDescription
memory_idbytesThe UUID of the memory that was targeted for deletion.
successboolWhether the deletion was successful.
errorgoogle.rpc.StatusIf deletion failed, this contains the error details.

BatchDeleteMemoryResponse

FieldTypeDescription
resultsgoodmem.v1.DeleteResult

Enums

RetrieveMemoryEvent.ResultSetBoundary.Kind

NameValueDescription
BEGIN0
END1

ProcessingStatus


Common enums

Pipeline status for any process that can be queued, run and finish/fail.

NameValueDescription
PROCESSING_STATUS_UNSPECIFIED0The default value. Invalid on writes.
PENDING1The job is queued and waiting to be processed.
PROCESSING2The job is actively being processed.
COMPLETED3The job finished successfully.
FAILED4The job ended with an error.