GoodMemGoodMem
ReferenceAPIgRPC API

Embedder

gRPC EmbedderService reference for CreateEmbedder, GetEmbedder, ListEmbedders, UpdateEmbedder and other RPCs, with request messages, response types, and service documentation.

Services

EmbedderService Service

Service for managing Embedder configurations in the GoodMem system.

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 embedder.
  • 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_EMBEDDER on the instance and returns only embedders on which the caller has READ_EMBEDDER.

CreateEmbedder

Creates a new embedder configuration.

Type
Requestgoodmem.v1.CreateEmbedderRequest
Responsegoodmem.v1.Embedder

Auth: gRPC metadata x-api-key: <api-key>

Authorization Required: CREATE_EMBEDDER on the proposed embedder, evaluated using its proposed owner.

Summary:

  • Owner defaults to the authenticated principal unless owner_id is provided; authorization is evaluated against that proposed owner
  • ALREADY_EXISTS: another embedder for the same owner has the same effective provider connection and model configuration after endpoint canonicalization and provider-default resolution; equivalent credentials participate in this comparison
  • The response omits stored credentials; use GetEmbedder with include_credentials=true for separately authorized disclosure

Side Effects:

  • Persists the embedder and its credentials; sets audit fields

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks CREATE_EMBEDDER on the proposed 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 'x-api-key: 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 x-api-key: <api-key>

Authorization Required: READ_EMBEDDER on the requested embedder. When include_credentials is true, the caller must also hold READ_EMBEDDER_CREDENTIALS; only the current owner or an instance administrator can supply that authority.

Side Effects: None

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks READ_EMBEDDER, or requests credentials without READ_EMBEDDER_CREDENTIALS
  • 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 'x-api-key: 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 principal.

Type
Requestgoodmem.v1.ListEmbeddersRequest
Responsegoodmem.v1.ListEmbeddersResponse

Auth: gRPC metadata x-api-key: <api-key>

Authorization Required: LIST_EMBEDDER on the GoodMem instance and READ_EMBEDDER on each returned embedder. The standard user role may enumerate the catalog and read owned embedders; direct grants can expose additional embedders.

Request Parameters:

  • owner_id (optional, bytes UUID): filter the already-authorized result set by owner
  • provider_type (optional): UNSPECIFIED ignored
  • label_selectors (optional): AND of exact key=value matches (case-sensitive)
  • Stored credentials are always omitted from list responses

Note: bytes fields in JSON must be base64.

Side Effects: None

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks instance-level 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 'x-api-key: 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 x-api-key: <api-key>

Authorization Required: UPDATE_EMBEDDER on the requested embedder.

Credential handling: Omitting credentials preserves the stored value. A present empty payload is invalid and never clears it. The response always omits credentials.

Side Effects:

  • Persists changes; updates updated_at and updated_by_id

Error Codes:

  • UNAUTHENTICATED: missing/invalid auth
  • PERMISSION_DENIED: lacks UPDATE_EMBEDDER on the requested 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
  • ALREADY_EXISTS: the resulting effective provider connection and model configuration would duplicate another embedder for the same owner
  • INTERNAL: unexpected server error

Idempotency: Idempotent with identical input; safe to retry.

Examples:

grpcurl -plaintext \
-H 'x-api-key: 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 x-api-key: <api-key>

