This topic describes how to use a software development kit (SDK) to call a legacy Alibaba Cloud Model Studio retrieval-augmented generation (RAG) application.
Migration plan
The enterprise knowledge base feature is no longer maintained. You must migrate your private knowledge to the new knowledge base as soon as possible. Alibaba Cloud does not provide official migration tools or services. The new knowledge base provides more features and supports more document formats.
| Enterprise knowledge type | Migration plan |
|---|---|
| Documents | Create a non-structured knowledge base to manage document-based knowledge. You can import documents by uploading them from a local device or from Object Storage Service (OSS).If you upload documents from a local device, you must manually update the knowledge base later. If you import documents from Object Storage Service (OSS), you can integrate OSS, Function Compute (FC), and the knowledge base API operations of Model Studio to implement automatic data updates for the knowledge base.You can upload documents from a local device using the console or by calling an API operation. You can import documents from OSS only using the console.For more information, see Knowledge base: Step 1. Import data. |
| FAQ | Create a structured knowledge base to manage FAQ-based knowledge. You can create a structured knowledge base by uploading local documents or based on ApsaraDB RDS.If you upload local documents, you must manually update the knowledge base later. If you create a knowledge base based on ApsaraDB RDS, data updates in the RDS data tables are automatically synchronized to the knowledge base.Currently, both methods can be performed only in the console.For more information, see Knowledge base: Step 1. Import data. |
Prerequisites
- Obtain and configure an API key. For more information, see Obtain and configure an API key and Configure the API key as an environment variable (to be unpublished and merged into Configure an API key).
- Install the latest version of the SDK. The DashScope SDK is available in Python and Java. For more information, see Install the latest version of the SDK.
- A retrieval-augmented generation (RAG) application has been created (new ones are no longer supported), and enterprise knowledge has been uploaded as described in Upload enterprise knowledge.
- Obtain the app ID. You can find the app ID on the target application's card on the My Applications page.