To enhance knowledge augmentation, the feature-rich RAG tabular base is replacing the Sample Prompt Library. This guide details the migration process.
Workflow
The process consists of four main steps:
-
Export data: Export data from the Sample Prompt Library to your local machine.
-
Create and import: Create a new RAG tabular base and import the exported file.
-
Update application configuration: In your Agent Application, add the RAG tabular base as a knowledge source.
-
Test and publish: Debug and test the response quality, then Publish the application.
Procedure
Step 1: Export Sample Prompt Library data
Navigate to the Sample Library page, select the library to migrate, and click Export Data. The data table is saved to your local machine.
Step 2: Create a RAG tabular base and import data
Related documentation: Create and use a knowledge base.
-
Provide basic information
Navigate to the Knowledge Base page and create a Data Query knowledge base:
In the Knowledge Base Name field, enter a name. For Knowledge Base Type, select Data Query, and then click Next.
-
Import data
Upload the data table exported in Step 1 and provide a name for it.
Select the Upload Data Table tab. In the Data Table Name field, enter
Knowledge Content Table. After the file is uploaded, click Next. -
Index settings
-
To replicate the retrieval behavior of the legacy Sample Prompt Library (which matches based only on the question column), turn off the Used for Retrieval switch for the
answerfield. -
After confirming the settings, click Complete.
In the default configuration, multi-turn dialogue rewrite is enabled. The vector model is set to Official Vector v4 (New), and the ranking model is set to Official Ranking. The similarity threshold is set to
0.20, and the maximum recall count is set to5. -
Step 3: Update agent application configuration
-
In the application, turn off the Sample Library toggle and remove the Sample Prompt Library variables from the prompt.
-
Click the plus sign (+) next to Table to add the RAG tabular base that you created in the previous step. In the Knowledge configuration panel, under the Table section, click + to add a tabular knowledge base (for example, "Technical Knowledge Content"). You can then configure parameters such as the similarity threshold and weight.
-
(Optional) Optimize the retrieval strategy. Click Debug to modify the strategy and adjust the recall process based on your business needs. You can debug by entering questions in the panel on the right.
For faster response times, you can clear the Multi-round Conversation Rewriting checkbox, disable the Re-ranking Strategy, and adjust the Assembly Strategy.
In the Assembly strategy area, you can select By recall count and tune the parameters by using the Number of recalled segments and Max assembly length (token) sliders.
Step 4: Test and publish
In the debugging window on the right, enter a query related to the tabular base to test whether the model retrieves content from the RAG tabular base to generate an answer.
After successful testing, publish the application to apply the configuration changes.
API calls
To get detailed retrieval information for debugging, set the has_thoughts request parameter to true in your API call. The response will then include the thoughts field, which contains detailed information about the retrieval process for debugging and validation.
For a sample call, see Application call - retrieve from knowledge base.
Billing
The knowledge base uses a pay-as-you-go (post-paid) billing method. Usage for the billable items listed below is measured hourly and automatically deducted from your Alibaba Cloud account. Ensure that your account balance is sufficient (you can add funds on the Billing and Costs page) to avoid service interruptions due to an overdue payment.
|
Billable item |
Description |
|
Specification fee |
The fees for |
|
Vector and ranking model call fees |
Creating, updating, or retrieving from a knowledge base calls vector (embedding) and ranking (rerank) models, which incurs charges based on input token usage. For pricing, refer to the Model Inference Billing page. |
Check bills: Billing details
FAQ
-
Why should I migrate to a RAG tabular base?
Capacity and format: A RAG tabular base has no entry limit, unlike the Sample Prompt Library, which is limited to 300 Q&A pairs.
Retrieval and recall: The Sample Prompt Library does not support custom recall strategies. In contrast, a RAG tabular base replicates the sample library's functionality and supports configurable retrieval and recall strategies for greater flexibility.
-
After migrating to a RAG tabular base, will the model's response quality be the same?
Performance will likely improve. The RAG tabular base uses retrieval algorithms and provides extensive configuration options. You can debug and adjust the retrieval settings to optimize performance.