All Products
Search
Document Center

Alibaba Cloud Model Studio:Build a private Q&A assistant without coding

Last Updated:Dec 03, 2024

Large language models (LLMs) cannot directly answer questions about your private knowledge. But you can use Alibaba Cloud Model Studio to create a Q&A assistant based on your private knowledge base without any coding. The whole procedure takes about 8 minutes.

Performance showcase

Application without private knowledge base

Without a private knowledge base, the LLM cannot accurately answer questions about "Bailian phones".

无

Application with private knowledge base

With a private knowledge base, the LLM can provide accurate answers to questions about "Bailian phones".

有

Step 1: Build an application (about 1 minute)

  1. Create a application: Log on to the Alibaba Cloud Model Studio Console. In the left-side navigation pane, select My Applications. Click Create Application. On the dialogue box that appears, click Create Directly on the Agent Application tab.

    image

  2. Change application name: For easier identification, we recommend that you change the application name.

    In this tutorial, the application name is changed to "Bailian Phone Guide".

    image

  3. Select a model: Select an LLM for the application. We recommend Qwen-Max

    You are billed for using the LLMs. Model Studio offers a limited-time free quota. To view the free quota, go to the Models page and click View Details on the desired model card.

    image

  4. Design Prompt: Design the system prompt, which defines the role and task of the application. In this case, enter the following prompt:

    "You are a sales consultant of Bailian phone. Your task is to help customers compare phone specifications, analyze their needs, and provide personalized recommendations."

    image

  5. Test the application: Ask a question in the lower right corner:

    "Help me choose a Bailian phone with the best camera effect, priced under 3000 RMB."
    Due to the lack of knowledge about "Bailian phones", the application may provide vague or even fabricated answers. Next, follow the turtorial to configure a knowledge base.

    image

Step 2: Build a knowledge base (about 3 minutes)

Upload knowledge documents

  1. In the left-side navigation pane, choose Data Management. Click Import Data on the Unstructured Data tab.

    Model Studio provides the Category Management feature for organizing documents. For this tutorial, you can use the default category. After uploading knowledge documents, they are automatically saved under the Default Category.

    image

  2. You can upload the sample file Bailian Phones Specifications.docx. After the document is uploaded, click Confirm.

    The Import Data page provides default configurations. No change is necessary for this tutorial.

    image

  3. Wait until the import is completed.

    The import time depends on the document size, typically ranging from 1 to 6 minutes.

    image

    image

Create a knowledge index

  1. In the left-side navigation pane, choose Data Application > Knowledge Index. Click Create Knowledge Base.

    image

  2. Enter a Name for the knowledge base, and click Next Step.

    The Create Knowledge Base page provides default configurations. No change is necessary for this tutorial.

    image

  3. Choose Select Category and select Default Category.

    Select the category to which your document belongs.

    image

  4. Select Intelligent Splitting in the Data Processing section. Then, click Import.

    Intelligent Splitting is a system preset policy designed to optimize document retrieval for most scenarios.

    image

  5. Wait until the knowledge base is parsed.

    The parsing time depends on the document size, typically 1 to 2 minutes.

    image

Step 3: Add a knowledge base to the application and publish the application (about 1 minute)

  1. In the left-side navigation pane, click My Applications. Then, click Manage of the application you just created.

    image

  2. Enable the Knowledge Base Retrieval Augmentation feature. Then, select the knowledge base you just created.

    The application automatically generates a corresponding prompt. You do not need to modify it.

    image

  3. Try ask a question in the lower-right dialogue box:

    "Help me choose a Bailian phone with the best camera effect, priced under 3000 RMB."
    With knowledge retrieval augmentation enabled, the application can now provide precise answers to your purchase inquiries.

    image

  4. Publish the application: Click Publish in the upper-right corner.

    image

Step 4: Test the application (about 3 minutes)

Model Studio provides a test web page for the application, allowing you to share and test on a small scale.

  1. Access the test web page: Click Call of the Bailian Phone Guide application. On the Sharing Method tab, select Web (PC/H5) and click Create.

image

  1. Customize welcome message and recommended prompts: Click Edit Page to modify the Welcome Message and Recommended Prompts. Click Preview to preview the changes. You can use the following templates for Recommended Prompts:

Welcome Message Title: Hi, I'm your guide!
Welcome message content: I'm here to assist you in selecting the ideal Bailian phone. Feel free to ask:
Recommended Prompt 1: What phones do you have here?
Recommended Prompt 2: Recommend the most cost-effective phone for me.
Recommended Prompt 3: Help me select a Bailian phone that offers the best camera quality for under 3000 yuan.

image

  1. Share the test page: Click Share URL to share the application page with other accounts within the same workspace, such as RAM users, for testing purposes.

    Note that the shared link is not accessible to other Alibaba Cloud accounts.

image

What to do next