Embedder
gRPC EmbedderService reference for CreateEmbedder, GetEmbedder, ListEmbedders, UpdateEmbedder and other RPCs, with request messages, response types, and service documentation.
Services
EmbedderService
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_EMBEDDERon the instance and returns only embedders on which the caller hasREAD_EMBEDDER.
CreateEmbedder
Creates a new embedder configuration.
| Type | |
|---|---|
| Request | goodmem.v1.CreateEmbedderRequest |
| Response | goodmem.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_idis provided; authorization is evaluated against that proposed owner - Embedders with identical configuration are allowed.
ALREADY_EXISTSis returned only when a client-suppliedembedder_idis already in use - The response omits stored credentials; use
GetEmbedderwithinclude_credentials=truefor separately authorized disclosure input_formatis validated before the embedder is stored. ForPROVIDER_TYPE_GEMINI, a request that omitsinput_formatstores the documented Gemini Embedding 2 templates (task: search result | query: {{ content }}andtitle: {{ memory.metadata.title | default('none') }} | text: {{ content }}); a request that suppliesinput_format, even an empty one, stores exactly what it supplies
Side Effects:
- Persists the embedder and its credentials; sets audit fields
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacksCREATE_EMBEDDERon the proposed embedderINVALID_ARGUMENT: bad URL(s); empty/invalid fields;dimensionality <= 0;UNSPECIFIEDenums; labels exceed limits/charset; unsupported modality;input_formatbreaks a rule ofgoodmem.v1.ModelInputFormat, is nonempty for a provider that does not accept it, or carries an instruction thatquery_templatedoes not readALREADY_EXISTS: the client-suppliedembedder_idis already in useINTERNAL: 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/CreateEmbedderNote: bytes fields in JSON must be base64.
GetEmbedder
Retrieves details of a specific embedder.
| Type | |
|---|---|
| Request | goodmem.v1.GetEmbedderRequest |
| Response | goodmem.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 authPERMISSION_DENIED: lacksREAD_EMBEDDER, or requests credentials withoutREAD_EMBEDDER_CREDENTIALSINVALID_ARGUMENT: invalid embedder ID formatNOT_FOUND: embedder 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 '{ "embedder_id": "BASE64_UUID_BYTES_HERE" }' \
localhost:8080 goodmem.v1.EmbedderService/GetEmbedderNote: bytes fields in JSON must be base64.
ListEmbedders
Lists embedders accessible to the authenticated principal.
| Type | |
|---|---|
| Request | goodmem.v1.ListEmbeddersRequest |
| Response | goodmem.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 ownerprovider_type(optional):UNSPECIFIEDignoredlabel_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 authPERMISSION_DENIED: lacks instance-levelLIST_EMBEDDERINVALID_ARGUMENT: invalid filters 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 '{ "provider_type":"PROVIDER_TYPE_OPENAI", "label_selectors":{"env":"prod"} }' \
localhost:8080 goodmem.v1.EmbedderService/ListEmbeddersUpdateEmbedder
Updates mutable properties of an embedder.
| Type | |
|---|---|
| Request | goodmem.v1.UpdateEmbedderRequest |
| Response | goodmem.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.
Input format: Omitting input_format preserves the stored value. A present
input_format replaces the whole stored value; a present empty message clears it. A present
input_format is an update by itself.
Side Effects:
- Persists changes; updates
updated_atandupdated_by_id
Error Codes:
UNAUTHENTICATED: missing/invalid authPERMISSION_DENIED: lacksUPDATE_EMBEDDERon the requested embedderINVALID_ARGUMENT: invalid fields or formats;input_formatbreaks a rule ofgoodmem.v1.ModelInputFormat, is nonempty for a provider that does not accept it, or carries an instruction thatquery_templatedoes not readNOT_FOUND: embedder does not existFAILED_PRECONDITION: changes todimensionality,distribution_type,model_identifier, or thedocument_templateofinput_format(including clearing it) are rejected while a space references the embedderABORTED: database transaction conflict (deadlock or serialization failure); retry the updateINTERNAL: 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/UpdateEmbedderNote: bytes fields in JSON must be base64.
DeleteEmbedder
Permanently deletes an embedder configuration.
| Type | |
|---|---|
| Request | goodmem.v1.DeleteEmbedderRequest |
| Response | google.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 authPERMISSION_DENIED: lacksDELETE_EMBEDDERon the requested embedderINVALID_ARGUMENT: invalid embedder ID formatNOT_FOUND: embedder 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 '{ "embedder_id": "BASE64_UUID_BYTES_HERE" }' \
localhost:8080 goodmem.v1.EmbedderService/DeleteEmbedderNote: 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:
credentialsare returned only byGetEmbedderwhen explicitly requested and separately authorized. Create, update, and list responses omit them.
Notes:
- All timestamps are UTC (
google.protobuf.Timestamp). provider_typeis IMMUTABLE after creation.
Input format:
input_formatshapes the text sent to the model:query_templateapplies to retrieval queries anddocument_templateapplies to each indexed chunk.- A nonempty format is not accepted for
PROVIDER_TYPE_VOYAGE,PROVIDER_TYPE_COHERE,PROVIDER_TYPE_JINA, orPROVIDER_TYPE_DASHSCOPE. Most of these providers receive a query-or-document role and apply their own instruction. The restriction covers all DashScope embedding dialects, including the contents API, which has no role field. - No supported embedding provider has an instruction field, so an
instructionmust be read byquery_template. - Vectors already stored were built with the
document_templatein effect when their chunks were indexed. Changing it does not re-embed existing chunks.
See also: goodmem.v1.ProviderType, goodmem.v1.Modality, goodmem.v1.ModelInputFormat
| Field | Type | Description |
|---|---|---|
embedder_id | bytes | OUTPUT_ONLY UUID (16 bytes); immutable primary identifier |
display_name | string | REQUIRED on create; ≤255 chars; leading/trailing whitespace trimmed; cannot be empty |
description | string | OPTIONAL |
provider_type | goodmem.v1.ProviderType | REQUIRED on create; IMMUTABLE thereafter. See: goodmem.v1.ProviderType |
endpoint_url | string | REQUIRED 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_path | string | OPTIONAL 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_identifier | string | REQUIRED on create; non-empty after trimming |
dimensionality | int32 | REQUIRED on create; >0 |
distribution_type | goodmem.v1.DistributionType | REQUIRED; UNSPECIFIED invalid on writes |
max_sequence_length | int32 | OPTIONAL; >0 if set; omitted = no enforced limit |
supported_modalities | goodmem.v1.Modality | OUTPUT semantics: server-stored set; default TEXT if omitted at create. See: goodmem.v1.Modality |
credentials | ...dmem.v1.EndpointAuthentication | OPTIONAL 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 |
version | string | OPTIONAL |
monitoring_endpoint | string | OPTIONAL http(s) URL for health/metrics |
owner_id | bytes | OUTPUT_ONLY owner UUID (16 bytes); set at create; not updatable |
dashscope_api_dialect | goodmem.v1.DashScopeApiDialect | OPTIONAL persisted DashScope API dialect; present only for PROVIDER_TYPE_DASHSCOPE. See: goodmem.v1.DashScopeApiDialect |
gemini_endpoint_config | ...oodmem.v1.GeminiEndpointConfig | OPTIONAL persisted Gemini backend routing; present only for PROVIDER_TYPE_GEMINI; omission resolves to DEVELOPER for compatibility. See: goodmem.v1.GeminiEndpointConfig |
input_format | goodmem.v1.ModelInputFormat | OPTIONAL instruction and templates applied to query and document text before embedding; absent = text is sent unchanged. See: goodmem.v1.ModelInputFormat |
created_at | google.protobuf.Timestamp | OUTPUT_ONLY creation timestamp (UTC). See: google.protobuf.Timestamp |
updated_at | google.protobuf.Timestamp | OUTPUT_ONLY last modification timestamp (UTC). See: google.protobuf.Timestamp |
created_by_id | bytes | OUTPUT_ONLY creator actor UUID (16 bytes); derived from auth context at creation |
updated_by_id | bytes | OUTPUT_ONLY last modifier actor UUID (16 bytes); derived from auth context on update |
Embedder.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
CreateEmbedderRequest
| Field | Type | Description |
|---|---|---|
embedder_id | bytes | Optional client-provided UUID (16 bytes); server generates if omitted; returns ALREADY_EXISTS if ID exists |
display_name | string | Required: User-facing name (≤255 chars; leading/trailing whitespace trimmed; cannot be empty) |
description | string | Optional description of the embedder's purpose |
provider_type | goodmem.v1.ProviderType | Required: Provider type; PROVIDER_TYPE_UNSPECIFIED → INVALID_ARGUMENT. See: goodmem.v1.ProviderType |
endpoint_url | string | Required: 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_path | string | Optional 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_identifier | string | Required: Model identifier string (non-empty after trimming) |
dimensionality | int32 | Required: Output vector dimensions (>0) |
distribution_type | goodmem.v1.DistributionType | Required: Embedding type; DISTRIBUTION_TYPE_UNSPECIFIED → INVALID_ARGUMENT |
max_sequence_length | int32 | Optional maximum input sequence length in tokens (>0 if set) |
supported_modalities | goodmem.v1.Modality | Optional supported modalities; empty defaults to TEXT only. See: goodmem.v1.Modality |
credentials | ...dmem.v1.EndpointAuthentication | Optional structured credentials; required only for providers that mandate authentication |
labels | ...ateEmbedderRequest.LabelsEntry | Optional labels (≤20 entries; keys/values ≤255 chars; keys [a-z0-9._-], case-sensitive) |
version | string | Optional version information for the model/service |
monitoring_endpoint | string | Optional http(s) URL for health/metrics |
owner_id | bytes | Optional owner principal UUID (16 bytes); if omitted → authenticated principal; CREATE_EMBEDDER is evaluated using this proposed owner |
dashscope_api_dialect | goodmem.v1.DashScopeApiDialect | Optional 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.GeminiEndpointConfig | Optional Gemini backend routing; valid only for PROVIDER_TYPE_GEMINI; omission defaults to DEVELOPER. See: goodmem.v1.GeminiEndpointConfig |
input_format | goodmem.v1.ModelInputFormat | Optional instruction and templates applied to query and document text; a nonempty format is INVALID_ARGUMENT for PROVIDER_TYPE_VOYAGE, PROVIDER_TYPE_COHERE, PROVIDER_TYPE_JINA, and PROVIDER_TYPE_DASHSCOPE. For PROVIDER_TYPE_GEMINI, omission stores the documented Gemini Embedding 2 templates and a supplied message, even an empty one, is stored as given. See: goodmem.v1.ModelInputFormat |
CreateEmbedderRequest.LabelsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
GetEmbedderRequest
| Field | Type | Description |
|---|---|---|
embedder_id | bytes | Required: Embedder ID (16 bytes UUID) |
include_credentials | bool | Optional: Include stored credentials; requires READ_EMBEDDER_CREDENTIALS and defaults to false |
ListEmbeddersRequest
| Field | Type | Description |
|---|---|---|
owner_id | bytes | Optional filters Optional: Filter by owner (16 bytes UUID) |
provider_type | goodmem.v1.ProviderType | Optional: Filter by provider type; PROVIDER_TYPE_UNSPECIFIED ignored |
label_selectors | ...ersRequest.LabelSelectorsEntry | Optional: conjunction (AND) of exact key=value matches |
ListEmbeddersRequest.LabelSelectorsEntry
| Field | Type | Description |
|---|---|---|
key | string | |
value | string |
ListEmbeddersResponse
| Field | Type | Description |
|---|---|---|
embedders | goodmem.v1.Embedder | List of embedders matching filters and permissions, ordered by created_at DESC then embedder_id DESC |
UpdateEmbedderRequest
| Field | Type | Description |
|---|---|---|
embedder_id | bytes | Required: ID of the embedder to update (16 bytes UUID) |
display_name | string | Optional fields to update (if omitted → unchanged) Update display name (≤255 chars; cannot be empty) |
description | string | Update description |
endpoint_url | string | Update 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_path | string | Update 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_identifier | string | Update model identifier (cannot be empty) |
dimensionality | int32 | Update dimensionality (must be positive integer) |
distribution_type | goodmem.v1.DistributionType | Update distribution type; DISTRIBUTION_TYPE_UNSPECIFIED → INVALID_ARGUMENT |
max_sequence_length | int32 | Update max sequence length in tokens |
supported_modalities | goodmem.v1.Modality | Updates 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.EndpointAuthentication | Update credentials; omit to leave unchanged; a present empty payload is invalid and never clears stored credentials |
version | string | Update version information |
monitoring_endpoint | string | Update monitoring endpoint URL |
dashscope_api_dialect | goodmem.v1.DashScopeApiDialect | Update 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.GeminiEndpointConfig | Atomically replace Gemini backend routing; valid only for PROVIDER_TYPE_GEMINI; omit to preserve the stored value. See: goodmem.v1.GeminiEndpointConfig |
input_format | goodmem.v1.ModelInputFormat | Atomically replace the instruction and templates; omit to preserve the stored value; a present empty message clears it. Changing document_template, including clearing it, while a space references the embedder → FAILED_PRECONDITION. See: goodmem.v1.ModelInputFormat |
replace_labels | goodmem.v1.StringMap | Replace all existing labels with this set. Empty StringMap clears all labels. See: goodmem.v1.StringMap |
merge_labels | goodmem.v1.StringMap | Merge with existing labels: upserts with overwrite. Labels not mentioned are preserved. See: goodmem.v1.StringMap |
DeleteEmbedderRequest
| Field | Type | Description |
|---|---|---|
embedder_id | bytes | Required: 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 practiceDISTRIBUTION_TYPE_DENSE= 1: Dense embeddings (traditional floating-point vectors)DISTRIBUTION_TYPE_SPARSE= 2: Sparse embeddings (high-dimensional sparse vectors)
| Name | Value | Description |
|---|---|---|
DISTRIBUTION_TYPE_UNSPECIFIED | 0 | Invalid distribution type; INVALID_ARGUMENT on writes |
DISTRIBUTION_TYPE_DENSE | 1 | Dense embeddings with floating-point values in all dimensions |
DISTRIBUTION_TYPE_SPARSE | 2 | Sparse embeddings with values in a subset of dimensions |
Decision Model
gRPC DecisionModelService reference for CreateDecisionModel, GetDecisionModel, ListDecisionModels, UpdateDecisionModel and other RPCs, with request messages, response types, and service documentation.
Extension
gRPC ExtensionService reference for CreateExtension, GetExtension, DownloadExtension, ListExtensions and other RPCs, with request messages, response types, and service documentation.