Chapter 3. Create an AutoRAG optimization run
Create an AutoRAG optimization run to find the best RAG configuration for your documents and use case. You configure the optimization run in a two-step wizard that collects connection details and optimization settings.
Prerequisites
- You have editor access to a project in OpenShift AI.
- Gen AI studio is enabled in the OpenShift AI dashboard.
- A Llama Stack instance is available and configured with foundation and embedding models. For more information, see Working with Llama Stack.
- A remote Milvus vector database is registered with your Llama Stack instance. Inline Milvus is not supported.
- A Llama Stack connection is configured in your project. The connection must include the Llama Stack base URL and API key.
- Your documents are available in an S3-compatible storage bucket or locally for upload.
- If you store multiple documents in S3, they are in a single folder in the bucket.
- Documents are in one of the following formats: PDF, DOCX, PPTX, Markdown, HTML, or TXT.
- You have prepared a test data file in JSON format. For more information, see Prepare test data for AutoRAG.
Procedure
- In the OpenShift AI dashboard, click Gen AI studio > AutoRAG.
- Select your project, and then click Create AutoRAG optimization run.
- Enter a name and optionally a description for the optimization run, select a Llama Stack connection, and click Next.
Configure the optimization settings as follows:
- In the Knowledge setup section, select an S3 connection for your documents and select the files to use. You can browse your S3 bucket or upload files directly. Uploaded files can be up to 32 MiB.
- Select your Milvus vector database from the Vector I/O provider list.
- Add an evaluation data set by browsing your S3 bucket for a JSON file or by uploading one directly. You can download a template from the evaluation dataset template link on the configuration page.
Select an optimization metric from the Optimization metric list:
- Answer faithfulness: Optimizes for answers grounded in retrieved context.
- Answer correctness: Optimizes for answers that match your test data.
- Context correctness: Optimizes for retrieval of relevant documents.
- In the Maximum RAG patterns field, enter a value between 4 and 20. The default is 8.
Optional: Click Edit on the model configuration card to exclude models. By default, all foundation and embedding models available from your Llama Stack instance are selected. Select no more than 3 foundation models and 2 embedding models to avoid run failures.
TipFor embedding models,
BAAI/bge-m3is recommended. For more information, see AutoRAG configuration parameters.NoteOptimization runs cannot be edited after creation. To stop, archive, or delete the underlying pipeline run, see Managing pipeline runs.
Click Create run.
AutoRAG begins testing RAG configurations. You can monitor the optimization run status on the AutoRAG page.
Verification
- On the AutoRAG page, the new optimization run is listed with a status of Running or Pending.
- The run progresses to Complete when AutoRAG finishes testing all RAG configurations.