GoodMem
ReferenceAPIgRPC API

Embedder

Embedder service API reference

Services

EmbedderService Service

Service for managing Embedder configurations in the GoodMem system.

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

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

Permissions model:

  • *_OWN: operate on caller-owned embedders
  • *_ANY: operate on any user's embedders (requires elevated role)

CreateEmbedder

Creates a new embedder configuration.

Type
Requestgoodmem.v1.CreateEmbedderRequest
Responsegoodmem.v1.Embedder

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

Permissions Required: CREATE_EMBEDDER_OWN or CREATE_EMBEDDER_ANY

Summary:

  • Owner defaults to the authenticated user unless owner_id is provided (requires *_ANY if differs)
  • ALREADY_EXISTS: another embedder exists with identical {owner_id, provider_type, endpoint_url, api_path, model_identifier, credentials_fingerprint} after URL canonicalization: trailing slash stripped; default ports removed; host comparison case-insensitive; credentials_fingerprint is SHA-256 hash of normalized credentials

Side Effects:

  • Persists embedder; encrypts credentials; sets audit fields

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks CREATE_EMBEDDER_*
  • INVALID_ARGUMENT: bad URL(s); empty/invalid fields; dimensionality <= 0; UNSPECIFIED enums; labels exceed limits/charset; unsupported modality
  • ALREADY_EXISTS: matching embedder as defined above
  • INTERNAL: unexpected server error

Idempotency: Non-idempotent; clients SHOULD NOT blindly retry on unknown failures.

Examples:

grpcurl -plaintext \
-H 'authorization: Bearer gm_xxx' \
-d '{
"display_name": "OpenAI TE",
"provider_type": "PROVIDER_TYPE_OPENAI",
"endpoint_url": "https://api.openai.com",
"api_path": "/embeddings",
"model_identifier": "text-embedding-3-small",
"dimensionality": 1536,
"distribution_type": "DISTRIBUTION_TYPE_DENSE",
"credentials": "sk-***",
"labels": {"env":"dev","team":"ml"}
}' \
localhost:8080 goodmem.v1.EmbedderService/CreateEmbedder

Note: bytes fields in JSON must be base64.

GetEmbedder

Retrieves details of a specific embedder.

Type
Requestgoodmem.v1.GetEmbedderRequest
Responsegoodmem.v1.Embedder

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

Permissions Required: READ_EMBEDDER_OWN or READ_EMBEDDER_ANY

Side Effects: None

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks READ_EMBEDDER_*
  • INVALID_ARGUMENT: invalid embedder ID format
  • NOT_FOUND: embedder does not exist
  • INTERNAL: unexpected server error

Idempotency: Read-only; safe to retry; results may change over time.

Examples:

grpcurl -plaintext \
-H 'authorization: Bearer gm_xxx' \
-d '{ "embedder_id": "BASE64_UUID_BYTES_HERE" }' \
localhost:8080 goodmem.v1.EmbedderService/GetEmbedder

Note: bytes fields in JSON must be base64.

ListEmbedders

Lists embedders accessible to the authenticated user.

Type
Requestgoodmem.v1.ListEmbeddersRequest
Responsegoodmem.v1.ListEmbeddersResponse

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

Permissions Required: LIST_EMBEDDER_OWN or LIST_EMBEDDER_ANY

Request Parameters:

  • owner_id (optional, bytes UUID): filter by owner. If caller has LIST_EMBEDDER_ANY and owner_id is omitted, all embedders visible to the role are returned; otherwise only caller-owned embedders are returned
  • provider_type (optional): UNSPECIFIED ignored
  • label_selectors (optional): AND of exact key=value matches (case-sensitive)

Note: bytes fields in JSON must be base64.

Side Effects: None

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks LIST_EMBEDDER_*
  • INVALID_ARGUMENT: invalid filters or parameters
  • INTERNAL: unexpected server error

Idempotency: Read-only; safe to retry; results may change over time.

Examples:

grpcurl -plaintext \
-H 'authorization: Bearer gm_xxx' \
-d '{ "provider_type":"PROVIDER_TYPE_OPENAI", "label_selectors":{"env":"prod"} }' \
localhost:8080 goodmem.v1.EmbedderService/ListEmbedders

UpdateEmbedder

Updates mutable properties of an embedder.

Type
Requestgoodmem.v1.UpdateEmbedderRequest
Responsegoodmem.v1.Embedder

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

Permissions Required: UPDATE_EMBEDDER_OWN or UPDATE_EMBEDDER_ANY

Side Effects:

  • Persists changes; updates updated_at and updated_by_id

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks UPDATE_EMBEDDER_*
  • INVALID_ARGUMENT: invalid fields or formats
  • NOT_FOUND: embedder does not exist
  • FAILED_PRECONDITION: changes to dimensionality, distribution_type, or model_identifier are rejected while the embedder is referenced by active spaces/collections or ingestion jobs are running; try again after detaching or completing jobs
  • INTERNAL: unexpected server error