Authorization Required: DELETE_EMBEDDER on the requested embedder.

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 on the requested 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 'x-api-key: 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 are returned only by GetEmbedder when explicitly requested and separately authorized. Create, update, and list responses omit them.

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 canonicalizes (trim, lowercase scheme/host, remove default ports, strip trailing '/' from path; preserve query except Gemini, whose endpoint URL must not contain one); used in duplicate detection
api_pathstringOPTIONAL provider-relative path (no scheme/host; preserve trailing '/' and query for non-Gemini providers); for Gemini this is the API version, not an operation suffix; if empty on create, defaults to "/v2/embed" (Cohere), "/v1/embeddings" (Jina), "/embed" (TEI), "/v1beta" (Gemini Developer), "/v1" (Gemini Google Cloud), 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.EndpointAuthenticationOPTIONAL structured credentials for upstream authentication; may be empty when provider allows anonymous access
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
dashscope_api_dialectgoodmem.v1.DashScopeApiDialectOPTIONAL persisted DashScope API dialect; present only for PROVIDER_TYPE_DASHSCOPE. See: goodmem.v1.DashScopeApiDialect
gemini_endpoint_config...oodmem.v1.GeminiEndpointConfigOPTIONAL persisted Gemini backend routing; present only for PROVIDER_TYPE_GEMINI; omission resolves to DEVELOPER for compatibility. See: goodmem.v1.GeminiEndpointConfig
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 actor UUID (16 bytes); derived from auth context at creation
updated_by_idbytesOUTPUT_ONLY last modifier actor 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 canonicalizes (trim, lowercase scheme/host, remove default ports, strip trailing '/' from path; preserve query except Gemini, whose endpoint URL must not contain one)
api_pathstringOptional provider path; for Gemini this is the API version, not an operation suffix; if empty, defaults to "/v2/embed" (Cohere), "/v1/embeddings" (Jina), "/embed" (TEI), "/v1beta" (Gemini Developer), "/v1" (Gemini Google Cloud), otherwise "/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 principal UUID (16 bytes); if omitted → authenticated principal; CREATE_EMBEDDER is evaluated using this proposed owner
dashscope_api_dialectgoodmem.v1.DashScopeApiDialectOptional DashScope API dialect; valid only for PROVIDER_TYPE_DASHSCOPE and inferred from explicit api_path, then the advisory model catalog, when omitted. See: goodmem.v1.DashScopeApiDialect
gemini_endpoint_config...oodmem.v1.GeminiEndpointConfigOptional Gemini backend routing; valid only for PROVIDER_TYPE_GEMINI; omission defaults to DEVELOPER. See: goodmem.v1.GeminiEndpointConfig

CreateEmbedderRequest.LabelsEntry

FieldTypeDescription
keystring
valuestring

GetEmbedderRequest

FieldTypeDescription
embedder_idbytesRequired: Embedder ID (16 bytes UUID)
include_credentialsboolOptional: Include stored credentials; requires READ_EMBEDDER_CREDENTIALS and defaults to false

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, ordered by created_at DESC then embedder_id DESC

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; server canonicalizes (trim, lowercase scheme/host, remove default ports, strip trailing '/' from path; preserve query except Gemini, whose endpoint URL must not contain one)
api_pathstringUpdate provider path; for Gemini this is the API version, not an operation suffix; omit to keep existing except that changing the Gemini backend selects that backend's default; set blank to reset to "/v2/embed" (Cohere), "/v1/embeddings" (Jina), "/embed" (TEI), "/v1beta" (Gemini Developer), "/v1" (Gemini Google Cloud), otherwise "/embeddings"
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. Non-empty
values are rejected; omit or send empty to leave unchanged.
See note above. See: goodmem.v1.Modality
credentials...dmem.v1.EndpointAuthenticationUpdate credentials; omit to leave unchanged; a present empty payload is invalid and never clears stored credentials
versionstringUpdate version information
monitoring_endpointstringUpdate monitoring endpoint URL
dashscope_api_dialectgoodmem.v1.DashScopeApiDialectUpdate DashScope API dialect; valid only for PROVIDER_TYPE_DASHSCOPE; omit to preserve the stored value. A recognized canonical api_path selects its matching dialect; an unrecognized custom path preserves the stored dialect. See: goodmem.v1.DashScopeApiDialect
gemini_endpoint_config...oodmem.v1.GeminiEndpointConfigAtomically replace Gemini backend routing; valid only for PROVIDER_TYPE_GEMINI; omit to preserve the stored value. See: goodmem.v1.GeminiEndpointConfig
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