Retriever Service

Top
GraphRAGRetrieversServiceV1

The service definition for GraphRAG retrieval queries.

HTTP Bindings

Endpoint Method RPC Method Body
/v1/graphrag-query POST ProcessGraphRAGQuery *
/v1/graphrag-query-stream POST ProcessGraphRAGQueryStream *
/v1/health GET HealthCheck
/v1/retriever-runs GET ListRetrieverRuns
/v1/retriever-runs/{run_id} GET GetRetrieverRun
/v1/retriever-runs/{run_id} DELETE DeleteRetrieverRun
/v1/projects/{project}/model-config/credentials PUT UpdateModelConfig *

Methods

Method Name Request Type Response Type
ProcessGraphRAGQuery GraphRAGQueryRequest GraphRAGQueryResponse

Process a GraphRAG query (either global or local or unified) and return the retrieval result.

ProcessGraphRAGQueryStream GraphRAGQueryRequest GraphRagQueryResponseChunk stream

Server-streaming variant for incremental responses (e.g., token or progress streaming)

HealthCheck HealthCheckRequest HealthCheckResponse

Health check endpoint to verify service availability.

ListRetrieverRuns ListRetrieverRunsRequest ListRetrieverRunsResponse

Query-run history. List the project's query runs.

GetRetrieverRun GetRetrieverRunRequest RetrieverRun

Get a single query run by id.

DeleteRetrieverRun DeleteRetrieverRunRequest DeleteRetrieverRunResponse

Soft-delete a single query run by id.

UpdateModelConfig UpdateModelConfigRequest ModelConfigCredentialsResponse

Update runtime model/provider credentials without restarting the pod.

DeleteRetrieverRunRequest

Field Type Label Description
run_id string

DeleteRetrieverRunResponse

Field Type Label Description
success bool

GetRetrieverRunRequest

Field Type Label Description
run_id string

GraphRAGQueryRequest

A request to perform a GraphRAG query.

Field Type Label Description
query string

The query string for retrieval, e.g. "What is the capital of France?"

level int32

The desired level for community schema retrieval (if applicable). Defaults to 2 if not provided.

query_type QueryType

The type of query to perform: GLOBAL, LOCAL, UNIFIED, or CUSTOM. If not specified, defaults to GLOBAL.

response_instructions string

Instructions passed to the LLM to specify a custom response generation style (e.g "Short answer", "Multiple paragraphs", "Sarcastic answer", etc.). If not specified, uses the default response types specified by the Local & Global & Unified Query Parameters.

include_metadata bool

Whether to include metadata in the response. If not specified, defaults to false.

use_llm_planner bool optional

Whether to use the LLM planner for intelligent query processing. If true, the LLM planner will orchestrate the query using both local and global retrievers. If not specified, defaults to true for LOCAL queries.

partition_ids string repeated

Optional parameter to filter retrieval by specific partition IDs. Cannot be combined with auto_select_partitions.

use_cache bool optional

Whether to use the cache for this query. If true, checks cache for hits and saves responses to cache. If false, skips cache entirely (no check, no write). If not specified, defaults to false.

show_citations bool optional

Whether to show inline citations in the response. If true, citations will be formatted as [[X](URL)] or [X] in the response. If false, all [CITE:X] patterns will be removed from the response. If not specified, defaults to true. Note: For deep search queries (use_llm_planner=true), citations are always disabled.

custom_prompts GraphRAGQueryRequest.CustomPromptsEntry repeated

Custom prompts to override default system prompts. Maps prompt keys to custom prompt strings. Only specified prompts are overridden; others use defaults. Valid keys: local_rag_response, global_reduce_rag_response, global_map_rag_points, ds_generate_plan, ds_step_query, ds_completion_check, ds_final_synthesis, no_relevant_data_message.

custom_tools string repeated

Custom tools for advanced retrieval scenarios. List of tool IDs for explicit custom retriever execution with query_type=CUSTOM. When provided with CUSTOM query type, these custom retrievers will be executed directly. Format: ["chunk_context_expander_v1", "hybrid_search_and_expand_communities_v1"]

auto_create_indexes bool optional

CUSTOM index/view creation. Tool config takes precedence over this field; if neither is set, missing indexes/views are created automatically.

model string

Optional per-query chat model override. If provided, this model is used instead of the deploy-time default for this query only. If empty/omitted, the deploy-time default model is used (current behavior). Embedding model is never affected by this field.

mode QueryMode

Optional UI routing alias. When set, mode overrides query_type/use_llm_planner: INSTANT -> query_type=UNIFIED, use_llm_planner=false DEEP_SEARCH -> query_type=CUSTOM, use_llm_planner=true

auto_select_partitions bool optional

If omitted or true, the service will search the AutoGraph corpus graph to select relevant partition IDs automatically. Set false to disable. Cannot be combined with partition_ids.