Idempotency: Idempotent with identical input; safe to retry.

Examples:

grpcurl -plaintext \
-H 'authorization: Bearer gm_xxx' \
-d '{
"embedder_id": "BASE64_UUID_BYTES_HERE",
"replace_labels": { "items": {} }
}' \
localhost:8080 goodmem.v1.EmbedderService/UpdateEmbedder

Note: bytes fields in JSON must be base64.

DeleteEmbedder

Permanently deletes an embedder configuration.

Type
Requestgoodmem.v1.DeleteEmbedderRequest
Responsegoogle.protobuf.Empty

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

Permissions Required: DELETE_EMBEDDER_OWN or DELETE_EMBEDDER_ANY

Side Effects:

  • Removes the embedder record; securely deletes stored credentials
  • Does not invalidate or delete embeddings previously created with this embedder

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks DELETE_EMBEDDER_*
  • INVALID_ARGUMENT: invalid embedder ID format
  • NOT_FOUND: embedder does not exist
  • INTERNAL: unexpected server error

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

Examples:

grpcurl -plaintext \
-H 'authorization: Bearer gm_xxx' \
-d '{ "embedder_id": "BASE64_UUID_BYTES_HERE" }' \
localhost:8080 goodmem.v1.EmbedderService/DeleteEmbedder

Note: bytes fields in JSON must be base64.

Messages

Embedder

Represents a connection to an embedding API service for vectorization.

Embedders provide semantic vector representations of text, images, or other content by interfacing with external AI services. Each embedder configuration includes connection details, model parameters, and access credentials.

Security:

  • credentials is INPUT_ONLY and is omitted from all responses.

Notes:

  • All timestamps are UTC (google.protobuf.Timestamp).
  • provider_type is IMMUTABLE after creation.

See also: goodmem.v1.ProviderType, goodmem.v1.Modality

FieldTypeDescription
embedder_idbytesOUTPUT_ONLY UUID (16 bytes); immutable primary identifier
display_namestringREQUIRED on create; ≤255 chars; leading/trailing whitespace trimmed; cannot be empty
descriptionstringOPTIONAL
provider_typegoodmem.v1.ProviderTypeREQUIRED on create; IMMUTABLE thereafter. See: goodmem.v1.ProviderType
endpoint_urlstringREQUIRED HTTP(S) URL; server strips trailing slash; duplicate detection uses canonical form
api_pathstringOPTIONAL; if empty on create, defaults to "/v2/embed" (Cohere), "/embed" (TEI), otherwise "/embeddings"
model_identifierstringREQUIRED on create; non-empty after trimming
dimensionalityint32REQUIRED on create; >0
distribution_typegoodmem.v1.DistributionTypeREQUIRED; UNSPECIFIED invalid on writes
max_sequence_lengthint32OPTIONAL; >0 if set; omitted = no enforced limit
supported_modalitiesgoodmem.v1.ModalityOUTPUT semantics: server-stored set; default TEXT if omitted at create. See: goodmem.v1.Modality
credentials...dmem.v1.EndpointAuthenticationINPUT_ONLY; optional when upstream allows anonymous access; never returned in responses
labels...oodmem.v1.Embedder.LabelsEntry≤20 entries; keys/values ≤255 chars; keys [a-z0-9._-], case-sensitive; merge overwrites on exact key match
versionstringOPTIONAL
monitoring_endpointstringOPTIONAL http(s) URL for health/metrics
owner_idbytesOUTPUT_ONLY owner UUID (16 bytes); set at create; not updatable
created_atgoogle.protobuf.TimestampOUTPUT_ONLY creation timestamp (UTC). See: `google.protobuf.Timestamp`
updated_atgoogle.protobuf.TimestampOUTPUT_ONLY last modification timestamp (UTC). See: `google.protobuf.Timestamp`
created_by_idbytesOUTPUT_ONLY creator user UUID (16 bytes); derived from auth context at creation
updated_by_idbytesOUTPUT_ONLY last modifier user UUID (16 bytes); derived from auth context on update

Embedder.LabelsEntry

FieldTypeDescription
keystring
valuestring

CreateEmbedderRequest

