Manage your RAG knowledge base (corpus)

This page describes how you can manage your corpus for RAG tasks by performing corpus management and file management.

Corpus management

A corpus, also referred to as an index, is a collection of documents or source of information. The corpus can be queried to retrieve relevant contexts for response generation. When creating a corpus for the first time, the process might take an additional minute.

The following corpus operations are supported:

Operation Description Parameters Examples
Create a RAG corpus. Create an index to import or upload documents. Create parameters v1beta1
Create parameters v1
Create example v1beta1
Create example v1
Update a RAG corpus. Update a previously-created index to import or upload documents. Update parameters v1beta1
Update parameters v1
Update example v1beta1
Update example v1
List a RAG corpus. List all of the indexes. List parameters v1beta1
List parameters v1
List example v1beta1
List example v1
Get a RAG corpus. Get the metadata describing the index. Get parameters v1beta1
Get parameters v1
Get example v1beta1
Get example v1
Delete a RAG corpus. Delete the index. Delete parameters v1beta1
Delete parameters v1
Delete example v1beta1
Delete example v1

Concurrent operations on corpora aren't supported. For more information, see the RAG API reference for v1beta1 or RAG API reference for v1.

File management

The following file operations are supported:

Operation Description Parameters Examples
Upload a RAG file. Upload a file from local storage with additional information that provides context to the LLM to generate more accurate responses. Upload parameters v1beta1
Upload parameters v1
Upload example v1beta1
Upload example v1
Import RAG files. Import a set of files from some other storage into a storage location. Import parameters v1beta1
Import parameters v1
Import example v1beta1
Import example v1
Get a RAG file. Get details about a RAG file for use by the LLM. Get parameters v1beta1
Get parameters v1
Get example v1beta1
Get example v1
Delete a RAG file. Upload a file from local storage with additional information that provides context to the LLM to generate more accurate responses. Delete parameters v1beta1
Delete parameters v1
Delete example v1beta1
Delete example v1

For more information, see the RAG API reference for v1beta1 or RAG API reference for v1.

What's next