GraphRAGQueryRequest.CustomPromptsEntry

Field Type Label Description
key string

value string

GraphRAGQueryResponse

The response from a GraphRAG query.

Field Type Label Description
result string

The textual result of the retrieval process.

metadata string

Optional additional metadata about the result, if needed in the future.

run_id string

Identifier of the persisted query run.

error_code string

Empty on success. On failure: the same machine-readable code the model-config endpoint returns, so a provider problem hit mid-query (INSUFFICIENT_QUOTA, INVALID_API_KEY, KEY_EXPIRED, MODEL_NOT_FOUND, ...) reads the same as one caught while saving credentials. Falls back to PROCESSING_ERROR for failures that are not provider failures.

GraphRagQueryResponseChunk

Streaming response chunk for ProcessGraphRAGQueryStream

Field Type Label Description
delta string

Token/partial text chunk

final_result string

Final full result text (populated on the last chunk)

metadata string

Optional metadata (can be incremental or final, JSON-encoded if needed)

is_final bool

True on the last chunk

run_id string

Identifier of the persisted query run.

error_code string

Empty on success. Same codes as GraphRAGQueryResponse.error_code, set on the chunk that reports the failure.

HealthCheckRequest

Empty request for health check as per standard health check patterns.

HealthCheckResponse

Health check response indicating the current server status.

Field Type Label Description
status string

Current health status (e.g. "OK", "BAD")

message string

Optional detailed message about health status.

ListRetrieverRunsRequest

Request to list the project's runs.

Field Type Label Description
limit int32

Optional cap on the number of runs returned (0 = no explicit limit).

ListRetrieverRunsResponse

Field Type Label Description
runs RetrieverRun repeated

ModelConfigCredentialsResponse

Response for UpdateModelConfig. Validation failures return HTTP 200 with valid=false (not 422). Clients should inspect valid/field/error_code/message rather than HTTP status.

Field Type Label Description
applied bool

True if credentials were successfully validated and persisted.

valid bool

True if all validation checks passed.

applied_to_running_pod bool

True if config was applied to the running pod (no restart needed).

key_status string

"valid" | "invalid" | "expired" | "rate_limited" | "insufficient_quota", or "" when the live probe could not tell (endpoint unreachable, timeout, or the request failed before the probe ran).

field string

On validation failure: which field failed.

error_code string

On validation failure: machine-readable error code. Request errors: PROJECT_MISMATCH, PROVIDER_REQUIRED, INVALID_PROVIDER, PROVIDER_MISMATCH, MODEL_REQUIRED, SECRET_PROFILE_REQUIRED, SECRET_NOT_FOUND, SECRET_RESOLUTION_ERROR, SECRET_PROFILE_INVALID. Live probe errors: INVALID_API_KEY, KEY_EXPIRED, INSUFFICIENT_QUOTA, RATE_LIMITED, PERMISSION_DENIED, MODEL_NOT_FOUND, MODEL_REJECTED_REQUEST, ENDPOINT_UNREACHABLE, TIMEOUT, PROVIDER_ERROR, PROVIDER_EMPTY_RESPONSE, API_KEY_REQUIRED, INVALID_BASE_URL, UNKNOWN_VALIDATION_ERROR. Persistence errors: METADATA_CLIENT_UNAVAILABLE, METADATA_WRITE_TIMEOUT, METADATA_WRITE_FAILED, SERVICE_NOT_REGISTERED.

message string

On validation failure: human-readable message.

RetrieverRun

A single persisted query run (one request = one question = one answer).

Field Type Label Description
run_id string

query string

response string

metadata string

Metadata returned for this run.

query_type string

GLOBAL | LOCAL | UNIFIED | CUSTOM

model string

retriever_service_id string

status string

streaming | complete | error

error string

duration_ms int64

config_snapshot string

JSON string of the query parameters used

created_at string

updated_at string

UpdateModelConfigRequest

Request to update all runtime model credentials for this retriever pod. The change is applied in-place (no restart) and persisted in project metadata. URL semantics: omit/null = unchanged; empty string = reset to provider default. Chat/embedding providers: "openai" | "custom". Triton remains env/CLI-only.

Field Type Label Description
project string

chat_api_provider string

"openai" | "custom" — required

embedding_api_provider string

"openai" | "custom" — required

chat_model string

embedding_model string

chat_secret_profile_id string

embedding_secret_profile_id string

chat_api_url string optional

embedding_api_url string optional

Provider

Enumeration of provider types.

Name Number Description
OPENAI 0

TRITON 1

QueryMode

Optional routing alias for UI consumers.

Name Number Description
QUERY_MODE_UNSPECIFIED 0

INSTANT 1

DEEP_SEARCH 2

QueryType

Enumeration of query types.

Name Number Description
QUERY_TYPE_UNSPECIFIED 0

GLOBAL 1

LOCAL 2

UNIFIED 3

CUSTOM 4

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)