FieldTypeDescription
embedder_idbytesOptional client-provided UUID (16 bytes); server generates if omitted; returns ALREADY_EXISTS if ID exists
display_namestringRequired: User-facing name (≤255 chars; leading/trailing whitespace trimmed; cannot be empty)
descriptionstringOptional description of the embedder's purpose
provider_typegoodmem.v1.ProviderTypeRequired: Provider type; `PROVIDER_TYPE_UNSPECIFIED` → `INVALID_ARGUMENT`. See: `goodmem.v1.ProviderType`
endpoint_urlstringRequired: HTTP(S) URL; server strips trailing slash; duplicate detection uses canonical form
api_pathstringOptional API path; if empty, defaults to "/embeddings"
model_identifierstringRequired: Model identifier string (non-empty after trimming)
dimensionalityint32Required: Output vector dimensions (>0)
distribution_typegoodmem.v1.DistributionTypeRequired: Embedding type; DISTRIBUTION_TYPE_UNSPECIFIED → INVALID_ARGUMENT
max_sequence_lengthint32Optional maximum input sequence length in tokens (>0 if set)
supported_modalitiesgoodmem.v1.ModalityOptional supported modalities; empty defaults to TEXT only. See: goodmem.v1.Modality
credentials...dmem.v1.EndpointAuthenticationOptional structured credentials; required only for providers that mandate authentication
labels...ateEmbedderRequest.LabelsEntryOptional labels (≤20 entries; keys/values ≤255 chars; keys [a-z0-9._-], case-sensitive)
versionstringOptional version information for the model/service
monitoring_endpointstringOptional http(s) URL for health/metrics
owner_idbytesOptional owner ID (16 bytes UUID); if omitted → authenticated user; requires CREATE_EMBEDDER_ANY if different from caller

CreateEmbedderRequest.LabelsEntry

FieldTypeDescription
keystring
valuestring

GetEmbedderRequest

FieldTypeDescription
embedder_idbytesRequired: Embedder ID (16 bytes UUID)

ListEmbeddersRequest

FieldTypeDescription
owner_idbytesOptional filters
Optional: Filter by owner (16 bytes UUID)
provider_typegoodmem.v1.ProviderTypeOptional: Filter by provider type; PROVIDER_TYPE_UNSPECIFIED ignored
label_selectors...ersRequest.LabelSelectorsEntryOptional: conjunction (AND) of exact key=value matches

ListEmbeddersRequest.LabelSelectorsEntry

FieldTypeDescription
keystring
valuestring

ListEmbeddersResponse

FieldTypeDescription
embeddersgoodmem.v1.EmbedderList of embedders matching filters and permissions

UpdateEmbedderRequest

FieldTypeDescription
embedder_idbytesRequired: ID of the embedder to update (16 bytes UUID)
display_namestringOptional fields to update (if omitted → unchanged)
Update display name (≤255 chars; cannot be empty)
descriptionstringUpdate description
endpoint_urlstringUpdate endpoint URL (must be valid HTTP/HTTPS URL)
api_pathstringUpdate API path
model_identifierstringUpdate model identifier (cannot be empty)
dimensionalityint32Update dimensionality (must be positive integer)
distribution_typegoodmem.v1.DistributionTypeUpdate distribution type; DISTRIBUTION_TYPE_UNSPECIFIED → INVALID_ARGUMENT
max_sequence_lengthint32Update max sequence length in tokens
supported_modalitiesgoodmem.v1.ModalityUpdates to supported_modalities:
Proto3 cannot distinguish an omitted repeated field from an empty one.
In v1, updates to supported_modalities are NOT supported and the field is ignored.
(If/when presence is added, setting an empty set would clear all modalities.)
See note above. See: goodmem.v1.Modality
credentials...dmem.v1.EndpointAuthenticationUpdate credentials; omit to leave unchanged; replaces stored payload when set
versionstringUpdate version information
monitoring_endpointstringUpdate monitoring endpoint URL
replace_labelsgoodmem.v1.StringMapReplace all existing labels with this set. Empty StringMap clears all labels.
See: goodmem.v1.StringMap
merge_labelsgoodmem.v1.StringMapMerge with existing labels: upserts with overwrite. Labels not mentioned are preserved.
See: goodmem.v1.StringMap

DeleteEmbedderRequest

FieldTypeDescription
embedder_idbytesRequired: ID of the embedder to delete (16 bytes UUID)

Enums

DistributionType

Embedding distribution type for neural vectorization models.

  • DISTRIBUTION_TYPE_UNSPECIFIED = 0: Invalid distribution type; never used in practice
  • DISTRIBUTION_TYPE_DENSE = 1: Dense embeddings (traditional floating-point vectors)
  • DISTRIBUTION_TYPE_SPARSE = 2: Sparse embeddings (high-dimensional sparse vectors)
NameValueDescription
DISTRIBUTION_TYPE_UNSPECIFIED0Invalid distribution type; `INVALID_ARGUMENT` on writes
DISTRIBUTION_TYPE_DENSE1Dense embeddings with floating-point values in all dimensions
DISTRIBUTION_TYPE_SPARSE2Sparse embeddings with values in a subset of dimensions