REST Resource: projects.locations.ragCorpora

Resource: RagCorpus

A RagCorpus is a RagFile container and a project can have multiple RagCorpora.

Fields
namestring

Output only. The resource name of the RagCorpus.

displayNamestring

Required. The display name of the RagCorpus. The name can be up to 128 characters long and can consist of any UTF-8 characters.

descriptionstring

Optional. The description of the RagCorpus.

createTimestring (Timestamp format)

Output only. timestamp when this RagCorpus was created.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples:"2014-10-02T15:01:23Z","2014-10-02T15:01:23.045123456Z" or"2014-10-02T15:01:23+05:30".

updateTimestring (Timestamp format)

Output only. timestamp when this RagCorpus was last updated.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples:"2014-10-02T15:01:23Z","2014-10-02T15:01:23.045123456Z" or"2014-10-02T15:01:23+05:30".

corpusStatusobject (CorpusStatus)

Output only. RagCorpus state.

encryptionSpecobject (EncryptionSpec)

Optional. Immutable. The CMEK key name used to encrypt at-rest data related to this Corpus. Only applicable to RagManagedDb option for Vector DB. This field can only be set at corpus creation time, and cannot be updated or deleted.

satisfiesPzsboolean

Output only. reserved for future use.

satisfiesPziboolean

Output only. reserved for future use.

backend_configUnion type
The backend config of the RagCorpus. It can be data store and/or retrieval engine.backend_config can be only one of the following:
vectorDbConfigobject (RagVectorDbConfig)

Optional. Immutable. The config for the Vector DBs.

vertexAiSearchConfigobject (VertexAiSearchConfig)

Optional. Immutable. The config for the Vertex AI Search.

JSON representation
{"name":string,"displayName":string,"description":string,"createTime":string,"updateTime":string,"corpusStatus":{object (CorpusStatus)},"encryptionSpec":{object (EncryptionSpec)},"satisfiesPzs":boolean,"satisfiesPzi":boolean,// backend_config"vectorDbConfig":{object (RagVectorDbConfig)},"vertexAiSearchConfig":{object (VertexAiSearchConfig)}// Union type}

RagVectorDbConfig

Config for the Vector DB to use for RAG.

Fields
apiAuthobject (ApiAuth)

Authentication config for the chosen Vector DB.

ragEmbeddingModelConfigobject (RagEmbeddingModelConfig)

Optional. Immutable. The embedding model config of the Vector DB.

vector_dbUnion type
The config for the Vector DB.vector_db can be only one of the following:
ragManagedDbobject (RagManagedDb)

The config for the RAG-managed Vector DB.

pineconeobject (Pinecone)

The config for the Pinecone.

vertexVectorSearchobject (VertexVectorSearch)

The config for the Vertex Vector Search.

JSON representation
{"apiAuth":{object (ApiAuth)},"ragEmbeddingModelConfig":{object (RagEmbeddingModelConfig)},// vector_db"ragManagedDb":{object (RagManagedDb)},"pinecone":{object (Pinecone)},"vertexVectorSearch":{object (VertexVectorSearch)}// Union type}

RagManagedDb

The config for the default RAG-managed Vector DB.

Fields
retrieval_strategyUnion type
Choice of retrieval strategy.retrieval_strategy can be only one of the following:
knnobject (KNN)

Performs a KNN search on RagCorpus. Default choice if not specified.

annobject (ANN)

Performs an ANN search on RagCorpus. Use this if you have a lot of files (> 10K) in your RagCorpus and want to reduce the search latency.

JSON representation
{// retrieval_strategy"knn":{object (KNN)},"ann":{object (ANN)}// Union type}

KNN

This type has no fields.

Config for KNN search.

ANN

Config for ANN search.

RagManagedDb uses a tree-based structure to partition data and facilitate faster searches. As a tradeoff, it requires longer indexing time and manual triggering of index rebuild via the ImportRagFiles and ragCorpora.patch API.

Fields
treeDepthinteger

The depth of the tree-based structure. Only depth values of 2 and 3 are supported.

Recommended value is 2 if you have if you have O(10K) files in the RagCorpus and set this to 3 if more than that.

Default value is 2.

leafCountinteger

Number of leaf nodes in the tree-based structure. Each leaf node contains groups of closely related vectors along with their corresponding centroid.

Recommended value is 10 * sqrt(num of RagFiles in your RagCorpus).

Default value is 500.

JSON representation
{"treeDepth":integer,"leafCount":integer}

Pinecone

The config for the Pinecone.

Fields
indexNamestring

Pinecone index name. This value cannot be changed after it's set.

JSON representation
{"indexName":string}

VertexVectorSearch

The config for the Vertex Vector Search.

Fields
indexEndpointstring

The resource name of the Index Endpoint. Format:projects/{project}/locations/{location}/indexEndpoints/{indexEndpoint}

indexstring

The resource name of the Index. Format:projects/{project}/locations/{location}/indexes/{index}

JSON representation
{"indexEndpoint":string,"index":string}

ApiAuth

The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead.

Fields
auth_configUnion type
The auth config.auth_config can be only one of the following:
apiKeyConfigobject (ApiKeyConfig)

The API secret.

JSON representation
{// auth_config"apiKeyConfig":{object (ApiKeyConfig)}// Union type}

RagEmbeddingModelConfig

Config for the embedding model to use for RAG.

Fields
model_configUnion type
The model config to use.model_config can be only one of the following:
vertexPredictionEndpointobject (VertexPredictionEndpoint)

The Vertex AI Prediction Endpoint that either refers to a publisher model or an endpoint that is hosting a 1P fine-tuned text embedding model. endpoints hosting non-1P fine-tuned text embedding models are currently not supported. This is used for dense vector search.

JSON representation
{// model_config"vertexPredictionEndpoint":{object (VertexPredictionEndpoint)}// Union type}

VertexPredictionEndpoint

Config representing a model hosted on Vertex Prediction Endpoint.

Fields
endpointstring

Required. The endpoint resource name. Format:projects/{project}/locations/{location}/publishers/{publisher}/models/{model} orprojects/{project}/locations/{location}/endpoints/{endpoint}

modelstring

Output only. The resource name of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model. Pattern:projects/{project}/locations/{location}/models/{model}

modelVersionIdstring

Output only. version id of the model that is deployed on the endpoint. Present only when the endpoint is not a publisher model.

JSON representation
{"endpoint":string,"model":string,"modelVersionId":string}

VertexAiSearchConfig

Config for the Vertex AI Search.

Fields
servingConfigstring

Vertex AI Search Serving Config resource full name. For example,projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{servingConfig} orprojects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/servingConfigs/{servingConfig}.

JSON representation
{"servingConfig":string}

CorpusStatus

RagCorpus status.

Fields
stateenum (State)

Output only. RagCorpus life state.

errorStatusstring

Output only. Only when thestate field is ERROR.

JSON representation
{"state":enum (State),"errorStatus":string}

State

RagCorpus life state.

Enums
UNKNOWNThis state is not supposed to happen.
INITIALIZEDRagCorpus resource entry is initialized, but hasn't done validation.
ACTIVERagCorpus is provisioned successfully and is ready to serve.
ERRORRagCorpus is in a problematic situation. SeeerrorMessage field for details.

Methods

create

Creates a RagCorpus.

delete

Deletes a RagCorpus.

get

Gets a RagCorpus.

list

Lists RagCorpora in a Location.

patch

Updates a RagCorpus.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-02 UTC.