Space
gRPC SpaceService reference for CreateSpace, GetSpace, ListSpaces, UpdateSpace and other RPCs, with request messages, response types, and service documentation.
Services
SpaceService Service
Service for managing Spaces in the GoodMem system.
Spaces are the fundamental storage units for organizing memories with associated embedding models and access controls. This service provides lifecycle management including creation, retrieval, listing, updating, and deletion of spaces.
Authentication: gRPC metadata x-api-key: <api-key>
Global errors: All RPCs may return DEADLINE_EXCEEDED, CANCELLED, UNAVAILABLE, RESOURCE_EXHAUSTED, INTERNAL.
Authorization model:
- Every RPC evaluates a typed authorization operation against the GoodMem instance or a particular space.
- Ownership, code-defined role assignments, and direct grants can supply authority; an API-key ceiling may further restrict the authenticated principal's effective authority.
- Listing requires
LIST_SPACEon the instance and returns only spaces on which the caller hasREAD_SPACE.
Security considerations:
- Space names must be unique per owner to prevent conflicts
- Shared authenticated access is represented by authorization grants
- Embedder associations are validated during creation to ensure at least one embedder is supplied, every referenced embedder exists, and the caller may execute every embedder
CreateSpace
Creates a new Space with embedder associations and configuration.
| Type | |
|---|---|
| Request | goodmem.v1.CreateSpaceRequest |
| Response | goodmem.v1.Space |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: CREATE_SPACE on the proposed space, evaluated using its proposed
owner, and EXECUTE_EMBEDDER on every referenced embedder.
Summary:
- Owner defaults to the authenticated principal unless
owner_idis provided; authorization is evaluated against that proposed owner - At least one
space_embeddermust be specified ALREADY_EXISTS: another space exists with identical{owner_id, name}(case-sensitive)- Validates all embedder IDs exist and the caller has
EXECUTE_EMBEDDERon each one - Duplicate embedder IDs in the same request →
INVALID_ARGUMENT
Side Effects:
- Persists space with embedder associations; sets audit fields
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacksCREATE_SPACEfor the proposed owner orEXECUTE_EMBEDDERon a referenced embedderINVALID_ARGUMENT: empty/invalidname; duplicate embedders; unknownembedder_id; label key/len violationsALREADY_EXISTS: matching spacenamefor ownerINTERNAL: unexpected server error
Examples:
grpcurl -plaintext \\
-H 'x-api-key: gm_xxx' \\
-d '{
"name": "My Knowledge Base",
"space_embedders": [
{
"embedder_id": "BASE64_UUID_BYTES_HERE",
"default_retrieval_weight": 1.0
}
],
"labels": {"org": "acme", "env": "prod"}
}' \\
localhost:8080 goodmem.v1.SpaceService/CreateSpaceNote: bytes fields in JSON must be base64.
Idempotency: Non-idempotent; clients SHOULD NOT blindly retry on unknown failures.
GetSpace
Retrieves details of a specific Space including embedder associations.
| Type | |
|---|---|
| Request | goodmem.v1.GetSpaceRequest |
| Response | goodmem.v1.Space |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: READ_SPACE on the requested space.
Summary:
- Loads the space before evaluating authorization, preserving the distinct
NOT_FOUNDandPERMISSION_DENIEDcontract - Returns complete space details including all embedder associations
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacksREAD_SPACEon the requested spaceINVALID_ARGUMENT: invalid space ID formatNOT_FOUND: space does not existINTERNAL: unexpected server error
Idempotency: Read-only; safe to retry; results may change over time.
Examples:
grpcurl -plaintext \
-H 'x-api-key: gm_xxx' \
-d '{ "space_id": "BASE64_UUID_BYTES_HERE" }' \
localhost:8080 goodmem.v1.SpaceService/GetSpaceNote: bytes fields in JSON must be base64.
ListSpaces
Lists Spaces accessible to the authenticated principal with filtering and pagination.
| Type | |
|---|---|
| Request | goodmem.v1.ListSpacesRequest |
| Response | goodmem.v1.ListSpacesResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: LIST_SPACE on the GoodMem instance and READ_SPACE on each
returned space. The standard user role may enumerate the catalog and read owned spaces;
direct grants can expose additional spaces.
Request Parameters:
owner_id(optional, bytes UUID): filter the already-authorized result set by ownerlabel_selectors(optional): AND of exact key=value matches (case-sensitive)name_filter(optional): glob over full name;*any sequence;?single char;\escapes; case-sensitive- Pagination:
next_tokenis an opaque string; do not parse.max_resultsdefaults to 50; clamped to [1, 1000] - Sorting:
sort_byin{"created_at","name"};sort_order{"ASCENDING","DESCENDING"}. Default:created_at DESC. Unsupportedsort_by→INVALID_ARGUMENT
Note: bytes fields in JSON must be base64.
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacks instance-levelLIST_SPACEINVALID_ARGUMENT: invalid filters, pagination token, or parametersINTERNAL: unexpected server error
Idempotency: Read-only; safe to retry; results may change over time.
Examples:
grpcurl -plaintext \
-H 'x-api-key: gm_xxx' \
-d '{ "label_selectors": {"env": "prod"}, "name_filter": "kb*", "max_results": 25 }' \
localhost:8080 goodmem.v1.SpaceService/ListSpacesUpdateSpace
Updates mutable properties of a Space (name, labels).
| Type | |
|---|---|
| Request | goodmem.v1.UpdateSpaceRequest |
| Response | goodmem.v1.Space |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: UPDATE_SPACE on the requested space.
Summary:
- Only mutable fields can be updated:
name,labels space_embeddersanddefault_chunking_configare immutable- Label updates support replace (clear all, set new) or merge (upsert) strategies
- Name uniqueness is enforced per owner during updates
Side Effects:
- Persists changes; updates
updated_atandupdated_by_id
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacksUPDATE_SPACEon the requested spaceINVALID_ARGUMENT: invalid fields, emptyname, both label strategies set, or no updatable fields providedNOT_FOUND: space does not existALREADY_EXISTS:nameconflicts with existing space for ownerINTERNAL: unexpected server error
Idempotency: Idempotent with identical input; safe to retry.
Examples:
grpcurl -plaintext \
-H 'x-api-key: gm_xxx' \
-d '{
"space_id": "BASE64_UUID_BYTES_HERE",
"name": "Updated Knowledge Base",
"merge_labels": { "items": {"status": "active"} }
}' \
localhost:8080 goodmem.v1.SpaceService/UpdateSpaceNote: bytes fields in JSON must be base64.
TransferSpaceOwnership
Transfers ownership of a Space to another active principal.
| Type | |
|---|---|
| Request | goodmem.v1.TransferSpaceOwnershipRequest |
| Response | goodmem.v1.TransferSpaceOwnershipResponse |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: TRANSFER_RESOURCE_OWNERSHIP on the requested space, derived from
current space ownership, current instance ownership, or an instance-level ADMIN role. A
space-level SPACE_ADMIN role and MANAGE_ACCESS alone are insufficient. A scoped API key
must also carry a matching immutable ceiling.
Summary:
- Loads the requested space before evaluating authorization, preserving GoodMem's distinct
NOT_FOUNDandPERMISSION_DENIEDcontract - Resolves
new_owner_idonly after the caller passes authorization - Accepts an active human or service principal as the new owner
- Rejects transfer to the current owner without changing audit history
Side Effects:
- Changes only the space owner and update-audit fields
- Preserves all grants and role assignments
- Immediately changes the derived ownership domain of every memory contained by the space
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: caller lacks derivedTRANSFER_RESOURCE_OWNERSHIPauthority or a scoped API key lacks the required ceilingINVALID_ARGUMENT: invalidspace_idornew_owner_idformatNOT_FOUND: space or destination principal does not existFAILED_PRECONDITION: destination principal is deleted or already owns the spaceALREADY_EXISTS: destination principal already owns a space with the same nameABORTED: a concurrent ownership or policy change invalidated the transaction; the caller may retry after reading the current ownerINTERNAL: unexpected server error
Idempotency: Not idempotent under response semantics: retrying a completed transfer returns
FAILED_PRECONDITION. After an unknown outcome, read the current space before retrying.
DeleteSpace
Permanently deletes a Space and its associated content.
| Type | |
|---|---|
| Request | goodmem.v1.DeleteSpaceRequest |
| Response | google.protobuf.Empty |
Auth: gRPC metadata x-api-key: <api-key>
Authorization Required: DELETE_SPACE on the requested space.
Side Effects:
- Removes the space record permanently
- Cascades deletion to associated memories, chunks, and embedder associations
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacksDELETE_SPACEon the requested spaceINVALID_ARGUMENT: invalid space ID formatNOT_FOUND: space does not existINTERNAL: unexpected server error
Idempotency: Safe to retry; may return NOT_FOUND if already deleted or never existed.
Examples:
grpcurl -plaintext \
-H 'x-api-key: gm_xxx' \
-d '{ "space_id": "BASE64_UUID_BYTES_HERE" }' \
localhost:8080 goodmem.v1.SpaceService/DeleteSpaceNote: bytes fields in JSON must be base64.
Messages
SpaceEmbedder
Represents the association between a Space and an Embedder with retrieval configuration.
SpaceEmbedders define which embedding models are available for a space and their relative weights during retrieval operations. Each space must have at least one embedder association.
Immutability:
- All fields are immutable after creation (no update operations supported).
- Created as part of space creation process.
Notes:
- All timestamps are UTC (
google.protobuf.Timestamp). - Weights are used for blending multiple embedder results during retrieval.
| Field | Type | Description |
|---|---|---|
space_id | bytes | OUTPUT_ONLY UUID (16 bytes); space this embedder is associated with |
embedder_id | bytes | OUTPUT_ONLY UUID (16 bytes); embedder model identifier |
default_retrieval_weight | double | OUTPUT_ONLY; > 0 and finite; used for blending across embedders; server may normalize across all embedders. |
created_at | google.protobuf.Timestamp | Standard audit fields OUTPUT_ONLY |
updated_at | google.protobuf.Timestamp | OUTPUT_ONLY |
created_by_id | bytes | OUTPUT_ONLY creator UUID (16 bytes) |
updated_by_id | bytes | OUTPUT_ONLY last updater UUID (16 bytes) |
Space
Represents a Space - the fundamental storage unit in GoodMem for organizing memories.
A Space is a logical container for memories with associated embedding models, access controls, and metadata. Each space has a unique name per owner and defines the embedding and chunking strategies for its contained memories.
Security:
- Shared authenticated access is represented by authorization grants.
- Space ownership and creator are tracked separately for administrative purposes.
Immutability:
space_embeddersare effectively immutable (no update operations supported)owner_idchanges only throughTransferSpaceOwnership, never throughUpdateSpacedefault_chunking_configupdates are not yet supported
Uniqueness:
- Space names must be unique per owner (case-sensitive).
- System prevents duplicate spaces with identical
{owner_id, name}combination.
Notes:
- All timestamps are UTC (
google.protobuf.Timestamp) - Each space must have at least one associated embedder for memory processing
See also: SpaceService for management operations, SpaceEmbedder for embedder associations
| Field | Type | Description |
|---|---|---|
space_id | bytes | OUTPUT_ONLY UUID (16 bytes); immutable primary identifier |
name | string | REQUIRED on create; human-friendly name; unique per owner; cannot be empty after trimming |
labels | goodmem.v1.Space.LabelsEntry | OPTIONAL key-value pairs for organization and filtering. Keys must match [a-z0-9._-], case-sensitive. ≤20 entries; keys/values ≤255 chars. |
space_embedders | goodmem.v1.SpaceEmbedder | OUTPUT_ONLY list of embedder associations; at least one required. Weights are positive and server-normalized at retrieval time; they need not sum to 1. |
owner_id | bytes | OUTPUT_ONLY owner principal UUID (16 bytes); changed only by TransferSpaceOwnership |
default_chunking_config | goodmem.v1.ChunkingConfig | OPTIONAL default chunking strategy for memories; updates not yet supported |
created_at | google.protobuf.Timestamp | Standard audit fields OUTPUT_ONLY |
updated_at | google.protobuf.Timestamp | OUTPUT_ONLY |
created_by_id | bytes | OUTPUT_ONLY creator UUID (16 bytes) |
updated_by_id | bytes | OUTPUT_ONLY last updater UUID (16 bytes) |
Space.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
CreateSpaceRequest
| Field | Type | Description |
|---|---|---|
space_id | bytes | Optional: client-provided UUID (16 bytes); server generates if omitted; returns ALREADY_EXISTS if ID exists |
name | string | Required: Space name (cannot be empty after trimming); unique per owner; ≤255 chars |
labels | ...CreateSpaceRequest.LabelsEntry | Optional: Labels for organization (≤20 entries; keys/values ≤255 chars; includes reserved keys) |
space_embedders | goodmem.v1.SpaceEmbedderConfig | REQUIRED: At least one embedder configuration; no duplicates allowed |
owner_id | bytes | Optional: Owner principal UUID (16 bytes); if omitted → authenticated principal; CREATE_SPACE is evaluated using this proposed owner |
default_chunking_config | goodmem.v1.ChunkingConfig | Optional: Default chunking strategy for memories in this space |
CreateSpaceRequest.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
SpaceEmbedderConfig
Configuration for creating a space-embedder association during space creation.
Used to specify which embedders should be associated with the space and their retrieval weights. All specified embedders must exist before space creation.
| Field | Type | Description |
|---|---|---|
embedder_id | bytes | Required: Embedder UUID (16 bytes); must reference existing embedder. |
default_retrieval_weight | double | Optional: > 0 and finite; defaults to 1.0; need not sum to 1 across configs. |
GetSpaceRequest
| Field | Type | Description |
|---|---|---|
space_id | bytes | Required: Space ID (16 bytes UUID) |
ListSpacesRequest
| Field | Type | Description |
|---|---|---|
owner_id | bytes | Optional filters Optional: Filter by owner (16 bytes UUID) |
label_selectors | ...cesRequest.LabelSelectorsEntry | Optional: Conjunction (AND) of exact key=value matches; all pairs must be present in space labels |
name_filter | string | Optional: Glob pattern for space name matching; supports * (any chars), ? (single char), \ (escape); full-string match; case-sensitive |
max_results | int32 | Pagination Optional: Max results per page; defaults to 50; clamped to 1-1000 range |
next_token | string | Optional: Opaque pagination token; do not parse. |
sort_by | string | Sorting Optional: "created_at" or "name"; default "created_at". |
sort_order | goodmem.v1.SortOrder | Optional: default DESCENDING. |
ListSpacesRequest.LabelSelectorsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
ListSpacesResponse
| Field | Type | Description |
|---|---|---|
spaces | goodmem.v1.Space | Page of space results with complete metadata and embedder associations |
next_token | string | Opaque pagination token for next page; omitted on final page. |
ListSpacesNextPageToken
INTERNAL: Pagination token structure for ListSpaces.
Clients MUST treat next_token as opaque and MUST NOT construct or parse it.
The current implementation encodes this structure as base64, but this may change without notice.
| Field | Type | Description |
|---|---|---|
start | int32 | Cursor offset position in result set |
owner_id | bytes | Owner filter from original request (16 bytes UUID) |
label_selectors | ...tPageToken.LabelSelectorsEntry | Label selector filters from original request |
name_filter | string | Name filter pattern from original request |
requestor_id | bytes | Authenticated principal ID for token validation (16-byte UUID) |
sort_by | string | Sort field from original request |
sort_order | goodmem.v1.SortOrder | Sort direction from original request |
ListSpacesNextPageToken.LabelSelectorsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
UpdateSpaceRequest
| Field | Type | Description |
|---|---|---|
space_id | bytes | Required: ID of the space to update (16 bytes UUID) |
name | string | Optional fields to update Optional: New space name (cannot be empty after trimming); must be unique per owner |
replace_labels | goodmem.v1.StringMap | Replace all existing labels with this set (≤20 entries). Empty StringMap clears all labels. See: goodmem.v1.StringMap |
merge_labels | goodmem.v1.StringMap | Merge with existing labels (≤20 entries): upserts with overwrite. Labels not mentioned are preserved. See: goodmem.v1.StringMap |
DeleteSpaceRequest
| Field | Type | Description |
|---|---|---|
space_id | bytes | Required: Space ID to delete (16 bytes UUID) |
TransferSpaceOwnershipRequest
Request to transfer a Space to another principal.
| Field | Type | Description |
|---|---|---|
space_id | bytes | Existing Space UUID (16 bytes). |
new_owner_id | bytes | Existing, active human or service principal UUID (16 bytes) that will become owner. |
TransferSpaceOwnershipResponse
Response returned after transferring ownership of a Space.
| Field | Type | Description |
|---|---|---|
space | goodmem.v1.Space | Updated Space, including its immutable embedder associations. |
Service Identity
gRPC ServiceIdentityService reference for CreateServiceIdentity, GetServiceIdentity, ListServiceIdentities, UpdateServiceIdentity and other RPCs, with request messages, response types, and service documentation.
System
gRPC SystemService reference for GetServerInfo, with request messages, response types, and service documentation.